Repository navigation
Conversation
LsomeYeah
marked this pull request as ready for review
October 30, 2026 02:15
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
Fix snapshot-ID time travel when reading with a fallback or primary branch whose snapshots do not cover the requested time.
The existing
rewriteOtherOptions()converts the current branch's snapshot ID to a commit time and finds a snapshot in the other branch at or before that time. When none exists, it substitutes snapshot 1 without checking availability. This makes an empty branch fail withThere is currently no snapshot., can read future data when snapshot 1 exists, and fails when snapshot 1 has expired even if other snapshots remain.Changes
rewriteOtherOptions(). If no time-aligned snapshot exists, look up the earliest currently available snapshot instead of hard-coding snapshot 1.scan.fallback-branch.allow-earliest-snapshot(defaultfalse), applying to both fallback and primary branches in this snapshot-ID alignment path, including numericscan.version.copyWithoutTimeTravel()call is introduced.Compatibility
The default rejection of a nonempty branch with no time match is intentional: previously, whether future data could be read depended on whether snapshot 1 still existed. Enabling the new option explicitly permits reading the earliest available snapshot, including after snapshot 1 has expired. Empty branches are skipped regardless of the option value.
This change is scoped to the existing snapshot-ID branch-alignment path. It does not add timestamp, tag, watermark, or chain-table time-travel support. Ordinary tables still reject explicitly requested missing or expired snapshots; existing tag-backed reads are preserved. No public scan API or split-routing logic is changed.
Tests
Four focused new test methods, with 11 test/parameterized invocations, cover:
Local validation against
a817f4c75a, using Java 8:FallbackReadFileStoreTableTest: 37 passed.ChainTableFileStoreTableTest: 57 passed (existing regression tests).spotless:check,checkstyle:check, andgit diff --checkpassed.No external-engine or production integration tests were run.