-
Notifications
You must be signed in to change notification settings - Fork 125
feat: Add APIs for updating Protocol and Metadata in Transaction #1523
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
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1523 +/- ##
==========================================
- Coverage 84.53% 84.53% -0.01%
==========================================
Files 123 123
Lines 33279 33439 +160
Branches 33279 33439 +160
==========================================
+ Hits 28133 28268 +135
- Misses 3763 3771 +8
- Partials 1383 1400 +17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
zachschuermann
left a comment
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.
hi @lonless9 thank you for the contribution! unfortunately there is a bit of nuance to these changes. protocol/metadata updates will require some more 'orchestration' than maybe is first apparent. This is since there is a dependency between data writes and metadata updates. By example: imagine a user starts a transaction, writes a bunch of data by getting the write_context, and then updates the table schema. The new table schema could be totally incompatible with the writes that just occurred - thereby leading to an incorrect write. In the short term, we could enforce all metadata updates occurring prior to handing out any WriteContext but I think @sanujbasu is in the middle of some Transaction API re-works to allow for better enforcement of these invariants more broadly.
I'll maybe let @sanujbasu chime in with the best path forward here given you both have some changes in flight?
|
Thanks for the review! @zachschuermann I previously assumed that in practical usage scenarios, obtaining the write context and determining metadata updates would naturally happen within a consistent context. Now I see your point: because Kernel decouples these steps, it indeed creates a risk where incorrect user code could happen. I agree that enforcing these invariants at the API level is a good short-term approach. Per your suggestion, let's see what @sanujbasu thinks! |
What changes are proposed in this pull request?
closes #1055
This PR extends the Transaction API to support updating the table's Protocol and Metadata.
Added
update_protocol(Protocol)andupdate_metadata(Metadata)methods to the Transaction struct.How was this change tested?
unit tests