diff --git a/proto/kvrpcpb.proto b/proto/kvrpcpb.proto index 2072b06d2..ce4626bde 100644 --- a/proto/kvrpcpb.proto +++ b/proto/kvrpcpb.proto @@ -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 { diff --git a/proto/tikvpb.proto b/proto/tikvpb.proto index 36279f846..7aaa1d5c7 100644 --- a/proto/tikvpb.proto +++ b/proto/tikvpb.proto @@ -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);