Skip to content

Optionally write stub entries to the chunk cache from ingesters #1482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2019

Conversation

bboreham
Copy link
Contributor

This an optional optimisation for #1475 - if we have a dedicated cache just for de-duplicating writes then we don't need to store the chunk data in it, just a placeholder for the key.

@bboreham bboreham force-pushed the chunk-cache-stubs branch 2 times, most recently from d99e415 to 9f9d53b Compare July 2, 2019 10:05
Copy link
Contributor

@csmarchbanks csmarchbanks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM, added a couple small comments/questions.

@@ -69,6 +70,7 @@ type StoreConfig struct {
// RegisterFlags adds the flags required to config this to the given FlagSet
func (cfg *StoreConfig) RegisterFlags(f *flag.FlagSet) {
cfg.ChunkCacheConfig.RegisterFlagsWithPrefix("", "Cache config for chunks. ", f)
f.BoolVar(&cfg.ChunkCacheStubs, "store.chunk-cache-stubs", false, "If true, don't write the full chunk to cache, just a stub entry.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should only be set on the ingester correct? Would prefixing it with ingester make sense even though it is in the store config?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you're getting at, but not sure about the suggestion.
Yes, it's only supposed to be set when storing chunks, which we only do in the ingester today.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I wasn't sure of my suggestion either. I am happy with it as is.

Designed for the case where you don't want to cache every chunk
written by ingesters, but you do want to take advantage of chunk write
deduplication.

Signed-off-by: Bryan Boreham <[email protected]>
@bboreham bboreham force-pushed the chunk-cache-stubs branch from 9f9d53b to 1afc6b4 Compare July 2, 2019 16:02
@bboreham
Copy link
Contributor Author

bboreham commented Jul 2, 2019

I renamed the field so it won't be visible in yaml

@bboreham bboreham merged commit 795dd59 into master Jul 2, 2019
@bboreham bboreham deleted the chunk-cache-stubs branch July 2, 2019 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants