[core] Skip manual-only tag groups in preview time travel - #10284
Open
LuciferYang wants to merge 2 commits into
Open
LuciferYang wants to merge 2 commits into
LuciferYang wants to merge 2 commits into
Conversation
TagPreview.toOneAutoTag fed every snapshot's tag group into checkAndGetOneAutoTag, whose size==1 state check threw for groups holding only manually created tags, so a Hive preview query for a partition older than every resolvable snapshot crashed with the misleading 'more than 1 auto-created tags' error instead of the intended cannot-find failure. Return null for groups without auto-format tags and filter the nulls in the stream. Assisted-by: GLM-5.3
…nly snapshot group
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.
Purpose
TagPreview.timeTravel's step-3 fallback streams every tagged snapshot's tag group throughtoOneAutoTaginside a.max().toOneAutoTagcallscheckAndGetOneAutoTag, which doescheckState(autoTags.size() == 1), so a snapshot that has only manual tags (emptyautoTags) throwsIllegalStateException: There are more than 1 auto-created tags of the same snapshot: .— a misleading message, since there are zero. Because.max()evaluates every group, one manual-only group poisons the whole fallback: a preview target that genuinely can't be resolved throws that misleading error instead of the cleanCannot find snapshot or tag, and a valid auto tag<=the requested point living on another (often expired) tagged snapshot is never returned.This makes
toOneAutoTagreturn null for a manual-only group and filters nulls before.max(), so manual-only groups are skipped and the fallback resolves the best auto tag as intended.This closes #10283.
Tests
testTimeTravelSkipsManualOnlySnapshotspins that a non-resolvable preview returns the cleanCannot find snapshot or tagerror instead of the misleading auto-tagcheckState.testTimeTravelResolvesAutoTagDespiteManualOnlyGrouppins that a valid auto tag on an expired snapshot is still resolved when another snapshot has only a manual tag.API and Format
No.
Documentation
No.