hectar-glitches opened a new pull request, #1054: URL: https://github.com/apache/iceberg-go/pull/1054
## Summary Add explicit post-update validation to ensure `next-row-id` monotonically increases across snapshots. Previously, `MetadataBuilder.validateAndUpdateRowLineage` only checked that the snapshot's first-row-id wasn't behind the table's cursor, but didn't verify the cursor actually advances after applying AddedRows. This fix rejects buggy producers that set `AddedRows` to 0 or negative values, which would silently leave the cursor unchanged or move it backwards. ## Changes ### Implementation **table/metadata.go**: Added explicit post-update check in `validateAndUpdateRowLineage`: Rejects if `newNextRowID <= previousNextRowID` Error message names both the previous and new values for clarity: Catches both `AddedRows = 0` (stasis) and negative `AddedRows` (backward movement) ### Tests Added three comprehensive tests in **table/metadata_builder_internal_test.go** to check happy cases, rejected added rows if number of rows is 0, and rejecting negative added rows. Fixes #589 -- 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]
