stevenzwu commented on code in PR #14504:
URL: https://github.com/apache/iceberg/pull/14504#discussion_r2528388151


##########
core/src/main/java/org/apache/iceberg/TableMetadata.java:
##########
@@ -1313,17 +1312,17 @@ public Builder setRef(String name, SnapshotRef ref) {
       Snapshot snapshot = snapshotsById.get(snapshotId);
       ValidationException.check(
           snapshot != null, "Cannot set %s to unknown snapshot: %s", name, 
snapshotId);
-      if (isAddedSnapshot(snapshotId)) {
-        this.lastUpdatedMillis = snapshot.timestampMillis();
-      }
 
       if (SnapshotRef.MAIN_BRANCH.equals(name)) {
         this.currentSnapshotId = ref.snapshotId();
         if (lastUpdatedMillis == null) {
           this.lastUpdatedMillis = System.currentTimeMillis();
         }
 
-        snapshotLog.add(new SnapshotLogEntry(lastUpdatedMillis, 
ref.snapshotId()));
+        // rollback to an existing snapshot will use current timestamp as the 
time of the change
+        long timeOfChange =
+            isAddedSnapshot(snapshotId) ? snapshot.timestampMillis() : 
System.currentTimeMillis();

Review Comment:
   there is a slight problem here. at line 1319, system clock is also used for 
the table metadata timestamp. maybe the 2nd part in this line should just be 
`lastUpdatedMillis `



-- 
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]

Reply via email to