-
Notifications
You must be signed in to change notification settings - Fork 134
/
Copy pathdebugpb.proto
341 lines (272 loc) · 8.16 KB
/
debugpb.proto
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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
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) {}
// Get range properties
rpc GetRangeProperties(GetRangePropertiesRequest) returns (GetRangePropertiesResponse) {}
// Flashback given key range to a specified version.
rpc FlashbackToVersion(FlashbackToVersionRequest) returns (FlashbackToVersionResponse) {}
// GetRegionReadProgress returns the some useful info in RegionReadProgress
rpc GetRegionReadProgress(GetRegionReadProgressRequest) returns (GetRegionReadProgressResponse) {}
}
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 {
}
message GetRangePropertiesRequest {
bytes start_key = 1;
bytes end_key = 2;
}
message GetRangePropertiesResponse {
message RangeProperty {
string key = 1;
string value = 2;
}
repeated RangeProperty properties = 1;
}
message FlashbackToVersionRequest {
kvrpcpb.Context context = 1;
uint64 version = 2;
uint64 region_id = 3;
bytes start_key = 4;
bytes end_key = 5;
uint64 start_ts = 6;
uint64 commit_ts = 7;
}
message FlashbackToVersionResponse {
string error = 1;
}
message GetRegionReadProgressRequest {
uint64 region_id = 1;
bool log_locks = 2; // when set to true, print a log of the locks with min start_ts in the resolver.
uint64 min_start_ts = 3; // only print locks whose start_ts >= min_start_ts. Can be used to find certain transaction.
}
message GetRegionReadProgressResponse {
// below are from region_read_progress module
uint64 safe_ts = 1;
uint64 applied_index = 2;
uint64 pending_front_applied_index = 3;
uint64 pending_front_ts = 4;
uint64 pending_back_applied_index = 5;
uint64 pending_back_ts = 6;
bool region_read_progress_paused = 7;
uint64 duration_to_last_update_safe_ts_ms = 8;
uint64 duration_to_last_consume_leader_ms = 9;
bool region_read_progress_exist = 10;
uint64 read_state_ts = 18;
uint64 read_state_apply_index = 19;
bool discard = 20;
// below are from resolved-ts module
uint64 resolved_ts = 11;
uint64 resolver_tracked_index = 12;
bool resolver_exist = 13;
bool resolver_stopped = 14;
uint64 num_locks = 16;
uint64 num_transactions = 17;
string error = 15;
}