rdblue commented on a change in pull request #1110:
URL: https://github.com/apache/iceberg/pull/1110#discussion_r439695559
##########
File path: core/src/main/java/org/apache/iceberg/TableMetadata.java
##########
@@ -253,14 +253,21 @@ public String toString() {
for (HistoryEntry logEntry : snapshotLog) {
if (last != null) {
Preconditions.checkArgument(
- (logEntry.timestampMillis() - last.timestampMillis()) >= 0,
+ (logEntry.timestampMillis() - last.timestampMillis()) >=
-ONE_MINUTE,
"[BUG] Expected sorted snapshot log entries.");
}
last = logEntry;
}
+ if (last != null) {
+ Preconditions.checkArgument(
+ // commits can happen concurrently from different machines.
+ // A tolerance helps us avoid failure for small clock skew
+ lastUpdatedMillis - last.timestampMillis() >= -ONE_MINUTE,
+ "lastUpdatedMillis: %s should not be < than the latest snapshot log
entry timestamp %s",
Review comment:
I try to avoid variable names in log messages. Plain language is easier
for users and tends to be more descriptive. How about "Invalid update timestamp
%s: before last snapshot log entry at %s"?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]