Skip to content

Commit

Permalink
implement tikv/rfcs#108
Browse files Browse the repository at this point in the history
Signed-off-by: you06 <[email protected]>
  • Loading branch information
you06 committed Jun 12, 2023
1 parent e4919c1 commit 8b06726
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
26 changes: 26 additions & 0 deletions proto/kvrpcpb.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1339,14 +1339,40 @@ message ReadState {
uint64 safe_ts = 2;
}

message InactiveLeaderInfo {
uint64 region_id = 1;
uint64 peer_id = 2;
uint64 term = 3;
metapb.RegionEpoch region_epoch = 4;
}

message CheckLeaderRequest {
repeated LeaderInfo regions = 1;
uint64 ts = 2;
uint64 store_id = 3;
repeated uint64 inactive_regions = 4;
}

message CheckLeaderResponse {
repeated uint64 regions = 1;
uint64 ts = 2;
repeated uint64 failed_regions = 3;
}

message CheckedLeader {
uint64 region_id = 1;
ReadState read_state = 3;
}

message ApplySafeTsRequest {
uint64 ts = 1;
uint64 store_id = 2;
repeated uint64 unsafe_regions = 3;
repeated CheckedLeader checked_leaders = 4;
}

message ApplySafeTsResponse {
uint64 ts = 1;
}

message StoreSafeTSRequest {
Expand Down
3 changes: 3 additions & 0 deletions proto/tikvpb.proto
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ service Tikv {
/// other stores for every region, and decides to advance resolved ts from these regions.
rpc CheckLeader(kvrpcpb.CheckLeaderRequest) returns (kvrpcpb.CheckLeaderResponse);

/// For pusing safe_ts safety, we need another phase after CheckLeader.
rpc ApplySafeTs(kvrpcpb.ApplySafeTsRequest) returns (kvrpcpb.ApplySafeTsResponse);

/// Get the minimal `safe_ts` from regions at the store
rpc GetStoreSafeTS(kvrpcpb.StoreSafeTSRequest) returns (kvrpcpb.StoreSafeTSResponse);

Expand Down

0 comments on commit 8b06726

Please sign in to comment.