-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
store/tikv: Add raw delete range API #6157
store/tikv: Add raw delete range API #6157
Conversation
…delete-range-interface
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.
You should update vendor and change code logic in separate PRs
store/tikv/rawkv.go
Outdated
func (c *RawKVClient) DeleteRange(startKey []byte, endKey []byte) error { | ||
start := time.Now() | ||
defer func() { | ||
metrics.TiKVRawkvCmdHistogram.WithLabelValues("delete_range").Observe(time.Since(start).Seconds()) |
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.
Add succ or error label?
@@ -14,6 +14,7 @@ | |||
package tikv | |||
|
|||
import ( | |||
"bytes" |
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.
Add a newline after this
store/tikv/rawkv_test.go
Outdated
s.mustPut(c, []byte("k1"), []byte("v1")) | ||
s.mustPut(c, []byte("k3"), []byte("v3")) | ||
|
||
newRegionID, peerID := s.cluster.AllocID(), s.cluster.AllocID() | ||
s.cluster.SplitRaw(loc.Region.id, newRegionID, []byte("k2"), []uint64{peerID}, peerID) | ||
s.split(c, "k", "k2") |
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.
Let split
return error and c.Assert(s.split(c, "k", "k2"), IsNil)
here,
or rename split to mustSplit
I prefer former, because when there are many split()
call and assert failed, we won't lost the error stack.
…delete-range-interface
…delete-range-interface
LGTM @coocood |
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
Add raw delete range API to ticlient.
Please check PR #6156 first.