aokolnychyi commented on code in PR #6335:
URL: https://github.com/apache/iceberg/pull/6335#discussion_r1276752392
##########
core/src/main/java/org/apache/iceberg/FastAppend.java:
##########
@@ -178,8 +178,28 @@ public Object updateEvent() {
@Override
protected void cleanUncommitted(Set<ManifestFile> committed) {
- if (newManifest != null && !committed.contains(newManifest)) {
- deleteFile(newManifest.path());
+ if (newManifests != null) {
+ // Delete newManifests that have not been committed and clear them from
the list.
+ // This is needed for manifests cleanup especially in transaction mode,
for example:
+ // Transaction txn = beginTransaction(...)
+ //
+ // // Operation succeeds and calls cleanUncommitted
+ // txn.newFastAppend().appendFile(...).commit();
+ //
+ // // Some other operations ...
+ //
+ // // Commit fails and needs to clean up newManifests
+ // txn.commitTransaction()
+ List<ManifestFile> cleanedNewManifests = Lists.newArrayList();
Review Comment:
Shouldn't this be called `committedNewManifests`? The name suggests it holds
a set of cleaned up manifests (which I interpret as deleted) while it is the
opposite of that.
--
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]