qlong commented on code in PR #15389:
URL: https://github.com/apache/iceberg/pull/15389#discussion_r2849825158
##########
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:
Can we add prepareMetadata() method to HiveTableOperations like this? It
does step 1 of your multi-table commit flow, so no need to call
commitTransaction:
```java
public String prepareMetadata(TableMetadata metadata) {
// ... some setup
this.stagedMetadataLocation = writeNewMetadataIfRequired(false,
metadata);
return stagedMetadataLocation;
}
```
change doCommit to skip writeNewMetadataIfRequired if
this.stagedMetadataLocation != null.
With this change:
* there will be no rollbackTransaction after commitTransaction -- correct
transaction semantics is restored
* the state guard can be added back cleanly, which is important as rollback
is now a public api
--
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]