-
Notifications
You must be signed in to change notification settings - Fork 728
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
storage: expose etcd's transaction as LowLevelTxn interface to kv.Base #9016
base: master
Are you sure you want to change the base?
Conversation
…te the behavior in memkv and leveldb Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Skipping CI for Draft Pull Request. |
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
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.
LGTM. Let's wait for #8919.
/retest |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9016 +/- ##
==========================================
+ Coverage 74.91% 76.25% +1.33%
==========================================
Files 416 469 +53
Lines 42103 71735 +29632
==========================================
+ Hits 31543 54703 +23160
- Misses 7810 13611 +5801
- Partials 2750 3421 +671
Flags with carried forward coverage won't be shown. Click here to find out more. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JmPotato The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
If(conditions ...LowLevelTxnCondition) LowLevelTxn | ||
Then(ops ...LowLevelTxnOp) LowLevelTxn | ||
Else(ops ...LowLevelTxnOp) LowLevelTxn | ||
Commit(ctx context.Context) (LowLevelTxnResult, 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.
Do we need ctx?
@@ -147,3 +155,132 @@ func (txn *levelDBTxn) commit() error { | |||
|
|||
return txn.kv.Write(txn.batch, nil) | |||
} | |||
|
|||
type levelDBLowLevelTxnSimulator struct { |
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.
Why name it *Simulator?
|
||
succeeds := true | ||
for _, condition := range t.condition { | ||
value, err := t.kv.DB.Get([]byte(condition.Key), nil) |
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.
I think kv.DB.Get
is not right.
} | ||
} | ||
|
||
if !condition.CheckOnValue(valueStr, exists) { |
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.
Shall we use Has
?
@MyonKeminta: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
/hold |
What problem does this PR solve?
Issue Number: Ref #8978
Split out from #8989
What is changed and how does it work?
Check List
Tests
Code changes
Side effects
Related changes
Release note