dramaticlly commented on code in PR #14504:
URL: https://github.com/apache/iceberg/pull/14504#discussion_r2528700220
##########
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:
discussed offline, I think for rollback to a existing snapshot case, set
time of change for snapshot history log to current timestamp just assigned to
metadata last updated time seem to be acceptable, as this is the only user
facing timestamp can be obtained
--
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]