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

Add query sharding support to ingesters #140

Merged
merged 1 commit into from Aug 17, 2021

Conversation

pracucci
Copy link
Collaborator

What this PR does:
In grafana/mimir-prometheus#1 we've added sharding support to TSDB. In this PR I'm leveraging on that to add query sharding support to ingesters. The logic is pretty easy: when a query has the sharding label, than pass it along with SelectHints down to TSDB.

Draft because it builds on top of #139.

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]

_, err = i.v2Push(ctx, req)
require.NoError(t, err)

// Push all series. We push half of the series, then we compact the TSDB head into a block (flush)
Copy link
Collaborator Author

@pracucci pracucci Aug 16, 2021

Choose a reason for hiding this comment

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

Instead of adding a new test, I've preferred extending TestIngester_v2QueryStream() so that we further improve it (eg. now it both queries compacted block and head, instead of just head). The diff is a bit difficult to read: I suggest to read the whole new implementation of this test.

Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci pracucci force-pushed the add-sharding-support-to-ingesters branch from 1b60014 to c3f4560 Compare August 17, 2021 09:31
@pracucci pracucci marked this pull request as ready for review August 17, 2021 09:31
Copy link
Member

@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.

Nice work.

@pracucci pracucci merged commit 16d8104 into main Aug 17, 2021
@pracucci pracucci deleted the add-sharding-support-to-ingesters branch August 17, 2021 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants