1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
|
syntax = "proto3";
package debugpb;
import "eraftpb.proto";
import "kvrpcpb.proto";
import "raft_serverpb.proto";
import "gogoproto/gogo.proto";
import "rustproto.proto";
option (gogoproto.sizer_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (rustproto.lite_runtime_all) = true;
option java_package = "org.tikv.kvproto";
// Debug service for TiKV.
//
// Errors are defined as follow:
// - OK: Okay, we are good!
// - UNKNOWN: For unknown error.
// - INVALID_ARGUMENT: Something goes wrong within requests.
// - NOT_FOUND: It is key or region not found, it's based on context, detailed
// reason can be found in grpc message.
// Note: It bypasses raft layer.
service Debug {
// Read a value arbitrarily for a key.
// Note: Server uses key directly w/o any encoding.
rpc Get(GetRequest) returns (GetResponse) {}
// Read raft info.
rpc RaftLog(RaftLogRequest) returns (RaftLogResponse) {}
rpc RegionInfo(RegionInfoRequest) returns (RegionInfoResponse) {}
// Calculate size of a region.
// Note: DO NOT CALL IT IN PRODUCTION, it's really expensive.
rpc RegionSize(RegionSizeRequest) returns (RegionSizeResponse) {}
// Scan a specific range.
// Note: DO NOT CALL IT IN PRODUCTION, it's really expensive.
// Server uses keys directly w/o any encoding.
rpc ScanMvcc(ScanMvccRequest) returns (stream ScanMvccResponse) {}
// Compact a column family in a specified range.
// Note: Server uses keys directly w/o any encoding.
rpc Compact(CompactRequest) returns (CompactResponse) {}
// Inject a fail point. Currently, it's only used in tests.
// Note: DO NOT CALL IT IN PRODUCTION.
rpc InjectFailPoint(InjectFailPointRequest) returns (InjectFailPointResponse) {}
// Recover from a fail point.
rpc RecoverFailPoint(RecoverFailPointRequest) returns (RecoverFailPointResponse) {}
// List all fail points.
rpc ListFailPoints(ListFailPointsRequest) returns (ListFailPointsResponse) {}
// Get Metrics
rpc GetMetrics(GetMetricsRequest) returns (GetMetricsResponse){}
// Do a consistent check for a region.
rpc CheckRegionConsistency(RegionConsistencyCheckRequest) returns (RegionConsistencyCheckResponse) {}
// dynamically modify tikv's config
rpc ModifyTikvConfig(ModifyTikvConfigRequest) returns (ModifyTikvConfigResponse) {}
// Get region properties
rpc GetRegionProperties(GetRegionPropertiesRequest) returns (GetRegionPropertiesResponse) {}
// Get store ID
rpc GetStoreInfo(GetStoreInfoRequest) returns (GetStoreInfoResponse) {}
// Get cluster ID
rpc GetClusterInfo(GetClusterInfoRequest) returns (GetClusterInfoResponse) {}
// Get all region IDs in the store
rpc GetAllRegionsInStore(GetAllRegionsInStoreRequest) returns (GetAllRegionsInStoreResponse) {}
// Make this TiKV node return to the status on this node to certain ts.
rpc ResetToVersion(ResetToVersionRequest) returns (ResetToVersionResponse) {}
}
enum DB {
INVALID = 0;
KV = 1;
RAFT = 2;
}
enum MODULE {
UNUSED = 0;
KVDB = 1;
RAFTDB = 2;
READPOOL = 3;
SERVER = 4;
STORAGE = 5;
PD = 6;
METRIC = 7;
COPROCESSOR = 8;
SECURITY = 9;
IMPORT = 10;
}
message GetRequest {
DB db = 1;
string cf = 2;
bytes key = 3;
}
message GetResponse {
bytes value = 1;
}
message RaftLogRequest {
uint64 region_id = 1;
uint64 log_index = 2;
}
message RaftLogResponse {
eraftpb.Entry entry = 1;
}
message RegionInfoRequest {
uint64 region_id = 1;
}
message RegionInfoResponse {
raft_serverpb.RaftLocalState raft_local_state = 1;
raft_serverpb.RaftApplyState raft_apply_state = 2;
raft_serverpb.RegionLocalState region_local_state = 3;
}
message RegionSizeRequest {
uint64 region_id = 1;
repeated string cfs = 2;
}
message RegionSizeResponse {
message Entry {
string cf = 1;
uint64 size = 2;
}
repeated Entry entries = 1;
}
message ScanMvccRequest {
bytes from_key = 1;
bytes to_key = 2;
uint64 limit = 3;
}
message ScanMvccResponse {
bytes key = 1;
kvrpcpb.MvccInfo info = 2;
}
enum BottommostLevelCompaction {
// Skip bottommost level compaction
Skip = 0;
// Force bottommost level compaction
Force = 1;
// Compact bottommost level if there is a compaction filter.
IfHaveCompactionFilter = 2;
}
message CompactRequest {
DB db = 1;
string cf = 2;
bytes from_key = 3;
bytes to_key = 4;
uint32 threads = 5;
BottommostLevelCompaction bottommost_level_compaction = 6;
}
message CompactResponse {
}
message InjectFailPointRequest {
string name = 1;
string actions = 2;
}
message InjectFailPointResponse {
}
message RecoverFailPointRequest {
string name = 1;
}
message RecoverFailPointResponse {
}
message ListFailPointsRequest {
}
message ListFailPointsResponse {
message Entry {
string name = 1;
string actions = 2;
}
repeated Entry entries = 1;
}
message GetMetricsRequest {
bool all = 1;
}
message GetMetricsResponse {
string prometheus = 1;
string rocksdb_kv = 2;
string rocksdb_raft = 3;
string jemalloc = 4;
uint64 store_id = 5;
}
message RegionConsistencyCheckRequest {
uint64 region_id = 1;
}
message RegionConsistencyCheckResponse {
}
message ModifyTikvConfigRequest {
MODULE module = 1;
string config_name = 2;
string config_value = 3;
}
message ModifyTikvConfigResponse {
}
message Property {
string name = 1;
string value = 2;
}
message GetRegionPropertiesRequest {
uint64 region_id = 1;
}
message GetRegionPropertiesResponse {
repeated Property props = 1;
}
message GetStoreInfoRequest {
}
message GetStoreInfoResponse {
uint64 store_id = 1;
kvrpcpb.APIVersion api_version = 2;
}
message GetClusterInfoRequest {
}
message GetClusterInfoResponse {
uint64 cluster_id = 1;
}
message GetAllRegionsInStoreRequest {
}
message GetAllRegionsInStoreResponse {
repeated uint64 regions = 1;
}
message ResetToVersionRequest {
uint64 ts = 1;
}
message ResetToVersionResponse {
}
|