rdblue commented on code in PR #4578:
URL: https://github.com/apache/iceberg/pull/4578#discussion_r857185952


##########
core/src/main/java/org/apache/iceberg/RemoveSnapshots.java:
##########
@@ -163,21 +180,86 @@ private TableMetadata internalApply() {
     this.base = ops.refresh();
 
     Set<Long> idsToRetain = Sets.newHashSet();
-    List<Long> ancestorIds = SnapshotUtil.ancestorIds(base.currentSnapshot(), 
base::snapshot);
-    if (minNumSnapshots >= ancestorIds.size()) {
+    // Identify refs that should be removed
+    Set<String> refsToRemove = Sets.newHashSet();
+    for (String name : base.refs().keySet()) {
+      SnapshotRef ref = base.ref(name);
+      if (!name.equals(SnapshotRef.MAIN_BRANCH) && ref.maxRefAgeMs() != null) {

Review Comment:
   I don't think this is quite right. The max ref age table setting should be 
applied if the ref itself has no maximum age. Instead, this just skips the ref.



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