Skip to content

Validate snapshot sequence numbers on v3 tables - #4125

Open
porkedchop wants to merge 1 commit into
apache:mainfrom
porkedchop:fix/v3-snapshot-sequence-number-check
Open

porkedchop wants to merge 1 commit into
apache:mainfrom
porkedchop:fix/v3-snapshot-sequence-number-check

Conversation

@porkedchop

Copy link
Copy Markdown

Rationale for this change

The AddSnapshotUpdate handler only rejects a snapshot whose sequence number is not newer than the table's last_sequence_number when the format version is exactly 2, so on v3 tables a snapshot with a stale sequence number is accepted. Java's TableMetadata.Builder.addSnapshot applies this check for every format version after 1, so this changes == 2 to >= 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 ValueError as on v2.

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant