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


##########
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 you confirm that the coordinator calls .commit() on each individual 
operation before calling commitTransaction()?
   
   If yes, the prepareMetadata approach should work.
   
   > you need to stage all table PendingUpdates — where would you keep them?
   
   They are already applied. Each individual PendingUpdate.commit() call writes 
manifests to S3 and updates BaseTransaction.current in memory. 
txn.currentMetadata() is the fully computed result — prepareMetadata() just 
serializes it to JSON and writes it to S3, exactly as 
StagingTableOperations.doCommit() does today.
   
   > Adding prepareMetadata() to TableOps doesn't provide any additional value 
and isn't even linked to a Transaction in any way.
   
   prepareMetadata() **is** linked to the transaction through 
txn.currentMetadata().prepareMetadata() receives the final computed data from 
txn,  it does not need access to updates or applyUpdates() at all.



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