querier: limit number of blocks queried with one store-gateway request - #16292
Open
narqo wants to merge 5 commits into
Open
querier: limit number of blocks queried with one store-gateway request#16292narqo wants to merge 5 commits into
narqo wants to merge 5 commits into
Conversation
Contributor
|
💻 Deploy preview available (Mimir): |
narqo
commented
Aug 4, 2026
narqo
force-pushed
the
vrnkn/querier-max-blocks-per-store-request
branch
3 times, most recently
from
August 5, 2026 13:07
62cb6b7 to
23e6bad
Compare
narqo
force-pushed
the
vrnkn/querier-max-blocks-per-store-request
branch
from
August 6, 2026 09:48
8d47850 to
821ed41
Compare
narqo
marked this pull request as ready for review
August 6, 2026 10:59
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 202e176. Configure here.
narqo
commented
Aug 6, 2026
Comment on lines
+1058
to
+1061
| // Concurrently fetch series from all clients. A client may have multiple partitions; each | ||
| // partition is one independent RPC to the same store-gateway. | ||
| for c, partitions := range clients { | ||
| for _, blockIDs := range partitions { |
Contributor
Author
There was a problem hiding this comment.
Note for the reviewers: the diffs here and below look scarier than what the changes did. We simply wrapped the loop over the list of blocks with a loop over block partitions. The body was just shifted one indentation level.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What this PR does
The PR adds a new experimental per-tenant limit,
max_blocks_per_store_request(disabled by default), that controls how many blocks a single query can request from one store-gateway instance. If a request spills over the limit, this request is split into multiple partitions, each executed concurrently against the instance.For detailed rational see #16021
While testing the feature in a dev cell, I saw some improvement, and I believe it should be good for further testing.
Results from dev testing
Before (a request hinted 40 blocks to one store-gw instance)
After (the same request is split into several sub-requests, hinting up to 20 blocks from a store-gw instance)
On the store-gw side in this test, each request was bounded with up to 20
bucketBlock.ensurelndexHeaderLoadedcalls per request. The total number of concurrent requests, a store-gw instance accepts is limited by store-gw's global concurrency gate.Which issue(s) this PR fixes or relates to
Fixes #16021