Skip to content

Commit a5c7eb9

Browse files
committed
address comments
Signed-off-by: longfangsong <[email protected]>
1 parent 95b955c commit a5c7eb9

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed
Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,21 @@ Though it is impossible to do lossless recovery in this situation, we can recove
2323
Basically, we need a method to return TiKV to a certain version (timestamp), we should add a new RPC to kvproto:
2424

2525
```protobuf
26-
message TruncateRequest {
27-
Context context = 1;
28-
uint64 checkpoint_ts = 2;
26+
message ResetToVersionRequest {
27+
uint64 checkpoint_ts = 1;
2928
}
3029
31-
message TruncateResponse {
32-
string error = 1;
30+
message ResetToVersionResponse {
3331
}
3432
3533
service Tikv {
3634
// …
37-
rpc Truncate(kvrpcpb.TruncateRequest) returns (kvrpcpb.TruncateResponse) {}
35+
rpc ResetToVersion(ResetToVersionRequest) returns (ResetToVersionResponse) {}
36+
rpc ResetToVersionStatus(ResetToVersionStatusRequest) returns (ResetToVersionStatus) {}
3837
}
3938
```
4039

41-
When a TiKV receive `TruncateRequest`, it will create a `TruncateWorker` instance and start the work.
40+
When a TiKV receive `ResetToVersionRequest`, it will create a `ResetToVersionWorker` instance and start the work.
4241

4342
There are several steps to follow when doing truncate, note it is expected that no more write requests will be sent to TiKV during the truncate process:
4443

@@ -94,12 +93,11 @@ After remove all the writes, we can promise we won't give the user ACID inconsis
9493

9594
So we should do resolve locks on all data once.
9695

97-
This lock resolving process is just like the one used by GC, with safepoint ts equals to current ts.
96+
We can do this by simply remove all locks in lockcf.
97+
98+
<!-- todo: add more details about the correctness here -->
9899

99100
## Drawbacks
100101

101102
This is a **very** unsafe operation, we should prevent the user call this on normal cluster.
102103

103-
## Alternatives
104-
105-
- We can also clean the lock cf in step2 instead of do resolve locks.

0 commit comments

Comments
 (0)