cache: migrate storage layer to B-tree#20507
Conversation
|
Hi @apullo777. Thanks for your PR. I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
/ok-to-test |
|
|
||
| func newStore() *store { | ||
| return &store{kvs: make(map[string]*mvccpb.KeyValue)} | ||
| func newStore(degree int) *store { |
There was a problem hiding this comment.
Do we have enough tests for store to replace implementation now?
There was a problem hiding this comment.
I will write some unit tests for store!
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted filessee 84 files with indirect coverage changes @@ Coverage Diff @@
## main #20507 +/- ##
==========================================
+ Coverage 64.86% 69.14% +4.27%
==========================================
Files 420 420
Lines 34776 34776
==========================================
+ Hits 22559 24045 +1486
+ Misses 10818 9331 -1487
- Partials 1399 1400 +1 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
| name: "apply_with_same_revision_multiple_events", | ||
| initialKVs: []*mvccpb.KeyValue{makeKV("/a", "oldA", 10), makeKV("/b", "oldB", 10)}, | ||
| initialRev: 10, | ||
| eventBatches: [][]*clientv3.Event{ | ||
| {makePutEvent("/a", "newA", 10), makePutEvent("/b", "newB", 10)}, | ||
| }, | ||
| expectedLatestRev: 10, | ||
| expectedSnapshot: []*mvccpb.KeyValue{makeKV("/a", "newA", 10), makeKV("/b", "newB", 10)}, | ||
| }, |
There was a problem hiding this comment.
Note, events with single revision should be applied at once, within single lock, same like etcd. If not, cache will expose partially applied revision which is invalid. So this test case is incorrect, also please make sure we correctly apply revision. We could add validation in storage that prevents same revision being applied twice to prevent this kind of bug.
| clientv3 "go.etcd.io/etcd/client/v3" | ||
| ) | ||
|
|
||
| func TestStoreGet(t *testing.T) { |
There was a problem hiding this comment.
Thanks for extensive tests, however I would recommend to send them in separate PR that we merge first. This way we know that both previous and the current implementation passes them.
| expectedSnapshot: nil, | ||
| }, | ||
| { | ||
| name: "delete_nonexistent", |
There was a problem hiding this comment.
This is sign of potential inconsistency, we should consider rejecting such write and purging cache. This is however something for a followup.
Signed-off-by: Peter Chang <peter.yaochen.chang@gmail.com>
|
@apullo777: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions 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. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: apullo777, serathius The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.
@serathius @MadhavJivrajani