-
Notifications
You must be signed in to change notification settings - Fork 277
feat(transaction): Add TransactionAction POC #1400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some suggestions.
Co-authored-by: Renjie Liu <[email protected]>
Co-authored-by: Renjie Liu <[email protected]>
Hi @liurenjie1024 @ZENOTME , Thanks for the feedback! I took another look at the transaction code path implementation in Java today and had some additional thoughts.
Mapping to Rust's TransactionAction:
I've updated my code to add |
Hi, @CTTY I think we should seperate our concerns here. Our design could be inspired by java, but it doesn't mean we should blindly copy java's class hierarchy. There are a lot of differences between these two languages. The I don't think it's a good idea to add an |
+1 for we don't need to apply now. In iceberg-java, the apply can be used for code reuse. E.g. SnapshotProducer implements |
…t location. removed updates and reqs from tx. Need to push fast append and sort order to tx.actions.
Discussed with @liurenjie1024 offline, and we are aligned on the general approach demonstrated here to refactor the transaction commit path and enable retry Next, I'll break this PR into smaller ones and incrementally merge the code~ |
.context(tx) | ||
.sleep(tokio::time::sleep) | ||
.when(|e| { | ||
if let Some(err) = e.downcast_ref::<Error>() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to use downcast_ref
because do_commit
returns an anyhow::Error
. If we update the API for do_commit
to return an iceberg::Error
instead, I believe it would make things clearer.
## Which issue does this PR close? This is a part of the effort to refactor transaction commit path and enable retry for write operations. Please find the POC here: #1400 Related Issues: - #1382 [EPIC] - #1386 - #1387 - #1388 - #1389 ## What changes are included in this PR? - Add `TransactionAction`, `ActionCommit`, and `ApplyTransactionAction` - Add `actions` field in `Transaction` ## Are these changes tested? Added unit tests --------- Co-authored-by: Renjie Liu <[email protected]>
## Which issue does this PR close? This is a part of the effort to refactor transaction commit path and enable retry for write operations. Please find the POC here: #1400 Related Issues: - #1382 [EPIC] - #1386 - #1387 - #1388 - #1389 ## What changes are included in this PR? - Make Transaction own base_table instead of a reference, so we can refresh base_table using catalog within the Transaction when retry ## Are these changes tested? Using the existing unit tests --------- Co-authored-by: Renjie Liu <[email protected]>
…1448) ## Which issue does this PR close? Related Issues: - #1382 [EPIC] ## What changes are included in this PR? - Implement `TransactionAction` for `FastAppendAction` - Changed `SnapshotProduceAction` to `SnapshotProducer` - The idea is to make `SnapshotProduceAction` an _stateless_ helper class that helps with fast_append::commit (as discussed [here](#1400 (comment))) ## Are these changes tested? Added unit tests
Which issue does this PR close?
Related Issues:
Transaction::commit
method #1387TableMetadata
to new location. #1388What changes are included in this PR?
Are these changes tested?