Add partial result detection to metadata queries when shard limit is exceeded (Metadata limits PR2) - #2214
Open
bhavanap1131-cmd wants to merge 8 commits into
Open
Conversation
alextheimer
reviewed
May 22, 2026
alextheimer
approved these changes
May 30, 2026
alextheimer
left a comment
Contributor
There was a problem hiding this comment.
Just one non-blocking comment 👍
…f hardcoded 1M limit Replace the hardcoded 1,000,000 limit in LabelCardinalityExec with queryContext.plannerParams.enforcedLimits.execPlanLeafSamples so the limit is configurable per query. Add test verifying the limit is respected.
…ed shard limits Add querySession param to partKeysWithFilters across store interface and impls to detect truncation. Set resultCouldBePartial in DownsampledTimeSeriesShard label value iterators, TimeSeriesShard/DownsampledTimeSeriesShard partKeysWithFilters, and MetadataExecPlan LabelValuesExec/PartKeysExec when shard limits are hit.
…nd iterator checks - Strengthen partial result reason messages from vague "may be partial" to actionable s"Some shards returned a result size greater than $limit; apply more filters or reduce the query time-range." across all locations - Add resultCouldBePartial checks to SingleLabelValuesResultIterator and LabelValueResultIterator in TimeSeriesShard (in-memory shard path was missing the flag, only DownsampledTimeSeriesShard had it) - Update existing test assertions to match new message format - Add tests for single-label and multi-label filter paths hitting execPlanSamples limit in LabelValuesExec Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…partial result check Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ar scalastyle limit Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bhavanap1131-cmd
force-pushed
the
metadata_limits_P2
branch
from
June 1, 2026 21:14
9aee1f9 to
60b252c
Compare
alextheimer
reviewed
Jul 26, 2026
alextheimer
left a comment
Contributor
There was a problem hiding this comment.
Could you restore this PR with git reflog, as well?
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.
Summary:
Metadata queries (/series, /labels, /label/values, label cardinality) previously had no way to signal that results were truncated when a shard hit its enforced limit. This PR propagates QuerySession into the metadata query paths so shards can flag resultCouldBePartial = true when the result count equals the limit, allowing callers to send a partial results warning to the user.
New Changes: