qlong commented on code in PR #15389:
URL: https://github.com/apache/iceberg/pull/15389#discussion_r2853135898


##########
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:
   Understand the code could work mechanically, but the core issue is that 
calling rollbackTransaction() (or cleanAll()) after commitTransaction() is bad 
transaction semantics regardless of how it is accessed (via  public API or 
package-private). My suggestion of prepareMetadata() on HiveTableOperations 
avoids the problem entirely: the coordinator never calls commitTransaction() 
during the prepare phase, so rollbackTransaction() is always called from OPEN 
state, which is correct. The state guard can then be added back cleanly without 
any CommitMode or isStaging workaround.



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