amogh-jahagirdar commented on code in PR #13614:
URL: https://github.com/apache/iceberg/pull/13614#discussion_r2227260971
##########
core/src/main/java/org/apache/iceberg/RemoveSnapshots.java:
##########
@@ -390,4 +386,43 @@ private void cleanExpiredSnapshots() {
cleanupStrategy.cleanFiles(base, current);
}
+
+ private void validateCleanupCanBeIncremental(TableMetadata current) {
Review Comment:
I've amended this so that we distinguish the validation from before
expiration and after expiration a little bit.
Incremental cleanup can only be done
1. No specified snapshots to remove
2. Before expiration there are no _branches_ other than main.
3. After expiration there are no _refs_ other than main
4. When there are no non-main unreferenced snapshots before or after
expiration.
That way so long as any tags on the ancestry of main age out we can
incrementally cleanup, assuming the other conditions of no other non-main
snapshots holds true. The non main snapshots are checked at the very end.
For the check where there are non main snapshots it handles the case where
the current snapshot is null by simply checking if the whole `snapshots` list
is not empty. If it's not empty then this means there are non-main snapshots.
--
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]