twuebi commented on code in PR #578:
URL: https://github.com/apache/iceberg-go/pull/578#discussion_r2383037681
##########
table/metadata.go:
##########
@@ -1421,6 +1443,38 @@ func (c *commonMetadata) checkRefsExist() error {
return nil
}
+func (c *commonMetadata) validateChronologicalSnapshotLogs() error {
+ for i := 1; i < len(c.SnapshotLog); i++ {
+ prev, cur := c.SnapshotLog[i-1], c.SnapshotLog[i]
+ if (cur.TimestampMs - prev.TimestampMs) < -oneMinuteInMs {
+ return fmt.Errorf("%w: expected sorted snapshot log
entries", ErrInvalidMetadata)
+ }
+ if i == len(c.SnapshotLog)-1 {
+ if c.LastUpdatedMS-cur.TimestampMs < -oneMinuteInMs {
+ return fmt.Errorf("%w: invalid update timestamp
%d: before last snapshot log entry at %d", ErrInvalidMetadata, c.LastUpdatedMS,
cur.TimestampMs)
+ }
+ }
+ }
Review Comment:
need to see if that works with the -1m tolerance
--
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]