Skip to content

Commit e580ded

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

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

text/0081-truncate.md renamed to text/0081-return-to-version.md

+7-11
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 ReturnToVersionRequest {
27+
uint64 checkpoint_ts = 1;
2928
}
3029
31-
message TruncateResponse {
32-
string error = 1;
30+
message ReturnToVersionResponse {
3331
}
3432
3533
service Tikv {
3634
// …
37-
rpc Truncate(kvrpcpb.TruncateRequest) returns (kvrpcpb.TruncateResponse) {}
35+
rpc ReturnToVersion(ReturnToVersionRequest) returns (ReturnToVersionResponse) {}
36+
rpc ReturnToVersionStatus(ReturnToVersionStatusRequest) returns (ReturnToVersionStatus) {}
3837
}
3938
```
4039

41-
When a TiKV receive `TruncateRequest`, it will create a `TruncateWorker` instance and start the work.
40+
When a TiKV receive `ReturnToVersionRequest`, it will create a `ReturnToVersionWorker` 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,9 @@ 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.
9897

9998
## Drawbacks
10099

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

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

0 commit comments

Comments
 (0)