forked from vitessio/vitess
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtabletmanagerdata.proto
413 lines (312 loc) · 7.43 KB
/
tabletmanagerdata.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
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
// This file contains all the types and servers necessary to make
// RPC calls to VtTablet for the management API.
syntax = "proto3";
package tabletmanagerdata;
import "query.proto";
import "topodata.proto";
import "replicationdata.proto";
import "logutil.proto";
//
// Data structures
//
message TableDefinition {
// the table name
string name = 1;
// the SQL to run to create the table
string schema = 2;
// the columns in the order that will be used to dump and load the data
repeated string columns = 3;
// the primary key columns in the primary key order
repeated string primary_key_columns = 4;
// type is either mysqlctl.TableBaseTable or mysqlctl.TableView
string type = 5;
// how much space the data file takes.
uint64 data_length = 6;
// approximate number of rows
uint64 row_count = 7;
}
message SchemaDefinition {
string database_schema = 1;
repeated TableDefinition table_definitions = 2;
string version = 3;
}
message SchemaChangeResult {
// before_schema holds the schema before each change.
SchemaDefinition before_schema = 1;
// after_schema holds the schema after each change.
SchemaDefinition after_schema = 2;
}
// UserPermission describes a single row in the mysql.user table
// Primary key is Host+User
// PasswordChecksum is the crc64 of the password, for security reasons
message UserPermission {
string host = 1;
string user = 2;
uint64 password_checksum = 3;
map<string, string> privileges = 4;
}
// DbPermission describes a single row in the mysql.db table
// Primary key is Host+Db+User
message DbPermission {
string host = 1;
string db = 2;
string user = 3;
map<string, string> privileges = 4;
}
// Permissions have all the rows in mysql.{user,db} tables,
// (all rows are sorted by primary key)
message Permissions {
repeated UserPermission user_permissions = 1;
repeated DbPermission db_permissions = 2;
}
// BlpPosition is a replication position for a given binlog player
message BlpPosition {
uint32 uid = 1;
string position = 2;
}
//
// RPC payloads
//
message PingRequest {
string payload = 1;
}
message PingResponse {
string payload = 1;
}
message SleepRequest {
// duration is in nanoseconds
int64 duration = 1;
}
message SleepResponse {
}
message ExecuteHookRequest {
string name = 1;
repeated string parameters = 2;
map<string, string> extra_env = 3;
}
message ExecuteHookResponse {
int64 exit_status = 1;
string stdout = 2;
string stderr = 3;
}
message GetSchemaRequest {
repeated string tables = 1;
bool include_views = 2;
repeated string exclude_tables = 3;
}
message GetSchemaResponse {
SchemaDefinition schema_definition = 1;
}
message GetPermissionsRequest {
}
message GetPermissionsResponse {
Permissions permissions = 1;
}
message SetReadOnlyRequest {
}
message SetReadOnlyResponse {
}
message SetReadWriteRequest {
}
message SetReadWriteResponse {
}
message ChangeTypeRequest {
topodata.TabletType tablet_type = 1;
}
message ChangeTypeResponse {
}
message RefreshStateRequest {
}
message RefreshStateResponse {
}
message RunHealthCheckRequest {
}
message RunHealthCheckResponse {
}
message IgnoreHealthErrorRequest {
string pattern = 1;
}
message IgnoreHealthErrorResponse {
}
message ReloadSchemaRequest {
// wait_position allows scheduling a schema reload to occur after a
// given DDL has replicated to this slave, by specifying a replication
// position to wait for. Leave empty to trigger the reload immediately.
string wait_position = 1;
}
message ReloadSchemaResponse {
}
message PreflightSchemaRequest {
repeated string changes = 1;
}
message PreflightSchemaResponse {
// change_results has for each change the schema before and after it.
// The number of elements is identical to the length of "changes" in the request.
repeated SchemaChangeResult change_results = 1;
}
message ApplySchemaRequest {
string sql = 1;
bool force = 2;
bool allow_replication = 3;
SchemaDefinition before_schema = 4;
SchemaDefinition after_schema = 5;
}
message ApplySchemaResponse {
SchemaDefinition before_schema = 1;
SchemaDefinition after_schema = 2;
}
message ExecuteFetchAsDbaRequest {
bytes query = 1;
string db_name = 2;
uint64 max_rows = 3;
bool disable_binlogs = 4;
bool reload_schema = 5;
}
message ExecuteFetchAsDbaResponse {
query.QueryResult result = 1;
}
message ExecuteFetchAsAppRequest {
bytes query = 1;
uint64 max_rows = 2;
}
message ExecuteFetchAsAppResponse {
query.QueryResult result = 1;
}
message SlaveStatusRequest {
}
message SlaveStatusResponse {
replicationdata.Status status = 1;
}
message MasterPositionRequest {
}
message MasterPositionResponse {
string position = 1;
}
message StopSlaveRequest {
}
message StopSlaveResponse {
}
message StopSlaveMinimumRequest {
string position = 1;
int64 wait_timeout = 2;
}
message StopSlaveMinimumResponse {
string position = 1;
}
message StartSlaveRequest {
}
message StartSlaveResponse {
}
message TabletExternallyReparentedRequest {
// external_id is an string value that may be provided by an external
// agent for tracking purposes. The tablet will emit this string in
// events triggered by TabletExternallyReparented, such as VitessReparent.
string external_id = 1;
}
message TabletExternallyReparentedResponse {
}
message TabletExternallyElectedRequest {
}
message TabletExternallyElectedResponse {
}
message GetSlavesRequest {
}
message GetSlavesResponse {
repeated string addrs = 1;
}
message WaitBlpPositionRequest {
BlpPosition blp_position = 1;
int64 wait_timeout = 2;
}
message WaitBlpPositionResponse {
}
message StopBlpRequest {
}
message StopBlpResponse {
repeated BlpPosition blp_positions = 1;
}
message StartBlpRequest {
}
message StartBlpResponse {
}
message RunBlpUntilRequest {
repeated BlpPosition blp_positions = 1;
int64 wait_timeout = 2;
}
message RunBlpUntilResponse {
string position = 1;
}
message ResetReplicationRequest {
}
message ResetReplicationResponse {
}
message InitMasterRequest {
}
message InitMasterResponse {
string position = 1;
}
message PopulateReparentJournalRequest {
int64 time_created_ns = 1;
string action_name = 2;
topodata.TabletAlias master_alias = 3;
string replication_position = 4;
}
message PopulateReparentJournalResponse {
}
message InitSlaveRequest {
topodata.TabletAlias parent = 1;
string replication_position = 2;
int64 time_created_ns = 3;
}
message InitSlaveResponse {
}
message DemoteMasterRequest {
}
message DemoteMasterResponse {
string position = 1;
}
message PromoteSlaveWhenCaughtUpRequest {
string position = 1;
}
message PromoteSlaveWhenCaughtUpResponse {
string position = 1;
}
message SlaveWasPromotedRequest {
}
message SlaveWasPromotedResponse {
}
message SetMasterRequest {
topodata.TabletAlias parent = 1;
int64 time_created_ns = 2;
bool force_start_slave = 3;
}
message SetMasterResponse {
}
message SlaveWasRestartedRequest {
// the parent alias the tablet should have
topodata.TabletAlias parent = 1;
}
message SlaveWasRestartedResponse {
}
message StopReplicationAndGetStatusRequest {
}
message StopReplicationAndGetStatusResponse {
replicationdata.Status status = 1;
}
message PromoteSlaveRequest {
}
message PromoteSlaveResponse {
string position = 1;
}
// Backup / Restore related messages
message BackupRequest {
int64 concurrency = 1;
}
message BackupResponse {
logutil.Event event = 1;
}
message RestoreFromBackupRequest {
}
message RestoreFromBackupResponse {
logutil.Event event = 1;
}