qlong commented on code in PR #15389:
URL: https://github.com/apache/iceberg/pull/15389#discussion_r2854235075
##########
core/src/main/java/org/apache/iceberg/BaseTransaction.java:
##########
@@ -78,6 +78,7 @@ enum TransactionType {
private TableMetadata base;
private TableMetadata current;
private boolean hasLastOpCommitted;
+ private boolean isAborted = false;
Review Comment:
My suggestion is to keep transaction semantics correct (eg, no rollback
after commit). The only change needed for this PR is to add state guard in
BaseTransaction, then it should support your multi-table commit.
For the muti table commit, two small changes to HiveTableOperations:
1. Add prepareMetadata() — one new method using the already-protected
writeNewMetadataIfRequired()
2. Check stagedMetadataLocation in HiveTableOperations.doCommit() to skip
the duplicate S3 write — two lines
The coordinator change is also small: call hiveOps.prepareMetadata() before
commitTransaction() instead of using StagingTableOperations for staging. The
coordinator already holds the HiveTableOperations reference.
StagIngTableOpererations is also not needed in this commit flow.
--
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]