forked from vitessio/vitess
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vtctldata.proto
1860 lines (1597 loc) · 53.6 KB
/
vtctldata.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
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
Copyright 2019 The Vitess Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This package contains the data structures for a service allowing
// you to use vtctld as a server for vt commands.
syntax = "proto3";
option go_package = "vitess.io/vitess/go/vt/proto/vtctldata";
package vtctldata;
import "binlogdata.proto";
import "logutil.proto";
import "mysqlctl.proto";
import "query.proto";
import "replicationdata.proto";
import "tabletmanagerdata.proto";
import "topodata.proto";
import "vschema.proto";
import "vtrpc.proto";
import "vttime.proto";
// ExecuteVtctlCommandRequest is the payload for ExecuteVtctlCommand.
// timeouts are in nanoseconds.
message ExecuteVtctlCommandRequest {
repeated string args = 1;
int64 action_timeout = 2;
}
// ExecuteVtctlCommandResponse is streamed back by ExecuteVtctlCommand.
message ExecuteVtctlCommandResponse {
logutil.Event event = 1;
}
// MaterializationIntent describes the reason for creating the Materialize flow
enum MaterializationIntent {
// CUSTOM is the default value
CUSTOM = 0;
// MOVETABLES is when we are creating a MoveTables flow
MOVETABLES = 1;
// CREATELOOKUPINDEX is when we are creating a CreateLookupIndex flow
CREATELOOKUPINDEX = 2;
}
// TableMaterializeSttings contains the settings for one table.
message TableMaterializeSettings {
string target_table = 1;
// source_expression is a select statement.
string source_expression = 2;
// create_ddl contains the DDL to create the target table.
// If empty, the target table must already exist.
// if "copy", the target table DDL is the same as the source table.
string create_ddl = 3;
}
// MaterializeSettings contains the settings for the Materialize command.
message MaterializeSettings {
// workflow is the name of the workflow.
string workflow = 1;
string source_keyspace = 2;
string target_keyspace = 3;
// stop_after_copy specifies if vreplication should be stopped after copying.
bool stop_after_copy = 4;
repeated TableMaterializeSettings table_settings = 5;
// optional parameters.
string cell = 6;
string tablet_types = 7;
// ExternalCluster is the name of the mounted cluster which has the source keyspace/db for this workflow
// it is of the type <cluster_type.cluster_name>
string external_cluster = 8;
// MaterializationIntent is used to identify the reason behind the materialization workflow: eg. MoveTables, CreateLookupVindex
MaterializationIntent materialization_intent = 9;
// SourceTimeZone is the time zone in which datetimes on the source were stored, provided as an option in MoveTable
string source_time_zone = 10;
// TargetTimeZone is not currently specifiable by the user, defaults to UTC for the forward workflows
// and to the SourceTimeZone in reverse workflows
string target_time_zone = 11;
repeated string source_shards = 12;
// OnDdl specifies the action to be taken when a DDL is encountered.
string on_ddl = 13;
// DeferSecondaryKeys specifies if secondary keys should be created in one shot after table copy finishes.
bool defer_secondary_keys = 14;
tabletmanagerdata.TabletSelectionPreference tablet_selection_preference = 15;
bool atomic_copy = 16;
}
/* Data types for VtctldServer */
message Keyspace {
string name = 1;
topodata.Keyspace keyspace = 2;
}
enum QueryOrdering {
NONE = 0;
ASCENDING = 1;
DESCENDING = 2;
}
// SchemaMigration represents a row in the schema_migrations sidecar table.
message SchemaMigration {
string uuid = 1;
string keyspace = 2;
string shard = 3;
string schema = 4;
string table = 5;
string migration_statement = 6;
Strategy strategy = 7;
string options = 8;
vttime.Time added_at = 9;
vttime.Time requested_at = 10;
vttime.Time ready_at = 11;
vttime.Time started_at = 12;
vttime.Time liveness_timestamp = 13;
vttime.Time completed_at = 14;
vttime.Time cleaned_up_at = 15;
Status status = 16;
string log_path = 17;
string artifacts = 18;
uint64 retries = 19;
topodata.TabletAlias tablet = 20;
bool tablet_failure = 21;
float progress = 22;
string migration_context = 23;
string ddl_action = 24;
string message = 25;
int64 eta_seconds = 26;
uint64 rows_copied = 27;
int64 table_rows = 28;
uint32 added_unique_keys = 29;
uint32 removed_unique_keys = 30;
string log_file = 31;
vttime.Duration artifact_retention = 32;
bool postpone_completion = 33;
string removed_unique_key_names = 34;
string dropped_no_default_column_names = 35;
string expanded_column_names = 36;
string revertible_notes = 37;
bool allow_concurrent = 38;
string reverted_uuid = 39;
bool is_view = 40;
bool ready_to_complete = 41;
int64 vitess_liveness_indicator = 42;
float user_throttle_ratio = 43;
string special_plan = 44;
vttime.Time last_throttled_at = 45;
string component_throttled = 46;
vttime.Time cancelled_at = 47;
bool postpone_launch = 48;
string stage = 49; // enum?
uint32 cutover_attempts = 50;
bool is_immediate_operation = 51;
vttime.Time reviewed_at = 52;
vttime.Time ready_to_complete_at = 53;
string removed_foreign_key_names = 54;
enum Strategy {
option allow_alias = true;
// SchemaMigration_VITESS uses vreplication to run the schema migration. It is
// the default strategy for OnlineDDL requests.
//
// SchemaMigration_VITESS was also formerly called "ONLINE".
VITESS = 0;
ONLINE = 0;
GHOST = 1;
PTOSC = 2;
// SchemaMigration_DIRECT runs the migration directly against MySQL (e.g. `ALTER TABLE ...`),
// meaning it is not actually an "online" DDL migration.
DIRECT = 3;
// SchemaMigration_MYSQL is a managed migration (queued and executed by the
// scheduler) but runs through a MySQL `ALTER TABLE`.
MYSQL = 4;
}
enum Status {
UNKNOWN = 0;
REQUESTED = 1;
CANCELLED = 2;
QUEUED = 3;
READY = 4;
RUNNING = 5;
COMPLETE = 6;
FAILED = 7;
}
}
message Shard {
string keyspace = 1;
string name = 2;
topodata.Shard shard = 3;
}
// TODO: comment the hell out of this.
message Workflow {
string name = 1;
ReplicationLocation source = 2;
ReplicationLocation target = 3;
// This represents how long it's been since we processed any event in the
// stream.
int64 max_v_replication_lag = 4;
map<string, ShardStream> shard_streams = 5;
string workflow_type = 6;
string workflow_sub_type = 7;
// This represents the lag across all shards, between the current time and
// the timestamp of the last transaction OR heartbeat timestamp (if there
// have been no writes to replicate from the source).
int64 max_v_replication_transaction_lag = 8;
// This specifies whether to defer the creation of secondary keys.
bool defer_secondary_keys = 9;
message ReplicationLocation {
string keyspace = 1;
repeated string shards = 2;
}
message ShardStream {
repeated Stream streams = 1;
repeated topodata.Shard.TabletControl tablet_controls = 2;
bool is_primary_serving = 3;
}
message Stream {
int64 id = 1;
string shard = 2;
topodata.TabletAlias tablet = 3;
binlogdata.BinlogSource binlog_source = 4;
string position = 5;
string stop_position = 6;
string state = 7;
string db_name = 8;
vttime.Time transaction_timestamp = 9;
vttime.Time time_updated = 10;
string message = 11;
repeated CopyState copy_states = 12;
repeated Log logs = 13;
// LogFetchError is set if we fail to fetch some logs for this stream. We
// will never fail to fetch workflows because we cannot fetch the logs, but
// we will still forward log-fetch errors to the caller, should that be
// relevant to the context in which they are fetching workflows.
//
// Note that this field being set does not necessarily mean that Logs is nil;
// if there are N logs that exist for the stream, and we fail to fetch the
// ith log, we will still return logs in [0, i) + (i, N].
string log_fetch_error = 14;
repeated string tags = 15;
int64 rows_copied = 16;
ThrottlerStatus throttler_status = 17;
message CopyState {
string table = 1;
string last_pk = 2;
}
message Log {
int64 id = 1;
int64 stream_id = 2;
string type = 3;
string state = 4;
vttime.Time created_at = 5;
vttime.Time updated_at = 6;
string message = 7;
int64 count = 8;
}
message ThrottlerStatus {
string component_throttled = 1;
vttime.Time time_throttled = 2;
}
}
}
/* Request/response types for VtctldServer */
message AddCellInfoRequest {
string name = 1;
topodata.CellInfo cell_info = 2;
}
message AddCellInfoResponse {
}
message AddCellsAliasRequest {
string name = 1;
repeated string cells = 2;
}
message AddCellsAliasResponse {
}
message ApplyRoutingRulesRequest {
vschema.RoutingRules routing_rules = 1;
// SkipRebuild, if set, will cause ApplyRoutingRules to skip rebuilding the
// SrvVSchema objects in each cell in RebuildCells.
bool skip_rebuild = 2;
// RebuildCells limits the SrvVSchema rebuild to the specified cells. If not
// provided the SrvVSchema will be rebuilt in every cell in the topology.
//
// Ignored if SkipRebuild is set.
repeated string rebuild_cells = 3;
}
message ApplyRoutingRulesResponse {
}
message ApplyShardRoutingRulesRequest {
vschema.ShardRoutingRules shard_routing_rules = 1;
// SkipRebuild, if set, will cause ApplyShardRoutingRules to skip rebuilding the
// SrvVSchema objects in each cell in RebuildCells.
bool skip_rebuild = 2;
// RebuildCells limits the SrvVSchema rebuild to the specified cells. If not
// provided the SrvVSchema will be rebuilt in every cell in the topology.
//
// Ignored if SkipRebuild is set.
repeated string rebuild_cells = 3;
}
message ApplyShardRoutingRulesResponse {
}
message ApplySchemaRequest {
string keyspace = 1;
reserved 2;
// SQL commands to run.
repeated string sql = 3;
// Online DDL strategy, compatible with @@ddl_strategy session variable (examples: 'gh-ost', 'pt-osc', 'gh-ost --max-load=Threads_running=100'")
string ddl_strategy = 4;
// Optional: explicit UUIDs for migration.
// If given, must match number of DDL changes
repeated string uuid_list = 5;
// For Online DDL, optionally supply a custom unique string used as context for the migration(s) in this command.
// By default a unique context is auto-generated by Vitess
string migration_context = 6;
// WaitReplicasTimeout is the duration of time to wait for replicas to catch
// up in reparenting.
vttime.Duration wait_replicas_timeout = 7;
reserved 8;
// caller_id identifies the caller. This is the effective caller ID,
// set by the application to further identify the caller.
vtrpc.CallerID caller_id = 9;
// BatchSize indicates how many queries to apply together
int64 batch_size = 10;
}
message ApplySchemaResponse {
repeated string uuid_list = 1;
map<string, uint64> rows_affected_by_shard = 2;
}
message ApplyVSchemaRequest {
string keyspace = 1;
bool skip_rebuild = 2;
bool dry_run = 3;
repeated string cells = 4;
vschema.Keyspace v_schema = 5;
string sql = 6;
}
message ApplyVSchemaResponse {
vschema.Keyspace v_schema = 1;
}
message BackupRequest {
topodata.TabletAlias tablet_alias = 1;
// AllowPrimary allows the backup to proceed if TabletAlias is a PRIMARY.
//
// WARNING: If using the builtin backup engine, this will shutdown mysqld on
// the primary for the duration of the backup, and no writes will be possible.
bool allow_primary = 2;
// Concurrency specifies the number of compression/checksum jobs to run
// simultaneously.
uint64 concurrency = 3;
// IncrementalFromPos indicates a position of a previous backup. When this value is non-empty
// then the backup becomes incremental and applies as of given position.
string incremental_from_pos = 4;
// UpgradeSafe indicates if the backup should be taken with innodb_fast_shutdown=0
// so that it's a backup that can be used for an upgrade.
bool upgrade_safe = 5;
}
message BackupResponse {
// TabletAlias is the alias being used for the backup.
topodata.TabletAlias tablet_alias = 1;
string keyspace = 2;
string shard = 3;
logutil.Event event = 4;
}
message BackupShardRequest {
string keyspace = 1;
string shard = 2;
// AllowPrimary allows the backup to occur on a PRIMARY tablet. See
// BackupRequest.AllowPrimary for warnings and caveats.
bool allow_primary = 3;
// Concurrency specifies the number of compression/checksum jobs to run
// simultaneously.
uint64 concurrency = 4;
// UpgradeSafe indicates if the backup should be taken with innodb_fast_shutdown=0
// so that it's a backup that can be used for an upgrade.
bool upgrade_safe = 5;
// IncrementalFromPos indicates a position of a previous backup. When this value is non-empty
// then the backup becomes incremental and applies as of given position.
string incremental_from_pos = 6;
}
message CancelSchemaMigrationRequest {
string keyspace = 1;
string uuid = 2;
}
message CancelSchemaMigrationResponse {
map<string, uint64> rows_affected_by_shard = 1;
}
message ChangeTabletTypeRequest {
topodata.TabletAlias tablet_alias = 1;
topodata.TabletType db_type = 2;
bool dry_run = 3;
}
message ChangeTabletTypeResponse {
topodata.Tablet before_tablet = 1;
topodata.Tablet after_tablet = 2;
bool was_dry_run = 3;
}
message CleanupSchemaMigrationRequest {
string keyspace = 1;
string uuid = 2;
}
message CleanupSchemaMigrationResponse {
map<string, uint64> rows_affected_by_shard = 1;
}
message CompleteSchemaMigrationRequest {
string keyspace = 1;
string uuid = 2;
}
message CompleteSchemaMigrationResponse {
map<string, uint64> rows_affected_by_shard = 1;
}
message CreateKeyspaceRequest {
// Name is the name of the keyspace.
string name = 1;
// Force proceeds with the request even if the keyspace already exists.
bool force = 2;
// AllowEmptyVSchema allows a keyspace to be created with no vschema.
bool allow_empty_v_schema = 3;
// OBSOLETE string sharding_column_name = 4;
reserved 4;
// OBSOLETE topodata.KeyspaceIdType sharding_column_type = 5;
reserved 5;
// ServedFroms specifies a set of db_type:keyspace pairs used to serve
// traffic for the keyspace.
repeated topodata.Keyspace.ServedFrom served_froms = 6;
// Type is the type of the keyspace to create.
topodata.KeyspaceType type = 7;
// BaseKeyspace specifies the base keyspace for SNAPSHOT keyspaces. It is
// required to create a SNAPSHOT keyspace.
string base_keyspace = 8;
// SnapshotTime specifies the snapshot time for this keyspace. It is required
// to create a SNAPSHOT keyspace.
vttime.Time snapshot_time = 9;
// DurabilityPolicy is the durability policy to be
// used for this keyspace.
string durability_policy = 10;
// SidecarDBName is the name of the sidecar database that
// each vttablet in the keyspace will use.
string sidecar_db_name = 11;
}
message CreateKeyspaceResponse {
// Keyspace is the newly-created keyspace.
Keyspace keyspace = 1;
}
message CreateShardRequest {
// Keyspace is the name of the keyspace to create the shard in.
string keyspace = 1;
// ShardName is the name of the shard to create. E.g. "-" or "-80".
string shard_name = 2;
// Force treats an attempt to create a shard that already exists as a
// non-error.
bool force = 3;
// IncludeParent creates the parent keyspace as an empty BASE keyspace, if it
// doesn't already exist.
bool include_parent = 4;
}
message CreateShardResponse {
// Keyspace is the created keyspace. It is set only if IncludeParent was
// specified in the request and the parent keyspace needed to be created.
Keyspace keyspace = 1;
// Shard is the newly-created shard object.
Shard shard = 2;
// ShardAlreadyExists is set if Force was specified in the request and the
// shard already existed.
bool shard_already_exists = 3;
}
message DeleteCellInfoRequest {
string name = 1;
bool force = 2;
}
message DeleteCellInfoResponse {
}
message DeleteCellsAliasRequest {
string name = 1;
}
message DeleteCellsAliasResponse {
}
message DeleteKeyspaceRequest {
// Keyspace is the name of the keyspace to delete.
string keyspace = 1;
// Recursive causes all shards in the keyspace to be recursively deleted
// before deleting the keyspace. It is an error to call DeleteKeyspace on a
// non-empty keyspace without also specifying Recursive.
bool recursive = 2;
// Force allows a keyspace to be deleted even if the keyspace lock cannot be
// obtained. This should only be used to force-clean a keyspace.
bool force = 3;
}
message DeleteKeyspaceResponse {
}
message DeleteShardsRequest {
// Shards is the list of shards to delete. The nested topodatapb.Shard field
// is not required for DeleteShard, but the Keyspace and Shard fields are.
repeated Shard shards = 1;
// Recursive also deletes all tablets belonging to the shard(s). It is an
// error to call DeleteShard on a non-empty shard without also specificying
// Recursive.
bool recursive = 2;
// EvenIfServing allows a shard to be deleted even if it is serving, which is
// normally an error. Use with caution.
bool even_if_serving = 4;
// Force allows a shard to be deleted even if the shard lock cannot be
// obtained. This should only be used to force-clean a shard.
bool force = 5;
}
message DeleteShardsResponse {
}
message DeleteSrvVSchemaRequest {
string cell = 1;
}
message DeleteSrvVSchemaResponse {
}
message DeleteTabletsRequest {
// TabletAliases is the list of tablets to delete.
repeated topodata.TabletAlias tablet_aliases = 1;
// AllowPrimary allows for the primary tablet of a shard to be deleted.
// Use with caution.
bool allow_primary = 2;
}
message DeleteTabletsResponse {
}
message EmergencyReparentShardRequest {
// Keyspace is the name of the keyspace to perform the Emergency Reparent in.
string keyspace = 1;
// Shard is the name of the shard to perform the Emergency Reparent in.
string shard = 2;
// Optional alias of a tablet that should become the new shard primary. If not
// not specified, the vtctld will select the most up-to-date canditate to
// promote.
topodata.TabletAlias new_primary = 3;
// List of replica aliases to ignore during the Emergency Reparent. The vtctld
// will not attempt to stop replication on these tablets, nor attempt to
// demote any that may think they are the shard primary.
repeated topodata.TabletAlias ignore_replicas = 4;
// WaitReplicasTimeout is the duration of time to wait for replicas to catch
// up in reparenting.
vttime.Duration wait_replicas_timeout = 5;
// PreventCrossCellPromotion is used to only promote the new primary from the same cell
// as the failed primary.
bool prevent_cross_cell_promotion = 6;
// WaitForAllTablets makes ERS wait for a response from all the tablets before proceeding.
// Useful when all the tablets are up and reachable.
bool wait_for_all_tablets = 7;
}
message EmergencyReparentShardResponse {
// Keyspace is the name of the keyspace the Emergency Reparent took place in.
string keyspace = 1;
// Shard is the name of the shard the Emergency Reparent took place in.
string shard = 2;
// PromotedPrimary is the alias of the tablet that was promoted to shard
// primary. If NewPrimary was set in the request, then this will be the same
// alias. Otherwise, it will be the alias of the tablet found to be most
// up-to-date.
topodata.TabletAlias promoted_primary = 3;
repeated logutil.Event events = 4;
}
message ExecuteFetchAsAppRequest {
topodata.TabletAlias tablet_alias = 1;
string query = 2;
// MaxRows is an optional parameter to limit the number of rows read into the
// QueryResult. Note that this does not apply a LIMIT to the query, just how
// many rows are read from the MySQL server on the tablet side.
//
// This field is optional. Specifying a non-positive value will use whatever
// default is configured in the VtctldService.
int64 max_rows = 3;
// UsePool causes the query to be run with a pooled connection to the tablet.
bool use_pool = 4;
}
message ExecuteFetchAsAppResponse {
query.QueryResult result = 1;
}
message ExecuteFetchAsDBARequest {
topodata.TabletAlias tablet_alias = 1;
string query = 2;
// MaxRows is an optional parameter to limit the number of rows read into the
// QueryResult. Note that this does not apply a LIMIT to the query, just how
// many rows are read from the MySQL server on the tablet side.
//
// This field is optional. Specifying a non-positive value will use whatever
// default is configured in the VtctldService.
int64 max_rows = 3;
// DisableBinlogs instructs the tablet not to use binary logging when
// executing the query.
bool disable_binlogs = 4;
// ReloadSchema instructs the tablet to reload its schema after executing the
// query.
bool reload_schema = 5;
}
message ExecuteFetchAsDBAResponse {
query.QueryResult result = 1;
}
message ExecuteHookRequest {
topodata.TabletAlias tablet_alias = 1;
tabletmanagerdata.ExecuteHookRequest tablet_hook_request = 2;
}
message ExecuteHookResponse {
tabletmanagerdata.ExecuteHookResponse hook_result = 1;
}
message FindAllShardsInKeyspaceRequest {
string keyspace = 1;
}
message FindAllShardsInKeyspaceResponse {
map<string, Shard> shards = 1;
}
message GetBackupsRequest {
string keyspace = 1;
string shard = 2;
// Limit, if nonzero, will return only the most N recent backups.
uint32 limit = 3;
// Detailed indicates whether to use the backupengine, if supported, to
// populate additional fields, such as Engine and Status, on BackupInfo
// objects in the response. If not set, or if the backupengine does not
// support populating these fields, Engine will always be empty, and Status
// will always be UNKNOWN.
bool detailed = 4;
// DetailedLimit, if nonzero, will only populate additional fields (see Detailed)
// on the N most recent backups. The Limit field still dictates the total
// number of backup info objects returned, so, in reality, min(Limit, DetailedLimit)
// backup infos will have additional fields set, and any remaining backups
// will not.
uint32 detailed_limit = 5;
}
message GetBackupsResponse {
repeated mysqlctl.BackupInfo backups = 1;
}
message GetCellInfoRequest {
string cell = 1;
}
message GetCellInfoResponse {
topodata.CellInfo cell_info = 1;
}
message GetCellInfoNamesRequest {
}
message GetCellInfoNamesResponse {
repeated string names = 1;
}
message GetCellsAliasesRequest {
}
message GetCellsAliasesResponse {
map<string, topodata.CellsAlias> aliases = 1;
}
message GetFullStatusRequest {
topodata.TabletAlias tablet_alias = 1;
}
message GetFullStatusResponse {
replicationdata.FullStatus status = 1;
}
message GetKeyspacesRequest {
}
message GetKeyspacesResponse {
repeated Keyspace keyspaces = 1;
}
message GetKeyspaceRequest {
string keyspace = 1;
}
message GetKeyspaceResponse {
Keyspace keyspace = 1;
}
message GetPermissionsRequest {
topodata.TabletAlias tablet_alias = 1;
}
message GetPermissionsResponse {
tabletmanagerdata.Permissions permissions = 1;
}
message GetRoutingRulesRequest {
}
message GetRoutingRulesResponse {
vschema.RoutingRules routing_rules = 1;
}
message GetSchemaRequest {
topodata.TabletAlias tablet_alias = 1;
// Tables is a list of tables for which we should gather information. Each is
// either an exact match, or a regular expression of the form /regexp/.
repeated string tables = 2;
// ExcludeTables is a list of tables to exclude from the result. Each is
// either an exact match, or a regular expression of the form /regexp/.
repeated string exclude_tables = 3;
// IncludeViews specifies whether to include views in the result.
bool include_views = 4;
// TableNamesOnly specifies whether to limit the results to just table names,
// rather than full schema information for each table.
bool table_names_only = 5;
// TableSizesOnly specifies whether to limit the results to just table sizes,
// rather than full schema information for each table. It is ignored if
// TableNamesOnly is set to true.
bool table_sizes_only = 6;
// TableSchemaOnly specifies whether to limit the results to just table/view
// schema definition (CREATE TABLE/VIEW statements) and skip column/field information
bool table_schema_only = 7;
}
message GetSchemaResponse {
tabletmanagerdata.SchemaDefinition schema = 1;
}
// GetSchemaMigrationsRequest controls the behavior of the GetSchemaMigrations
// rpc.
//
// Keyspace is a required field, while all other fields are optional.
//
// If UUID is set, other optional fields will be ignored, since there will be at
// most one migration with that UUID. Furthermore, if no migration with that
// UUID exists, an empty response, not an error, is returned.
//
// MigrationContext, Status, and Recent are mutually exclusive.
message GetSchemaMigrationsRequest {
string keyspace = 1;
// Uuid, if set, will cause GetSchemaMigrations to return exactly 1 migration,
// namely the one with that UUID. If no migration exists, the response will
// be an empty slice, not an error.
//
// If this field is set, other fields (status filters, limit, skip, order) are
// ignored.
string uuid = 2;
string migration_context = 3;
SchemaMigration.Status status = 4;
// Recent, if set, returns migrations requested between now and the provided
// value.
vttime.Duration recent = 5;
QueryOrdering order = 6;
uint64 limit = 7;
uint64 skip = 8;
}
message GetSchemaMigrationsResponse {
repeated SchemaMigration migrations = 1;
}
message GetShardRequest {
string keyspace = 1;
string shard_name = 2;
}
message GetShardResponse {
Shard shard = 1;
}
message GetShardRoutingRulesRequest {
}
message GetShardRoutingRulesResponse {
vschema.ShardRoutingRules shard_routing_rules = 1;
}
message GetSrvKeyspaceNamesRequest {
repeated string cells = 1;
}
message GetSrvKeyspaceNamesResponse {
// Names is a mapping of cell name to a list of SrvKeyspace names.
map<string, NameList> names = 1;
message NameList {
repeated string names = 1;
}
}
message GetSrvKeyspacesRequest {
string keyspace = 1;
// Cells is a list of cells to lookup a SrvKeyspace for. Leaving this empty is
// equivalent to specifying all cells in the topo.
repeated string cells = 2;
}
message GetSrvKeyspacesResponse {
// SrvKeyspaces is a mapping of cell name to SrvKeyspace.
map<string, topodata.SrvKeyspace> srv_keyspaces = 1;
}
message UpdateThrottlerConfigRequest {
string keyspace = 1;
// Enable instructs to enable the throttler
bool enable = 2;
// Disable instructs to disable the throttler
bool disable = 3;
// Threshold for throttler (with no custom query, ie using default query, only positive values are considered)
double threshold = 4;
// CustomQuery replaces the default replication lag query
string custom_query = 5;
// CustomQuerySet indicates that the value of CustomQuery has changed
bool custom_query_set = 6;
// CheckAsCheckSelf instructs the throttler to respond to /check requests by checking the tablet's own health
bool check_as_check_self = 7;
// CheckAsCheckShard instructs the throttler to respond to /check requests by checking the shard's health (this is the default behavior)
bool check_as_check_shard = 8;
// ThrottledApp indicates a single throttled app rule (ignored if name is empty)
topodata.ThrottledAppRule throttled_app = 9;
}
message UpdateThrottlerConfigResponse {
}
message GetSrvVSchemaRequest {
string cell = 1;
}
message GetSrvVSchemaResponse {
vschema.SrvVSchema srv_v_schema = 1;
}
message GetSrvVSchemasRequest {
repeated string cells = 2;
}
message GetSrvVSchemasResponse {
// SrvVSchemas is a mapping of cell name to SrvVSchema
map<string, vschema.SrvVSchema> srv_v_schemas = 1;
}
message GetTabletRequest {
topodata.TabletAlias tablet_alias = 1;
}
message GetTabletResponse {
topodata.Tablet tablet = 1;
}
message GetTabletsRequest {
// Keyspace is the name of the keyspace to return tablets for. Omit to return
// tablets from all keyspaces.
string keyspace = 1;
// Shard is the name of the shard to return tablets for. This field is ignored
// if Keyspace is not set.
string shard = 2;
// Cells is an optional set of cells to return tablets for.
repeated string cells = 3;
// Strict specifies how the server should treat failures from individual
// cells.
//
// When false (the default), GetTablets will return data from any cells that
// return successfully, but will fail the request if all cells fail. When
// true, any individual cell can fail the full request.
bool strict = 4;
// TabletAliases is an optional list of tablet aliases to fetch Tablet objects
// for. If specified, Keyspace, Shard, and Cells are ignored, and tablets are
// looked up by their respective aliases' Cells directly.
repeated topodata.TabletAlias tablet_aliases = 5;
// tablet_type specifies the type of tablets to return. Omit to return all
// tablet types.
topodata.TabletType tablet_type = 6;
}
message GetTabletsResponse {
repeated topodata.Tablet tablets = 1;
}
message GetTopologyPathRequest {
string path = 1;
}
message GetTopologyPathResponse {
TopologyCell cell = 1;
}
message TopologyCell {
string name = 1;
string path = 2;
// Data is the file contents of the cell located at path.
// It is only populated if the cell is a terminal node.
string data = 3;
repeated string children = 4;
}
message GetVSchemaRequest {
string keyspace = 1;
}
message GetVersionRequest {
topodata.TabletAlias tablet_alias = 1;
}
message GetVersionResponse {
string version = 1;
}
message GetVSchemaResponse {
vschema.Keyspace v_schema = 1;
}
message GetWorkflowsRequest {
string keyspace = 1;
bool active_only = 2;
bool name_only = 3;
// If you only want a specific workflow then set this field.
string workflow = 4;
bool include_logs = 5;
}
message GetWorkflowsResponse {
repeated Workflow workflows = 1;
}
message InitShardPrimaryRequest {
string keyspace = 1;
string shard = 2;
topodata.TabletAlias primary_elect_tablet_alias = 3;
bool force = 4;
vttime.Duration wait_replicas_timeout = 5;
}