Skip to content

Proposal: introduce bucket index for the blocks storage #3554

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
Dec 9, 2020

Conversation

pracucci
Copy link
Contributor

@pracucci pracucci commented Dec 1, 2020

What this PR does:
As previously shared in the CNCF Slack channel, I'm proposing to add a per-tenant bucket index to improve scalability of Cortex blocks storage when running a cluster with thousands of tenants. This PR is contains the design doc originally shared via google doc.

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>

## Out of scope

We believe the same technique described in this proposal could be applied to optimise the store-gateway too (we've built a [PoC](https://github.com/cortexproject/cortex/compare/pracucci:experiment-object-store-based-blocks-index)), however to keep the design doc easier to discuss we suggest to keep the store-gateway out of scope and address it in a follow-up design doc.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any reason the store-gateway would need significant changes to how the index is loaded and used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not significant changes, but the problem is that the store-gateway would have to preload all index-headers anyway, so the main objection would be "preloading all index-headers is still a pain, even with the bucket index in place". I have an idea to not preload all index-headers in the store-gateway, but I would prefer to discuss it in a separate design doc, to keep this doc lighter.

There are few reasons why the compactor may be a good candidate to write the bucket index:

- The compactor already scans the bucket to have a consistent view of the blocks before running a compaction. Writing the bucket index in the compactor would require no additional bucket API calls.
- Queriers and store-gateways currently read only from the bucket (no writes). We believe that it may be a nice property to preserve.
Copy link
Contributor

Choose a reason for hiding this comment

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

+1

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.

👍

@pracucci pracucci merged commit da4cf56 into cortexproject:master Dec 9, 2020
@pracucci pracucci deleted the bucket-index-proposal branch December 9, 2020 09:17
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