Skip to content
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

StoreGateway: Allow filtering out recent blocks during sync #5166

Merged
merged 2 commits into from
Feb 22, 2023

Conversation

harry671003
Copy link
Contributor

@harry671003 harry671003 commented Feb 21, 2023

What this PR does:

  • This PR introduces a new configuration (disabled by default) -blocks-storage.bucket-store.ignore-blocks-within which can be used to ignore recently created blocks from being synced by store-gateways/querier.
  • The motivation for this is to improve the startup time for store-gateways. When store-gateways restarts, they have to fetch the index-header for all the blocks in the object store.
  • I've seen that in very large Cortex clusters, 100M+ active series with 100s of ingesters, there will a lot of non-compacted blocks in the object store. Syncing a lot of blocks delays the start up for store-gateways.
  • But, if -querier.query-store-after=24h is enabled and set to say 24h, the recently created blocks need not be fetched by store-gateway. In this case turning on this feature by setting -blocks-storage.bucket-store.ignore-blocks-within=23h can be useful to avoid syncing a lot of the non-compacted blocks.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: 🌲 Harry 🌊 John 🏔 <johrry@amazon.com>
Copy link
Collaborator

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

Nice. One small nit only.

pkg/storegateway/metadata_fetcher_filters.go Outdated Show resolved Hide resolved
Signed-off-by: 🌲 Harry 🌊 John 🏔 <johrry@amazon.com>
@alanprot alanprot merged commit 1da8a0f into cortexproject:master Feb 22, 2023
alexqyle pushed a commit to alexqyle/cortex that referenced this pull request May 2, 2023
…oject#5166)

* Allow filtering out recent blocks during sync

Signed-off-by: 🌲 Harry 🌊 John 🏔 <johrry@amazon.com>

* Fix build failures and comments

Signed-off-by: 🌲 Harry 🌊 John 🏔 <johrry@amazon.com>

---------

Signed-off-by: 🌲 Harry 🌊 John 🏔 <johrry@amazon.com>
Signed-off-by: Alex Le <leqiyue@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants