Skip to content

Conversation

@lonless9
Copy link
Contributor

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) and update_metadata(Metadata) methods to the Transaction struct.

How was this change tested?

unit tests

@codecov
Copy link

codecov bot commented Nov 22, 2025

Codecov Report

❌ Patch coverage is 83.22981% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.53%. Comparing base (e339ebf) to head (b8fb161).

Files with missing lines Patch % Lines
kernel/src/transaction/mod.rs 81.11% 10 Missing and 17 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nicklan nicklan requested review from OussamaSaoudi, nicklan and zachschuermann and removed request for nicklan November 24, 2025 19:08
Copy link
Collaborator

@zachschuermann zachschuermann left a 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?

@lonless9
Copy link
Contributor Author

lonless9 commented Dec 3, 2025

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide means to create and update Protocol and Metadata actions

2 participants