-
Notifications
You must be signed in to change notification settings - Fork 593
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
refactor(meta): adapt ValTransaction to metadata model v2 #12918
Conversation
src/meta/src/model_v2/trx.rs
Outdated
/// Trait that wraps a local memory value and applies the change to the local memory value on | ||
/// `commit` or leaves the local memory value untouched on `abort`. | ||
#[async_trait] | ||
pub trait ValTransaction: Sized { |
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.
Seems that the only difference between the current on and the original one is the type of the Transaction
? If so, shall try introducing a associated type Transaction
or a generic parameter in the trait definition so that we may avoid completely duplicating the original code.
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.
Yes the only several difference includes Transaction
and sync/async method.
The duplicated code is because model V1 and model V2 may coexist for some time and there may be more changes. In the end I'll remove this duplicate file, and modify original one directly.
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.
Rest LGTM!
Just had some small change on the original trait. Now original utils can be reused without duplicating the code. |
Codecov Report
@@ Coverage Diff @@
## main #12918 +/- ##
==========================================
+ Coverage 69.18% 69.21% +0.03%
==========================================
Files 1493 1495 +2
Lines 246484 246750 +266
==========================================
+ Hits 170523 170787 +264
- Misses 75961 75963 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 3 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Create a
ValTransaction
trait replica for use by sql meta store model. The replica is the same as the original except:Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.