Fix querier panic on tag value autocomplete with only metadata-only intrinsic conditions - #7705
Draft
zalegrala wants to merge 2 commits into
Draft
Fix querier panic on tag value autocomplete with only metadata-only intrinsic conditions#7705zalegrala wants to merge 2 commits into
zalegrala wants to merge 2 commits into
Conversation
zalegrala
force-pushed
the
fix-tagvalues-empty-join-panic
branch
from
August 6, 2026 19:17
93fcba1 to
95e3034
Compare
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:
Fixes a querier panic when every condition in a tag value autocomplete request is a metadata-only intrinsic.
SearchTagValuesV2forspan:idwith query{trace:id="..."}crashes the process:span:id,span:startTime,trace:idandtrace:startare skipped with a barecontinueand contribute no iterator. When every condition is one of those, the span stage yieldsnilandcreateDistinctTraceIteratorbuilds aJoinIteratorover an empty slice, which indexesj.peeks[0]unconditionally.NewLeftJoinIteratoralready rejects this shape;NewJoinIteratordoesn't, and giving it an error return would touch ~45 call sites. So this fixes the two places that produce the degenerate input:createDistinctTraceIteratorreturnsnil, nilwhen it has nothing to join, matchingcreateDistinctAttributeIterator.autocompleteItercall sites skip aniliterator. Required, not defensive — without it the same request panics on WAL blocks atwal_block.go:876.Applied to vparquet3/4/5; identical code, all three reproduce. Behaviour change is limited to the crashing case: these requests now return no values, as these intrinsics already do elsewhere in this path.
Separately, these conditions are dropped rather than applied, so
{trace:id="..."}returns tag values from other traces. Tracked in #7706; out of scope here.Which issue(s) this PR fixes:
None filed; found from a production panic.
Checklist
TestFetchTagValuesplus a newTestWalBlockFetchTagValuesMetadataOnlyIntrinsics(WAL autocomplete had no coverage); all panic without the fix.chloggen/