Skip to content

Added block index attributes caching support to metadata cache #3629

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

Conversation

pracucci
Copy link
Contributor

What this PR does:
The Thanos index-header reader issue an Attributes() request, other than get range requests:

https://github.com/thanos-io/thanos/blob/e9260e30f265f60e17d3f61ff361fb7357b3d34a/pkg/block/indexheader/binary_reader.go#L132-L134

The Attributes() API call is issued for each new block loaded in the store-gateway. Considering we replica blocks across store-gateway (defaults to a replication factor = 3), we may save some object store API calls caching the attributes in the metadata cache (block index is immutable, so it's safe to cache it).

Which issue(s) this PR fixes:
N/A

Checklist

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

Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci pracucci changed the title Added block index attributes caching support to metadata cache Added bucket index attributes caching support to metadata cache Jan 4, 2021
@pracucci pracucci changed the title Added bucket index attributes caching support to metadata cache Added block index attributes caching support to metadata cache Jan 4, 2021
Copy link
Contributor

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

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

LGTM, nice catch.

@pracucci pracucci merged commit 81d2f6d into cortexproject:master Jan 4, 2021
@pracucci pracucci deleted the cache-block-index-attributes branch January 4, 2021 08:22
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.

3 participants