sqd commented on code in PR #13614:
URL: https://github.com/apache/iceberg/pull/13614#discussion_r2222741581


##########
core/src/main/java/org/apache/iceberg/IncrementalFileCleanup.java:
##########
@@ -50,7 +50,7 @@ class IncrementalFileCleanup extends FileCleanupStrategy {
   @Override
   @SuppressWarnings({"checkstyle:CyclomaticComplexity", "MethodLength"})
   public void cleanFiles(TableMetadata beforeExpiration, TableMetadata 
afterExpiration) {
-    if (afterExpiration.refs().size() > 1) {
+    if (beforeExpiration.refs().size() > 1 || afterExpiration.refs().size() > 
1) {

Review Comment:
   > we could check that all refs are in the main branch's history and allow it
   
   I agree. It's the safest to only allow incremental cleanup when this 
condition is met. This should also makes incremental cleanup safe for a large 
class of history manipulations that's going to get implemented in the future.



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