Repository navigation
Validate snapshot sequence numbers on v3 tables - #4125
Open
porkedchop wants to merge 1 commit into
Open
porkedchop wants to merge 1 commit into
porkedchop wants to merge 1 commit into
Conversation
The check that rejects a snapshot whose sequence number is not greater than the table's last sequence number only ran for format version 2. Java applies it to every format version after 1.
This branch has not been deployed
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.
Rationale for this change
The
AddSnapshotUpdatehandler only rejects a snapshot whose sequence number is not newer than the table'slast_sequence_numberwhen the format version is exactly 2, so on v3 tables a snapshot with a stale sequence number is accepted. Java'sTableMetadata.Builder.addSnapshotapplies this check for every format version after 1, so this changes== 2to>= 2.Are these changes tested?
Yes, added
test_add_snapshot_update_fails_with_stale_sequence_number, run against both the v2 and v3 table fixtures. The v3 case fails without the change.Are there any user-facing changes?
Committing a snapshot with a stale sequence number to a v3 table now raises the same
ValueErroras on v2.