manuzhang opened a new issue, #1199: URL: https://github.com/apache/iceberg-cpp/issues/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. Raised in the [review of #1169](https://github.com/apache/iceberg-cpp/pull/1169#discussion_r4746291991). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
