You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Handle stale sequence numbers when adding parentless snapshots #1199
On V2+ tables, TableMetadataBuilder::AddSnapshot() checks for a stale sequence number only when the incoming snapshot has a parent. A parentless snapshot skips that check, and the builder assigns its sequence number to the table’s last_sequence_number.
For example, start with V2 metadata containing a retained snapshot at sequence 2. Add a different snapshot with no parent and sequence 1. The builder lowers the table counter to 1. With the validation in #1169, Build() then reports kValidationFailed because the retained snapshot is at sequence 2. An incoming snapshot with a parent would have triggered kRetryableValidationFailed before changing the counter. The parentless behavior predates #1169.
Handle stale parentless snapshots before updating the table counter. Add builder tests for a lower sequence number and for equality at a positive sequence number. Cover sequence zero separately to make the intended initialization behavior explicit.
Activity