diff --git a/go/cmd/vtctldclient/command/mirror_rules.go b/go/cmd/vtctldclient/command/mirror_rules.go new file mode 100644 index 00000000000..50acaf8be75 --- /dev/null +++ b/go/cmd/vtctldclient/command/mirror_rules.go @@ -0,0 +1,157 @@ +/* +Copyright 2024 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. +*/ + +package command + +import ( + "errors" + "fmt" + "os" + "strings" + + "github.com/spf13/cobra" + + "vitess.io/vitess/go/cmd/vtctldclient/cli" + "vitess.io/vitess/go/json2" + + vschemapb "vitess.io/vitess/go/vt/proto/vschema" + vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata" +) + +var ( + // ApplyMirrorRules makes an ApplyMirrorRules gRPC call to a vtctld. + ApplyMirrorRules = &cobra.Command{ + Use: "ApplyMirrorRules {--rules RULES | --rules-file RULES_FILE} [--cells=c1,c2,...] [--skip-rebuild] [--dry-run]", + Short: "Applies the VSchema mirror rules.", + DisableFlagsInUseLine: true, + Args: cobra.NoArgs, + RunE: commandApplyMirrorRules, + } + // GetMirrorRules makes a GetMirrorRules gRPC call to a vtctld. + GetMirrorRules = &cobra.Command{ + Use: "GetMirrorRules", + Short: "Displays the VSchema mirror rules.", + DisableFlagsInUseLine: true, + Args: cobra.NoArgs, + RunE: commandGetMirrorRules, + } +) + +var applyMirrorRulesOptions = struct { + Rules string + RulesFilePath string + Cells []string + SkipRebuild bool + DryRun bool +}{} + +func commandApplyMirrorRules(cmd *cobra.Command, args []string) error { + if applyMirrorRulesOptions.Rules != "" && applyMirrorRulesOptions.RulesFilePath != "" { + return fmt.Errorf("cannot pass both --rules (=%s) and --rules-file (=%s)", applyMirrorRulesOptions.Rules, applyMirrorRulesOptions.RulesFilePath) + } + + if applyMirrorRulesOptions.Rules == "" && applyMirrorRulesOptions.RulesFilePath == "" { + return errors.New("must pass exactly one of --rules or --rules-file") + } + + cli.FinishedParsing(cmd) + + var rulesBytes []byte + if applyMirrorRulesOptions.RulesFilePath != "" { + data, err := os.ReadFile(applyMirrorRulesOptions.RulesFilePath) + if err != nil { + return err + } + + rulesBytes = data + } else { + rulesBytes = []byte(applyMirrorRulesOptions.Rules) + } + + rr := &vschemapb.MirrorRules{} + if err := json2.Unmarshal(rulesBytes, &rr); err != nil { + return err + } + + // Round-trip so when we display the result it's readable. + data, err := cli.MarshalJSON(rr) + if err != nil { + return err + } + + if applyMirrorRulesOptions.DryRun { + fmt.Printf("[DRY RUN] Would have saved new MirrorRules object:\n%s\n", data) + + if applyMirrorRulesOptions.SkipRebuild { + fmt.Println("[DRY RUN] Would not have rebuilt VSchema graph, would have required operator to run RebuildVSchemaGraph for changes to take effect") + } else { + fmt.Print("[DRY RUN] Would have rebuilt the VSchema graph") + if len(applyMirrorRulesOptions.Cells) == 0 { + fmt.Print(" in all cells\n") + } else { + fmt.Printf(" in the following cells: %s.\n", strings.Join(applyMirrorRulesOptions.Cells, ", ")) + } + } + + return nil + } + + _, err = client.ApplyMirrorRules(commandCtx, &vtctldatapb.ApplyMirrorRulesRequest{ + MirrorRules: rr, + SkipRebuild: applyMirrorRulesOptions.SkipRebuild, + RebuildCells: applyMirrorRulesOptions.Cells, + }) + if err != nil { + return err + } + + fmt.Printf("New MirrorRules object:\n%s\nIf this is not what you expected, check the input data (as JSON parsing will skip unexpected fields).\n", data) + + if applyMirrorRulesOptions.SkipRebuild { + fmt.Println("Skipping rebuild of VSchema graph, will need to run RebuildVSchemaGraph for changes to take effect.") + } + + return nil +} + +func commandGetMirrorRules(cmd *cobra.Command, args []string) error { + cli.FinishedParsing(cmd) + + resp, err := client.GetMirrorRules(commandCtx, &vtctldatapb.GetMirrorRulesRequest{}) + if err != nil { + return err + } + + data, err := cli.MarshalJSON(resp.MirrorRules) + if err != nil { + return err + } + + fmt.Printf("%s\n", data) + + return nil +} + +func init() { + ApplyMirrorRules.Flags().StringVarP(&applyMirrorRulesOptions.Rules, "rules", "r", "", "Mirror rules, specified as a string.") + ApplyMirrorRules.Flags().StringVarP(&applyMirrorRulesOptions.RulesFilePath, "rules-file", "f", "", "Path to a file containing mirror rules specified as JSON.") + ApplyMirrorRules.Flags().StringSliceVarP(&applyMirrorRulesOptions.Cells, "cells", "c", nil, "Limit the VSchema graph rebuilding to the specified cells. Ignored if --skip-rebuild is specified.") + ApplyMirrorRules.Flags().BoolVar(&applyMirrorRulesOptions.SkipRebuild, "skip-rebuild", false, "Skip rebuilding the SrvVSchema objects.") + ApplyMirrorRules.Flags().BoolVarP(&applyMirrorRulesOptions.DryRun, "dry-run", "d", false, "Load the specified mirror rules as a validation step, but do not actually apply the rules to the topo.") + Root.AddCommand(ApplyMirrorRules) + + Root.AddCommand(GetMirrorRules) +} diff --git a/go/cmd/vtctldclient/command/vreplication/common/mirrortraffic.go b/go/cmd/vtctldclient/command/vreplication/common/mirrortraffic.go new file mode 100644 index 00000000000..ad7c28a64b6 --- /dev/null +++ b/go/cmd/vtctldclient/command/vreplication/common/mirrortraffic.go @@ -0,0 +1,77 @@ +/* +Copyright 2024 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. +*/ + +package common + +import ( + "bytes" + "fmt" + + "github.com/spf13/cobra" + + "vitess.io/vitess/go/cmd/vtctldclient/cli" + + vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata" +) + +func GetMirrorTrafficCommand(opts *SubCommandsOpts) *cobra.Command { + cmd := &cobra.Command{ + Use: "mirrortraffic", + Short: fmt.Sprintf("Mirror traffic for a %s VReplication workflow.", opts.SubCommand), + Example: fmt.Sprintf(`vtctldclient --server localhost:15999 %s --workflow %s --target-keyspace customer mirrortraffic --percent 50.0`, opts.SubCommand, opts.Workflow), + DisableFlagsInUseLine: true, + Aliases: []string{"MirrorTraffic"}, + Args: cobra.NoArgs, + RunE: commandMirrorTraffic, + } + return cmd +} + +func commandMirrorTraffic(cmd *cobra.Command, args []string) error { + format, err := GetOutputFormat(cmd) + if err != nil { + return err + } + + cli.FinishedParsing(cmd) + + req := &vtctldatapb.WorkflowMirrorTrafficRequest{ + Keyspace: BaseOptions.TargetKeyspace, + Workflow: BaseOptions.Workflow, + Percent: MirrorTrafficOptions.Percent, + } + resp, err := GetClient().WorkflowMirrorTraffic(GetCommandCtx(), req) + if err != nil { + return err + } + + var output []byte + if format == "json" { + output, err = cli.MarshalJSONPretty(resp) + if err != nil { + return err + } + } else { + tout := bytes.Buffer{} + tout.WriteString(resp.Summary + "\n\n") + tout.WriteString(fmt.Sprintf("Start State: %s\n", resp.StartState)) + tout.WriteString(fmt.Sprintf("Current State: %s\n", resp.CurrentState)) + output = tout.Bytes() + } + fmt.Printf("%s\n", output) + + return nil +} diff --git a/go/cmd/vtctldclient/command/vreplication/common/utils.go b/go/cmd/vtctldclient/command/vreplication/common/utils.go index a742f31a9ff..9136156a0b1 100644 --- a/go/cmd/vtctldclient/command/vreplication/common/utils.go +++ b/go/cmd/vtctldclient/command/vreplication/common/utils.go @@ -224,6 +224,10 @@ func AddCommonCreateFlags(cmd *cobra.Command) { cmd.Flags().BoolVar(&CreateOptions.StopAfterCopy, "stop-after-copy", false, "Stop the workflow after it's finished copying the existing rows and before it starts replicating changes.") } +var MirrorTrafficOptions = struct { + Percent float32 +}{} + var SwitchTrafficOptions = struct { Cells []string TabletTypes []topodatapb.TabletType diff --git a/go/cmd/vtctldclient/command/vreplication/movetables/movetables.go b/go/cmd/vtctldclient/command/vreplication/movetables/movetables.go index 0757fc542ac..c79d5db7c6e 100644 --- a/go/cmd/vtctldclient/command/vreplication/movetables/movetables.go +++ b/go/cmd/vtctldclient/command/vreplication/movetables/movetables.go @@ -64,6 +64,10 @@ func registerCommands(root *cobra.Command) { base.AddCommand(common.GetStartCommand(opts)) base.AddCommand(common.GetStopCommand(opts)) + mirrorTrafficCommand := common.GetMirrorTrafficCommand(opts) + mirrorTrafficCommand.Flags().Float32Var(&common.MirrorTrafficOptions.Percent, "percent", 1.0, "Percentage of traffic to mirror.") + base.AddCommand(mirrorTrafficCommand) + switchTrafficCommand := common.GetSwitchTrafficCommand(opts) common.AddCommonSwitchTrafficFlags(switchTrafficCommand, true) common.AddShardSubsetFlag(switchTrafficCommand, &common.SwitchTrafficOptions.Shards) diff --git a/go/test/vschemawrapper/vschema_wrapper.go b/go/test/vschemawrapper/vschema_wrapper.go index 0f8b47a9804..49d9440961b 100644 --- a/go/test/vschemawrapper/vschema_wrapper.go +++ b/go/test/vschemawrapper/vschema_wrapper.go @@ -338,3 +338,11 @@ func (vw *VSchemaWrapper) FindRoutedShard(keyspace, shard string) (string, error func (vw *VSchemaWrapper) IsViewsEnabled() bool { return vw.EnableViews } + +func (vw *VSchemaWrapper) FindMirrorRule(fromKeyspace string) (*vindexes.MirrorRule, error) { + return vw.V.FindMirrorRule(fromKeyspace) +} + +func (vw *VSchemaWrapper) HasMirrorRules() bool { + return vw.V.HasMirrorRules() +} diff --git a/go/vt/proto/vschema/vschema.pb.go b/go/vt/proto/vschema/vschema.pb.go index ec70e8798d4..3bb22fea563 100644 --- a/go/vt/proto/vschema/vschema.pb.go +++ b/go/vt/proto/vschema/vschema.pb.go @@ -717,6 +717,7 @@ type SrvVSchema struct { Keyspaces map[string]*Keyspace `protobuf:"bytes,1,rep,name=keyspaces,proto3" json:"keyspaces,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` RoutingRules *RoutingRules `protobuf:"bytes,2,opt,name=routing_rules,json=routingRules,proto3" json:"routing_rules,omitempty"` // table routing rules ShardRoutingRules *ShardRoutingRules `protobuf:"bytes,3,opt,name=shard_routing_rules,json=shardRoutingRules,proto3" json:"shard_routing_rules,omitempty"` + MirrorRules *MirrorRules `protobuf:"bytes,4,opt,name=mirror_rules,json=mirrorRules,proto3" json:"mirror_rules,omitempty"` // mirror rules } func (x *SrvVSchema) Reset() { @@ -772,6 +773,13 @@ func (x *SrvVSchema) GetShardRoutingRules() *ShardRoutingRules { return nil } +func (x *SrvVSchema) GetMirrorRules() *MirrorRules { + if x != nil { + return x.MirrorRules + } + return nil +} + // ShardRoutingRules specify the shard routing rules for the VSchema. type ShardRoutingRules struct { state protoimpl.MessageState @@ -884,6 +892,121 @@ func (x *ShardRoutingRule) GetShard() string { return "" } +// MirrorRules specify the high level mirror rules for the VSchema. +type MirrorRules struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // rules should ideally be a map. However protos dont't allow + // repeated fields as elements of a map. So, we use a list + // instead. + Rules []*MirrorRule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"` +} + +func (x *MirrorRules) Reset() { + *x = MirrorRules{} + if protoimpl.UnsafeEnabled { + mi := &file_vschema_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MirrorRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MirrorRules) ProtoMessage() {} + +func (x *MirrorRules) ProtoReflect() protoreflect.Message { + mi := &file_vschema_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MirrorRules.ProtoReflect.Descriptor instead. +func (*MirrorRules) Descriptor() ([]byte, []int) { + return file_vschema_proto_rawDescGZIP(), []int{11} +} + +func (x *MirrorRules) GetRules() []*MirrorRule { + if x != nil { + return x.Rules + } + return nil +} + +// MirrorRule specifies a mirror rule. +type MirrorRule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FromKeyspace string `protobuf:"bytes,1,opt,name=from_keyspace,json=fromKeyspace,proto3" json:"from_keyspace,omitempty"` + ToKeyspace string `protobuf:"bytes,2,opt,name=to_keyspace,json=toKeyspace,proto3" json:"to_keyspace,omitempty"` + Percent float32 `protobuf:"fixed32,3,opt,name=percent,proto3" json:"percent,omitempty"` +} + +func (x *MirrorRule) Reset() { + *x = MirrorRule{} + if protoimpl.UnsafeEnabled { + mi := &file_vschema_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MirrorRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MirrorRule) ProtoMessage() {} + +func (x *MirrorRule) ProtoReflect() protoreflect.Message { + mi := &file_vschema_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MirrorRule.ProtoReflect.Descriptor instead. +func (*MirrorRule) Descriptor() ([]byte, []int) { + return file_vschema_proto_rawDescGZIP(), []int{12} +} + +func (x *MirrorRule) GetFromKeyspace() string { + if x != nil { + return x.FromKeyspace + } + return "" +} + +func (x *MirrorRule) GetToKeyspace() string { + if x != nil { + return x.ToKeyspace + } + return "" +} + +func (x *MirrorRule) GetPercent() float32 { + if x != nil { + return x.Percent + } + return 0 +} + var File_vschema_proto protoreflect.FileDescriptor var file_vschema_proto_rawDesc = []byte{ @@ -986,7 +1109,7 @@ var file_vschema_proto_rawDesc = []byte{ 0x28, 0x08, 0x48, 0x00, 0x52, 0x08, 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6e, 0x75, - 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x22, 0xa7, 0x02, 0x0a, 0x0a, 0x53, 0x72, 0x76, 0x56, 0x53, + 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x22, 0xe0, 0x02, 0x0a, 0x0a, 0x53, 0x72, 0x76, 0x56, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x40, 0x0a, 0x09, 0x6b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x76, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x53, 0x72, 0x76, 0x56, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4b, 0x65, @@ -999,27 +1122,41 @@ var file_vschema_proto_rawDesc = []byte{ 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x76, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x11, 0x73, 0x68, - 0x61, 0x72, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x1a, - 0x4f, 0x0a, 0x0e, 0x4b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x76, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4b, 0x65, 0x79, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x22, 0x44, 0x0a, 0x11, 0x53, 0x68, 0x61, 0x72, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, - 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x76, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x53, - 0x68, 0x61, 0x72, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x52, - 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x22, 0x6e, 0x0a, 0x10, 0x53, 0x68, 0x61, 0x72, 0x64, 0x52, - 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x72, - 0x6f, 0x6d, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x66, 0x72, 0x6f, 0x6d, 0x4b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, - 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x42, 0x26, 0x5a, 0x24, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, - 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x74, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x72, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, + 0x37, 0x0a, 0x0c, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x76, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, + 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x0b, 0x6d, 0x69, 0x72, + 0x72, 0x6f, 0x72, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x1a, 0x4f, 0x0a, 0x0e, 0x4b, 0x65, 0x79, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x76, 0x73, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x44, 0x0a, 0x11, 0x53, 0x68, 0x61, + 0x72, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x2f, + 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x76, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x64, 0x52, 0x6f, 0x75, + 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x22, + 0x6e, 0x0a, 0x10, 0x53, 0x68, 0x61, 0x72, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, + 0x75, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x6b, 0x65, 0x79, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x72, 0x6f, 0x6d, + 0x4b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x5f, 0x6b, + 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, + 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x61, + 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x22, + 0x38, 0x0a, 0x0b, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x29, + 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x76, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x75, + 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x22, 0x6c, 0x0a, 0x0a, 0x4d, 0x69, 0x72, + 0x72, 0x6f, 0x72, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x72, 0x6f, 0x6d, 0x5f, + 0x6b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x66, 0x72, 0x6f, 0x6d, 0x4b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, + 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x07, + 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x42, 0x26, 0x5a, 0x24, 0x76, 0x69, 0x74, 0x65, 0x73, + 0x73, 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x76, + 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1035,7 +1172,7 @@ func file_vschema_proto_rawDescGZIP() []byte { } var file_vschema_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_vschema_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_vschema_proto_msgTypes = make([]protoimpl.MessageInfo, 17) var file_vschema_proto_goTypes = []interface{}{ (Keyspace_ForeignKeyMode)(0), // 0: vschema.Keyspace.ForeignKeyMode (*RoutingRules)(nil), // 1: vschema.RoutingRules @@ -1049,34 +1186,38 @@ var file_vschema_proto_goTypes = []interface{}{ (*SrvVSchema)(nil), // 9: vschema.SrvVSchema (*ShardRoutingRules)(nil), // 10: vschema.ShardRoutingRules (*ShardRoutingRule)(nil), // 11: vschema.ShardRoutingRule - nil, // 12: vschema.Keyspace.VindexesEntry - nil, // 13: vschema.Keyspace.TablesEntry - nil, // 14: vschema.Vindex.ParamsEntry - nil, // 15: vschema.SrvVSchema.KeyspacesEntry - (query.Type)(0), // 16: query.Type + (*MirrorRules)(nil), // 12: vschema.MirrorRules + (*MirrorRule)(nil), // 13: vschema.MirrorRule + nil, // 14: vschema.Keyspace.VindexesEntry + nil, // 15: vschema.Keyspace.TablesEntry + nil, // 16: vschema.Vindex.ParamsEntry + nil, // 17: vschema.SrvVSchema.KeyspacesEntry + (query.Type)(0), // 18: query.Type } var file_vschema_proto_depIdxs = []int32{ 2, // 0: vschema.RoutingRules.rules:type_name -> vschema.RoutingRule - 12, // 1: vschema.Keyspace.vindexes:type_name -> vschema.Keyspace.VindexesEntry - 13, // 2: vschema.Keyspace.tables:type_name -> vschema.Keyspace.TablesEntry + 14, // 1: vschema.Keyspace.vindexes:type_name -> vschema.Keyspace.VindexesEntry + 15, // 2: vschema.Keyspace.tables:type_name -> vschema.Keyspace.TablesEntry 0, // 3: vschema.Keyspace.foreign_key_mode:type_name -> vschema.Keyspace.ForeignKeyMode - 14, // 4: vschema.Vindex.params:type_name -> vschema.Vindex.ParamsEntry + 16, // 4: vschema.Vindex.params:type_name -> vschema.Vindex.ParamsEntry 6, // 5: vschema.Table.column_vindexes:type_name -> vschema.ColumnVindex 7, // 6: vschema.Table.auto_increment:type_name -> vschema.AutoIncrement 8, // 7: vschema.Table.columns:type_name -> vschema.Column - 16, // 8: vschema.Column.type:type_name -> query.Type - 15, // 9: vschema.SrvVSchema.keyspaces:type_name -> vschema.SrvVSchema.KeyspacesEntry + 18, // 8: vschema.Column.type:type_name -> query.Type + 17, // 9: vschema.SrvVSchema.keyspaces:type_name -> vschema.SrvVSchema.KeyspacesEntry 1, // 10: vschema.SrvVSchema.routing_rules:type_name -> vschema.RoutingRules 10, // 11: vschema.SrvVSchema.shard_routing_rules:type_name -> vschema.ShardRoutingRules - 11, // 12: vschema.ShardRoutingRules.rules:type_name -> vschema.ShardRoutingRule - 4, // 13: vschema.Keyspace.VindexesEntry.value:type_name -> vschema.Vindex - 5, // 14: vschema.Keyspace.TablesEntry.value:type_name -> vschema.Table - 3, // 15: vschema.SrvVSchema.KeyspacesEntry.value:type_name -> vschema.Keyspace - 16, // [16:16] is the sub-list for method output_type - 16, // [16:16] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name + 12, // 12: vschema.SrvVSchema.mirror_rules:type_name -> vschema.MirrorRules + 11, // 13: vschema.ShardRoutingRules.rules:type_name -> vschema.ShardRoutingRule + 13, // 14: vschema.MirrorRules.rules:type_name -> vschema.MirrorRule + 4, // 15: vschema.Keyspace.VindexesEntry.value:type_name -> vschema.Vindex + 5, // 16: vschema.Keyspace.TablesEntry.value:type_name -> vschema.Table + 3, // 17: vschema.SrvVSchema.KeyspacesEntry.value:type_name -> vschema.Keyspace + 18, // [18:18] is the sub-list for method output_type + 18, // [18:18] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name } func init() { file_vschema_proto_init() } @@ -1217,6 +1358,30 @@ func file_vschema_proto_init() { return nil } } + file_vschema_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MirrorRules); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_vschema_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MirrorRule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_vschema_proto_msgTypes[7].OneofWrappers = []interface{}{} type x struct{} @@ -1225,7 +1390,7 @@ func file_vschema_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_vschema_proto_rawDesc, NumEnums: 1, - NumMessages: 15, + NumMessages: 17, NumExtensions: 0, NumServices: 0, }, diff --git a/go/vt/proto/vschema/vschema_vtproto.pb.go b/go/vt/proto/vschema/vschema_vtproto.pb.go index ba55bcfa97c..7302f5ac2cf 100644 --- a/go/vt/proto/vschema/vschema_vtproto.pb.go +++ b/go/vt/proto/vschema/vschema_vtproto.pb.go @@ -5,10 +5,12 @@ package vschema import ( + binary "encoding/binary" fmt "fmt" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" + math "math" bits "math/bits" query "vitess.io/vitess/go/vt/proto/query" ) @@ -245,6 +247,7 @@ func (m *SrvVSchema) CloneVT() *SrvVSchema { r := &SrvVSchema{ RoutingRules: m.RoutingRules.CloneVT(), ShardRoutingRules: m.ShardRoutingRules.CloneVT(), + MirrorRules: m.MirrorRules.CloneVT(), } if rhs := m.Keyspaces; rhs != nil { tmpContainer := make(map[string]*Keyspace, len(rhs)) @@ -307,6 +310,49 @@ func (m *ShardRoutingRule) CloneMessageVT() proto.Message { return m.CloneVT() } +func (m *MirrorRules) CloneVT() *MirrorRules { + if m == nil { + return (*MirrorRules)(nil) + } + r := &MirrorRules{} + if rhs := m.Rules; rhs != nil { + tmpContainer := make([]*MirrorRule, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Rules = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *MirrorRules) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *MirrorRule) CloneVT() *MirrorRule { + if m == nil { + return (*MirrorRule)(nil) + } + r := &MirrorRule{ + FromKeyspace: m.FromKeyspace, + ToKeyspace: m.ToKeyspace, + Percent: m.Percent, + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *MirrorRule) CloneMessageVT() proto.Message { + return m.CloneVT() +} + func (m *RoutingRules) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -898,6 +944,16 @@ func (m *SrvVSchema) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.MirrorRules != nil { + size, err := m.MirrorRules.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } if m.ShardRoutingRules != nil { size, err := m.ShardRoutingRules.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { @@ -1042,6 +1098,104 @@ func (m *ShardRoutingRule) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MirrorRules) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MirrorRules) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *MirrorRules) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Rules) > 0 { + for iNdEx := len(m.Rules) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Rules[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MirrorRule) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MirrorRule) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *MirrorRule) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Percent != 0 { + i -= 4 + binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Percent)))) + i-- + dAtA[i] = 0x1d + } + if len(m.ToKeyspace) > 0 { + i -= len(m.ToKeyspace) + copy(dAtA[i:], m.ToKeyspace) + i = encodeVarint(dAtA, i, uint64(len(m.ToKeyspace))) + i-- + dAtA[i] = 0x12 + } + if len(m.FromKeyspace) > 0 { + i -= len(m.FromKeyspace) + copy(dAtA[i:], m.FromKeyspace) + i = encodeVarint(dAtA, i, uint64(len(m.FromKeyspace))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarint(dAtA []byte, offset int, v uint64) int { offset -= sov(v) base := offset @@ -1313,6 +1467,10 @@ func (m *SrvVSchema) SizeVT() (n int) { l = m.ShardRoutingRules.SizeVT() n += 1 + l + sov(uint64(l)) } + if m.MirrorRules != nil { + l = m.MirrorRules.SizeVT() + n += 1 + l + sov(uint64(l)) + } n += len(m.unknownFields) return n } @@ -1355,6 +1513,43 @@ func (m *ShardRoutingRule) SizeVT() (n int) { return n } +func (m *MirrorRules) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Rules) > 0 { + for _, e := range m.Rules { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *MirrorRule) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FromKeyspace) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.ToKeyspace) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.Percent != 0 { + n += 5 + } + n += len(m.unknownFields) + return n +} + func sov(x uint64) (n int) { return (bits.Len64(x|1) + 6) / 7 } @@ -3211,6 +3406,42 @@ func (m *SrvVSchema) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MirrorRules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MirrorRules == nil { + m.MirrorRules = &MirrorRules{} + } + if err := m.MirrorRules.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) @@ -3465,6 +3696,217 @@ func (m *ShardRoutingRule) UnmarshalVT(dAtA []byte) error { } return nil } +func (m *MirrorRules) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MirrorRules: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MirrorRules: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rules = append(m.Rules, &MirrorRule{}) + if err := m.Rules[len(m.Rules)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MirrorRule) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MirrorRule: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MirrorRule: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FromKeyspace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FromKeyspace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ToKeyspace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ToKeyspace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field Percent", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.Percent = float32(math.Float32frombits(v)) + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skip(dAtA []byte) (n int, err error) { l := len(dAtA) diff --git a/go/vt/proto/vtctldata/vtctldata.pb.go b/go/vt/proto/vtctldata/vtctldata.pb.go index bec6a89d360..cb28a6f8f0b 100644 --- a/go/vt/proto/vtctldata/vtctldata.pb.go +++ b/go/vt/proto/vtctldata/vtctldata.pb.go @@ -14538,6 +14538,324 @@ func (x *WorkflowUpdateResponse) GetDetails() []*WorkflowUpdateResponse_TabletIn return nil } +type ApplyMirrorRulesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MirrorRules *vschema.MirrorRules `protobuf:"bytes,1,opt,name=mirror_rules,json=mirrorRules,proto3" json:"mirror_rules,omitempty"` + // SkipRebuild, if set, will cause ApplyRoutingRules to skip rebuilding the + // SrvVSchema objects in each cell in RebuildCells. + SkipRebuild bool `protobuf:"varint,2,opt,name=skip_rebuild,json=skipRebuild,proto3" json:"skip_rebuild,omitempty"` + // 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. + RebuildCells []string `protobuf:"bytes,3,rep,name=rebuild_cells,json=rebuildCells,proto3" json:"rebuild_cells,omitempty"` +} + +func (x *ApplyMirrorRulesRequest) Reset() { + *x = ApplyMirrorRulesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_vtctldata_proto_msgTypes[232] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApplyMirrorRulesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplyMirrorRulesRequest) ProtoMessage() {} + +func (x *ApplyMirrorRulesRequest) ProtoReflect() protoreflect.Message { + mi := &file_vtctldata_proto_msgTypes[232] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApplyMirrorRulesRequest.ProtoReflect.Descriptor instead. +func (*ApplyMirrorRulesRequest) Descriptor() ([]byte, []int) { + return file_vtctldata_proto_rawDescGZIP(), []int{232} +} + +func (x *ApplyMirrorRulesRequest) GetMirrorRules() *vschema.MirrorRules { + if x != nil { + return x.MirrorRules + } + return nil +} + +func (x *ApplyMirrorRulesRequest) GetSkipRebuild() bool { + if x != nil { + return x.SkipRebuild + } + return false +} + +func (x *ApplyMirrorRulesRequest) GetRebuildCells() []string { + if x != nil { + return x.RebuildCells + } + return nil +} + +type ApplyMirrorRulesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ApplyMirrorRulesResponse) Reset() { + *x = ApplyMirrorRulesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_vtctldata_proto_msgTypes[233] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApplyMirrorRulesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplyMirrorRulesResponse) ProtoMessage() {} + +func (x *ApplyMirrorRulesResponse) ProtoReflect() protoreflect.Message { + mi := &file_vtctldata_proto_msgTypes[233] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApplyMirrorRulesResponse.ProtoReflect.Descriptor instead. +func (*ApplyMirrorRulesResponse) Descriptor() ([]byte, []int) { + return file_vtctldata_proto_rawDescGZIP(), []int{233} +} + +type GetMirrorRulesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetMirrorRulesRequest) Reset() { + *x = GetMirrorRulesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_vtctldata_proto_msgTypes[234] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetMirrorRulesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMirrorRulesRequest) ProtoMessage() {} + +func (x *GetMirrorRulesRequest) ProtoReflect() protoreflect.Message { + mi := &file_vtctldata_proto_msgTypes[234] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetMirrorRulesRequest.ProtoReflect.Descriptor instead. +func (*GetMirrorRulesRequest) Descriptor() ([]byte, []int) { + return file_vtctldata_proto_rawDescGZIP(), []int{234} +} + +type GetMirrorRulesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MirrorRules *vschema.MirrorRules `protobuf:"bytes,1,opt,name=mirror_rules,json=mirrorRules,proto3" json:"mirror_rules,omitempty"` +} + +func (x *GetMirrorRulesResponse) Reset() { + *x = GetMirrorRulesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_vtctldata_proto_msgTypes[235] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetMirrorRulesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMirrorRulesResponse) ProtoMessage() {} + +func (x *GetMirrorRulesResponse) ProtoReflect() protoreflect.Message { + mi := &file_vtctldata_proto_msgTypes[235] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetMirrorRulesResponse.ProtoReflect.Descriptor instead. +func (*GetMirrorRulesResponse) Descriptor() ([]byte, []int) { + return file_vtctldata_proto_rawDescGZIP(), []int{235} +} + +func (x *GetMirrorRulesResponse) GetMirrorRules() *vschema.MirrorRules { + if x != nil { + return x.MirrorRules + } + return nil +} + +type WorkflowMirrorTrafficRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Keyspace string `protobuf:"bytes,1,opt,name=keyspace,proto3" json:"keyspace,omitempty"` + Workflow string `protobuf:"bytes,2,opt,name=workflow,proto3" json:"workflow,omitempty"` + Percent float32 `protobuf:"fixed32,3,opt,name=percent,proto3" json:"percent,omitempty"` +} + +func (x *WorkflowMirrorTrafficRequest) Reset() { + *x = WorkflowMirrorTrafficRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_vtctldata_proto_msgTypes[236] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WorkflowMirrorTrafficRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WorkflowMirrorTrafficRequest) ProtoMessage() {} + +func (x *WorkflowMirrorTrafficRequest) ProtoReflect() protoreflect.Message { + mi := &file_vtctldata_proto_msgTypes[236] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WorkflowMirrorTrafficRequest.ProtoReflect.Descriptor instead. +func (*WorkflowMirrorTrafficRequest) Descriptor() ([]byte, []int) { + return file_vtctldata_proto_rawDescGZIP(), []int{236} +} + +func (x *WorkflowMirrorTrafficRequest) GetKeyspace() string { + if x != nil { + return x.Keyspace + } + return "" +} + +func (x *WorkflowMirrorTrafficRequest) GetWorkflow() string { + if x != nil { + return x.Workflow + } + return "" +} + +func (x *WorkflowMirrorTrafficRequest) GetPercent() float32 { + if x != nil { + return x.Percent + } + return 0 +} + +type WorkflowMirrorTrafficResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Summary string `protobuf:"bytes,1,opt,name=summary,proto3" json:"summary,omitempty"` + StartState string `protobuf:"bytes,2,opt,name=start_state,json=startState,proto3" json:"start_state,omitempty"` + CurrentState string `protobuf:"bytes,3,opt,name=current_state,json=currentState,proto3" json:"current_state,omitempty"` +} + +func (x *WorkflowMirrorTrafficResponse) Reset() { + *x = WorkflowMirrorTrafficResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_vtctldata_proto_msgTypes[237] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WorkflowMirrorTrafficResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WorkflowMirrorTrafficResponse) ProtoMessage() {} + +func (x *WorkflowMirrorTrafficResponse) ProtoReflect() protoreflect.Message { + mi := &file_vtctldata_proto_msgTypes[237] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WorkflowMirrorTrafficResponse.ProtoReflect.Descriptor instead. +func (*WorkflowMirrorTrafficResponse) Descriptor() ([]byte, []int) { + return file_vtctldata_proto_rawDescGZIP(), []int{237} +} + +func (x *WorkflowMirrorTrafficResponse) GetSummary() string { + if x != nil { + return x.Summary + } + return "" +} + +func (x *WorkflowMirrorTrafficResponse) GetStartState() string { + if x != nil { + return x.StartState + } + return "" +} + +func (x *WorkflowMirrorTrafficResponse) GetCurrentState() string { + if x != nil { + return x.CurrentState + } + return "" +} + type Workflow_ReplicationLocation struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -14550,7 +14868,7 @@ type Workflow_ReplicationLocation struct { func (x *Workflow_ReplicationLocation) Reset() { *x = Workflow_ReplicationLocation{} if protoimpl.UnsafeEnabled { - mi := &file_vtctldata_proto_msgTypes[233] + mi := &file_vtctldata_proto_msgTypes[239] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14563,7 +14881,7 @@ func (x *Workflow_ReplicationLocation) String() string { func (*Workflow_ReplicationLocation) ProtoMessage() {} func (x *Workflow_ReplicationLocation) ProtoReflect() protoreflect.Message { - mi := &file_vtctldata_proto_msgTypes[233] + mi := &file_vtctldata_proto_msgTypes[239] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14606,7 +14924,7 @@ type Workflow_ShardStream struct { func (x *Workflow_ShardStream) Reset() { *x = Workflow_ShardStream{} if protoimpl.UnsafeEnabled { - mi := &file_vtctldata_proto_msgTypes[234] + mi := &file_vtctldata_proto_msgTypes[240] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14619,7 +14937,7 @@ func (x *Workflow_ShardStream) String() string { func (*Workflow_ShardStream) ProtoMessage() {} func (x *Workflow_ShardStream) ProtoReflect() protoreflect.Message { - mi := &file_vtctldata_proto_msgTypes[234] + mi := &file_vtctldata_proto_msgTypes[240] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14694,7 +15012,7 @@ type Workflow_Stream struct { func (x *Workflow_Stream) Reset() { *x = Workflow_Stream{} if protoimpl.UnsafeEnabled { - mi := &file_vtctldata_proto_msgTypes[235] + mi := &file_vtctldata_proto_msgTypes[241] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14707,7 +15025,7 @@ func (x *Workflow_Stream) String() string { func (*Workflow_Stream) ProtoMessage() {} func (x *Workflow_Stream) ProtoReflect() protoreflect.Message { - mi := &file_vtctldata_proto_msgTypes[235] + mi := &file_vtctldata_proto_msgTypes[241] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14876,7 +15194,7 @@ type Workflow_Stream_CopyState struct { func (x *Workflow_Stream_CopyState) Reset() { *x = Workflow_Stream_CopyState{} if protoimpl.UnsafeEnabled { - mi := &file_vtctldata_proto_msgTypes[236] + mi := &file_vtctldata_proto_msgTypes[242] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14889,7 +15207,7 @@ func (x *Workflow_Stream_CopyState) String() string { func (*Workflow_Stream_CopyState) ProtoMessage() {} func (x *Workflow_Stream_CopyState) ProtoReflect() protoreflect.Message { - mi := &file_vtctldata_proto_msgTypes[236] + mi := &file_vtctldata_proto_msgTypes[242] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14944,7 +15262,7 @@ type Workflow_Stream_Log struct { func (x *Workflow_Stream_Log) Reset() { *x = Workflow_Stream_Log{} if protoimpl.UnsafeEnabled { - mi := &file_vtctldata_proto_msgTypes[237] + mi := &file_vtctldata_proto_msgTypes[243] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14957,7 +15275,7 @@ func (x *Workflow_Stream_Log) String() string { func (*Workflow_Stream_Log) ProtoMessage() {} func (x *Workflow_Stream_Log) ProtoReflect() protoreflect.Message { - mi := &file_vtctldata_proto_msgTypes[237] + mi := &file_vtctldata_proto_msgTypes[243] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15041,7 +15359,7 @@ type Workflow_Stream_ThrottlerStatus struct { func (x *Workflow_Stream_ThrottlerStatus) Reset() { *x = Workflow_Stream_ThrottlerStatus{} if protoimpl.UnsafeEnabled { - mi := &file_vtctldata_proto_msgTypes[238] + mi := &file_vtctldata_proto_msgTypes[244] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15054,7 +15372,7 @@ func (x *Workflow_Stream_ThrottlerStatus) String() string { func (*Workflow_Stream_ThrottlerStatus) ProtoMessage() {} func (x *Workflow_Stream_ThrottlerStatus) ProtoReflect() protoreflect.Message { - mi := &file_vtctldata_proto_msgTypes[238] + mi := &file_vtctldata_proto_msgTypes[244] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15095,7 +15413,7 @@ type ApplyVSchemaResponse_ParamList struct { func (x *ApplyVSchemaResponse_ParamList) Reset() { *x = ApplyVSchemaResponse_ParamList{} if protoimpl.UnsafeEnabled { - mi := &file_vtctldata_proto_msgTypes[241] + mi := &file_vtctldata_proto_msgTypes[247] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15108,7 +15426,7 @@ func (x *ApplyVSchemaResponse_ParamList) String() string { func (*ApplyVSchemaResponse_ParamList) ProtoMessage() {} func (x *ApplyVSchemaResponse_ParamList) ProtoReflect() protoreflect.Message { - mi := &file_vtctldata_proto_msgTypes[241] + mi := &file_vtctldata_proto_msgTypes[247] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15142,7 +15460,7 @@ type GetSrvKeyspaceNamesResponse_NameList struct { func (x *GetSrvKeyspaceNamesResponse_NameList) Reset() { *x = GetSrvKeyspaceNamesResponse_NameList{} if protoimpl.UnsafeEnabled { - mi := &file_vtctldata_proto_msgTypes[249] + mi := &file_vtctldata_proto_msgTypes[255] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15155,7 +15473,7 @@ func (x *GetSrvKeyspaceNamesResponse_NameList) String() string { func (*GetSrvKeyspaceNamesResponse_NameList) ProtoMessage() {} func (x *GetSrvKeyspaceNamesResponse_NameList) ProtoReflect() protoreflect.Message { - mi := &file_vtctldata_proto_msgTypes[249] + mi := &file_vtctldata_proto_msgTypes[255] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15191,7 +15509,7 @@ type MoveTablesCreateResponse_TabletInfo struct { func (x *MoveTablesCreateResponse_TabletInfo) Reset() { *x = MoveTablesCreateResponse_TabletInfo{} if protoimpl.UnsafeEnabled { - mi := &file_vtctldata_proto_msgTypes[253] + mi := &file_vtctldata_proto_msgTypes[259] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15204,7 +15522,7 @@ func (x *MoveTablesCreateResponse_TabletInfo) String() string { func (*MoveTablesCreateResponse_TabletInfo) ProtoMessage() {} func (x *MoveTablesCreateResponse_TabletInfo) ProtoReflect() protoreflect.Message { - mi := &file_vtctldata_proto_msgTypes[253] + mi := &file_vtctldata_proto_msgTypes[259] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15247,7 +15565,7 @@ type WorkflowDeleteResponse_TabletInfo struct { func (x *WorkflowDeleteResponse_TabletInfo) Reset() { *x = WorkflowDeleteResponse_TabletInfo{} if protoimpl.UnsafeEnabled { - mi := &file_vtctldata_proto_msgTypes[263] + mi := &file_vtctldata_proto_msgTypes[269] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15260,7 +15578,7 @@ func (x *WorkflowDeleteResponse_TabletInfo) String() string { func (*WorkflowDeleteResponse_TabletInfo) ProtoMessage() {} func (x *WorkflowDeleteResponse_TabletInfo) ProtoReflect() protoreflect.Message { - mi := &file_vtctldata_proto_msgTypes[263] + mi := &file_vtctldata_proto_msgTypes[269] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15306,7 +15624,7 @@ type WorkflowStatusResponse_TableCopyState struct { func (x *WorkflowStatusResponse_TableCopyState) Reset() { *x = WorkflowStatusResponse_TableCopyState{} if protoimpl.UnsafeEnabled { - mi := &file_vtctldata_proto_msgTypes[264] + mi := &file_vtctldata_proto_msgTypes[270] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15319,7 +15637,7 @@ func (x *WorkflowStatusResponse_TableCopyState) String() string { func (*WorkflowStatusResponse_TableCopyState) ProtoMessage() {} func (x *WorkflowStatusResponse_TableCopyState) ProtoReflect() protoreflect.Message { - mi := &file_vtctldata_proto_msgTypes[264] + mi := &file_vtctldata_proto_msgTypes[270] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15393,7 +15711,7 @@ type WorkflowStatusResponse_ShardStreamState struct { func (x *WorkflowStatusResponse_ShardStreamState) Reset() { *x = WorkflowStatusResponse_ShardStreamState{} if protoimpl.UnsafeEnabled { - mi := &file_vtctldata_proto_msgTypes[265] + mi := &file_vtctldata_proto_msgTypes[271] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15406,7 +15724,7 @@ func (x *WorkflowStatusResponse_ShardStreamState) String() string { func (*WorkflowStatusResponse_ShardStreamState) ProtoMessage() {} func (x *WorkflowStatusResponse_ShardStreamState) ProtoReflect() protoreflect.Message { - mi := &file_vtctldata_proto_msgTypes[265] + mi := &file_vtctldata_proto_msgTypes[271] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15475,7 +15793,7 @@ type WorkflowStatusResponse_ShardStreams struct { func (x *WorkflowStatusResponse_ShardStreams) Reset() { *x = WorkflowStatusResponse_ShardStreams{} if protoimpl.UnsafeEnabled { - mi := &file_vtctldata_proto_msgTypes[266] + mi := &file_vtctldata_proto_msgTypes[272] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15488,7 +15806,7 @@ func (x *WorkflowStatusResponse_ShardStreams) String() string { func (*WorkflowStatusResponse_ShardStreams) ProtoMessage() {} func (x *WorkflowStatusResponse_ShardStreams) ProtoReflect() protoreflect.Message { - mi := &file_vtctldata_proto_msgTypes[266] + mi := &file_vtctldata_proto_msgTypes[272] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15525,7 +15843,7 @@ type WorkflowUpdateResponse_TabletInfo struct { func (x *WorkflowUpdateResponse_TabletInfo) Reset() { *x = WorkflowUpdateResponse_TabletInfo{} if protoimpl.UnsafeEnabled { - mi := &file_vtctldata_proto_msgTypes[269] + mi := &file_vtctldata_proto_msgTypes[275] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15538,7 +15856,7 @@ func (x *WorkflowUpdateResponse_TabletInfo) String() string { func (*WorkflowUpdateResponse_TabletInfo) ProtoMessage() {} func (x *WorkflowUpdateResponse_TabletInfo) ProtoReflect() protoreflect.Message { - mi := &file_vtctldata_proto_msgTypes[269] + mi := &file_vtctldata_proto_msgTypes[275] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17833,19 +18151,52 @@ var file_vtctldata_proto_rawDesc = []byte{ 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x2a, - 0x4a, 0x0a, 0x15, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x49, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x55, 0x53, 0x54, - 0x4f, 0x4d, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4d, 0x4f, 0x56, 0x45, 0x54, 0x41, 0x42, 0x4c, - 0x45, 0x53, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x4c, 0x4f, - 0x4f, 0x4b, 0x55, 0x50, 0x49, 0x4e, 0x44, 0x45, 0x58, 0x10, 0x02, 0x2a, 0x38, 0x0a, 0x0d, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x08, 0x0a, 0x04, - 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x53, 0x43, 0x45, 0x4e, 0x44, - 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x45, 0x53, 0x43, 0x45, 0x4e, 0x44, - 0x49, 0x4e, 0x47, 0x10, 0x02, 0x42, 0x28, 0x5a, 0x26, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2e, - 0x69, 0x6f, 0x2f, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x74, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x74, 0x63, 0x74, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x22, + 0x9a, 0x01, 0x0a, 0x17, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x52, + 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x0c, 0x6d, + 0x69, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x76, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4d, 0x69, 0x72, 0x72, + 0x6f, 0x72, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x0b, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x52, + 0x75, 0x6c, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x72, 0x65, 0x62, + 0x75, 0x69, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x73, 0x6b, 0x69, 0x70, + 0x52, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x62, 0x75, 0x69, + 0x6c, 0x64, 0x5f, 0x63, 0x65, 0x6c, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, + 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x43, 0x65, 0x6c, 0x6c, 0x73, 0x22, 0x1a, 0x0a, 0x18, + 0x41, 0x70, 0x70, 0x6c, 0x79, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x75, 0x6c, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x17, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x4d, + 0x69, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x51, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x75, + 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0c, 0x6d, + 0x69, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x76, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4d, 0x69, 0x72, 0x72, + 0x6f, 0x72, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x0b, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x52, + 0x75, 0x6c, 0x65, 0x73, 0x22, 0x70, 0x0a, 0x1c, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, + 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x12, 0x1a, 0x0a, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x18, 0x0a, 0x07, + 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x07, 0x70, + 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x22, 0x7f, 0x0a, 0x1d, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, + 0x6f, 0x77, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, + 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, + 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, + 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2a, 0x4a, 0x0a, 0x15, 0x4d, 0x61, 0x74, 0x65, 0x72, + 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, + 0x4d, 0x4f, 0x56, 0x45, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x53, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, + 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x4c, 0x4f, 0x4f, 0x4b, 0x55, 0x50, 0x49, 0x4e, 0x44, 0x45, + 0x58, 0x10, 0x02, 0x2a, 0x38, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, + 0x72, 0x69, 0x6e, 0x67, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x0d, + 0x0a, 0x09, 0x41, 0x53, 0x43, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0e, 0x0a, + 0x0a, 0x44, 0x45, 0x53, 0x43, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x42, 0x28, 0x5a, + 0x26, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x69, 0x74, 0x65, 0x73, + 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x74, + 0x63, 0x74, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -17861,7 +18212,7 @@ func file_vtctldata_proto_rawDescGZIP() []byte { } var file_vtctldata_proto_enumTypes = make([]protoimpl.EnumInfo, 4) -var file_vtctldata_proto_msgTypes = make([]protoimpl.MessageInfo, 270) +var file_vtctldata_proto_msgTypes = make([]protoimpl.MessageInfo, 276) var file_vtctldata_proto_goTypes = []interface{}{ (MaterializationIntent)(0), // 0: vtctldata.MaterializationIntent (QueryOrdering)(0), // 1: vtctldata.QueryOrdering @@ -18099,295 +18450,304 @@ var file_vtctldata_proto_goTypes = []interface{}{ (*WorkflowSwitchTrafficResponse)(nil), // 233: vtctldata.WorkflowSwitchTrafficResponse (*WorkflowUpdateRequest)(nil), // 234: vtctldata.WorkflowUpdateRequest (*WorkflowUpdateResponse)(nil), // 235: vtctldata.WorkflowUpdateResponse - nil, // 236: vtctldata.Workflow.ShardStreamsEntry - (*Workflow_ReplicationLocation)(nil), // 237: vtctldata.Workflow.ReplicationLocation - (*Workflow_ShardStream)(nil), // 238: vtctldata.Workflow.ShardStream - (*Workflow_Stream)(nil), // 239: vtctldata.Workflow.Stream - (*Workflow_Stream_CopyState)(nil), // 240: vtctldata.Workflow.Stream.CopyState - (*Workflow_Stream_Log)(nil), // 241: vtctldata.Workflow.Stream.Log - (*Workflow_Stream_ThrottlerStatus)(nil), // 242: vtctldata.Workflow.Stream.ThrottlerStatus - nil, // 243: vtctldata.ApplySchemaResponse.RowsAffectedByShardEntry - nil, // 244: vtctldata.ApplyVSchemaResponse.UnknownVindexParamsEntry - (*ApplyVSchemaResponse_ParamList)(nil), // 245: vtctldata.ApplyVSchemaResponse.ParamList - nil, // 246: vtctldata.CancelSchemaMigrationResponse.RowsAffectedByShardEntry - nil, // 247: vtctldata.CleanupSchemaMigrationResponse.RowsAffectedByShardEntry - nil, // 248: vtctldata.CompleteSchemaMigrationResponse.RowsAffectedByShardEntry - nil, // 249: vtctldata.FindAllShardsInKeyspaceResponse.ShardsEntry - nil, // 250: vtctldata.ForceCutOverSchemaMigrationResponse.RowsAffectedByShardEntry - nil, // 251: vtctldata.GetCellsAliasesResponse.AliasesEntry - nil, // 252: vtctldata.GetSrvKeyspaceNamesResponse.NamesEntry - (*GetSrvKeyspaceNamesResponse_NameList)(nil), // 253: vtctldata.GetSrvKeyspaceNamesResponse.NameList - nil, // 254: vtctldata.GetSrvKeyspacesResponse.SrvKeyspacesEntry - nil, // 255: vtctldata.GetSrvVSchemasResponse.SrvVSchemasEntry - nil, // 256: vtctldata.LaunchSchemaMigrationResponse.RowsAffectedByShardEntry - (*MoveTablesCreateResponse_TabletInfo)(nil), // 257: vtctldata.MoveTablesCreateResponse.TabletInfo - nil, // 258: vtctldata.RetrySchemaMigrationResponse.RowsAffectedByShardEntry - nil, // 259: vtctldata.ShardReplicationPositionsResponse.ReplicationStatusesEntry - nil, // 260: vtctldata.ShardReplicationPositionsResponse.TabletMapEntry - nil, // 261: vtctldata.ValidateResponse.ResultsByKeyspaceEntry - nil, // 262: vtctldata.ValidateKeyspaceResponse.ResultsByShardEntry - nil, // 263: vtctldata.ValidateSchemaKeyspaceResponse.ResultsByShardEntry - nil, // 264: vtctldata.ValidateVersionKeyspaceResponse.ResultsByShardEntry - nil, // 265: vtctldata.ValidateVSchemaResponse.ResultsByShardEntry - nil, // 266: vtctldata.VDiffShowResponse.TabletResponsesEntry - (*WorkflowDeleteResponse_TabletInfo)(nil), // 267: vtctldata.WorkflowDeleteResponse.TabletInfo - (*WorkflowStatusResponse_TableCopyState)(nil), // 268: vtctldata.WorkflowStatusResponse.TableCopyState - (*WorkflowStatusResponse_ShardStreamState)(nil), // 269: vtctldata.WorkflowStatusResponse.ShardStreamState - (*WorkflowStatusResponse_ShardStreams)(nil), // 270: vtctldata.WorkflowStatusResponse.ShardStreams - nil, // 271: vtctldata.WorkflowStatusResponse.TableCopyStateEntry - nil, // 272: vtctldata.WorkflowStatusResponse.ShardStreamsEntry - (*WorkflowUpdateResponse_TabletInfo)(nil), // 273: vtctldata.WorkflowUpdateResponse.TabletInfo - (*logutil.Event)(nil), // 274: logutil.Event - (tabletmanagerdata.TabletSelectionPreference)(0), // 275: tabletmanagerdata.TabletSelectionPreference - (*topodata.Keyspace)(nil), // 276: topodata.Keyspace - (*vttime.Time)(nil), // 277: vttime.Time - (*topodata.TabletAlias)(nil), // 278: topodata.TabletAlias - (*vttime.Duration)(nil), // 279: vttime.Duration - (*topodata.Shard)(nil), // 280: topodata.Shard - (*topodata.CellInfo)(nil), // 281: topodata.CellInfo - (*vschema.RoutingRules)(nil), // 282: vschema.RoutingRules - (*vschema.ShardRoutingRules)(nil), // 283: vschema.ShardRoutingRules - (*vtrpc.CallerID)(nil), // 284: vtrpc.CallerID - (*vschema.Keyspace)(nil), // 285: vschema.Keyspace - (topodata.TabletType)(0), // 286: topodata.TabletType - (*topodata.Tablet)(nil), // 287: topodata.Tablet - (topodata.KeyspaceType)(0), // 288: topodata.KeyspaceType - (*query.QueryResult)(nil), // 289: query.QueryResult - (*tabletmanagerdata.ExecuteHookRequest)(nil), // 290: tabletmanagerdata.ExecuteHookRequest - (*tabletmanagerdata.ExecuteHookResponse)(nil), // 291: tabletmanagerdata.ExecuteHookResponse - (*mysqlctl.BackupInfo)(nil), // 292: mysqlctl.BackupInfo - (*replicationdata.FullStatus)(nil), // 293: replicationdata.FullStatus - (*tabletmanagerdata.Permissions)(nil), // 294: tabletmanagerdata.Permissions - (*tabletmanagerdata.SchemaDefinition)(nil), // 295: tabletmanagerdata.SchemaDefinition - (*topodata.ThrottledAppRule)(nil), // 296: topodata.ThrottledAppRule - (*vschema.SrvVSchema)(nil), // 297: vschema.SrvVSchema - (*topodata.ShardReplicationError)(nil), // 298: topodata.ShardReplicationError - (*topodata.KeyRange)(nil), // 299: topodata.KeyRange - (*topodata.CellsAlias)(nil), // 300: topodata.CellsAlias - (*tabletmanagerdata.UpdateVReplicationWorkflowRequest)(nil), // 301: tabletmanagerdata.UpdateVReplicationWorkflowRequest - (*topodata.Shard_TabletControl)(nil), // 302: topodata.Shard.TabletControl - (*binlogdata.BinlogSource)(nil), // 303: binlogdata.BinlogSource - (*topodata.SrvKeyspace)(nil), // 304: topodata.SrvKeyspace - (*replicationdata.Status)(nil), // 305: replicationdata.Status - (*tabletmanagerdata.VDiffResponse)(nil), // 306: tabletmanagerdata.VDiffResponse + (*ApplyMirrorRulesRequest)(nil), // 236: vtctldata.ApplyMirrorRulesRequest + (*ApplyMirrorRulesResponse)(nil), // 237: vtctldata.ApplyMirrorRulesResponse + (*GetMirrorRulesRequest)(nil), // 238: vtctldata.GetMirrorRulesRequest + (*GetMirrorRulesResponse)(nil), // 239: vtctldata.GetMirrorRulesResponse + (*WorkflowMirrorTrafficRequest)(nil), // 240: vtctldata.WorkflowMirrorTrafficRequest + (*WorkflowMirrorTrafficResponse)(nil), // 241: vtctldata.WorkflowMirrorTrafficResponse + nil, // 242: vtctldata.Workflow.ShardStreamsEntry + (*Workflow_ReplicationLocation)(nil), // 243: vtctldata.Workflow.ReplicationLocation + (*Workflow_ShardStream)(nil), // 244: vtctldata.Workflow.ShardStream + (*Workflow_Stream)(nil), // 245: vtctldata.Workflow.Stream + (*Workflow_Stream_CopyState)(nil), // 246: vtctldata.Workflow.Stream.CopyState + (*Workflow_Stream_Log)(nil), // 247: vtctldata.Workflow.Stream.Log + (*Workflow_Stream_ThrottlerStatus)(nil), // 248: vtctldata.Workflow.Stream.ThrottlerStatus + nil, // 249: vtctldata.ApplySchemaResponse.RowsAffectedByShardEntry + nil, // 250: vtctldata.ApplyVSchemaResponse.UnknownVindexParamsEntry + (*ApplyVSchemaResponse_ParamList)(nil), // 251: vtctldata.ApplyVSchemaResponse.ParamList + nil, // 252: vtctldata.CancelSchemaMigrationResponse.RowsAffectedByShardEntry + nil, // 253: vtctldata.CleanupSchemaMigrationResponse.RowsAffectedByShardEntry + nil, // 254: vtctldata.CompleteSchemaMigrationResponse.RowsAffectedByShardEntry + nil, // 255: vtctldata.FindAllShardsInKeyspaceResponse.ShardsEntry + nil, // 256: vtctldata.ForceCutOverSchemaMigrationResponse.RowsAffectedByShardEntry + nil, // 257: vtctldata.GetCellsAliasesResponse.AliasesEntry + nil, // 258: vtctldata.GetSrvKeyspaceNamesResponse.NamesEntry + (*GetSrvKeyspaceNamesResponse_NameList)(nil), // 259: vtctldata.GetSrvKeyspaceNamesResponse.NameList + nil, // 260: vtctldata.GetSrvKeyspacesResponse.SrvKeyspacesEntry + nil, // 261: vtctldata.GetSrvVSchemasResponse.SrvVSchemasEntry + nil, // 262: vtctldata.LaunchSchemaMigrationResponse.RowsAffectedByShardEntry + (*MoveTablesCreateResponse_TabletInfo)(nil), // 263: vtctldata.MoveTablesCreateResponse.TabletInfo + nil, // 264: vtctldata.RetrySchemaMigrationResponse.RowsAffectedByShardEntry + nil, // 265: vtctldata.ShardReplicationPositionsResponse.ReplicationStatusesEntry + nil, // 266: vtctldata.ShardReplicationPositionsResponse.TabletMapEntry + nil, // 267: vtctldata.ValidateResponse.ResultsByKeyspaceEntry + nil, // 268: vtctldata.ValidateKeyspaceResponse.ResultsByShardEntry + nil, // 269: vtctldata.ValidateSchemaKeyspaceResponse.ResultsByShardEntry + nil, // 270: vtctldata.ValidateVersionKeyspaceResponse.ResultsByShardEntry + nil, // 271: vtctldata.ValidateVSchemaResponse.ResultsByShardEntry + nil, // 272: vtctldata.VDiffShowResponse.TabletResponsesEntry + (*WorkflowDeleteResponse_TabletInfo)(nil), // 273: vtctldata.WorkflowDeleteResponse.TabletInfo + (*WorkflowStatusResponse_TableCopyState)(nil), // 274: vtctldata.WorkflowStatusResponse.TableCopyState + (*WorkflowStatusResponse_ShardStreamState)(nil), // 275: vtctldata.WorkflowStatusResponse.ShardStreamState + (*WorkflowStatusResponse_ShardStreams)(nil), // 276: vtctldata.WorkflowStatusResponse.ShardStreams + nil, // 277: vtctldata.WorkflowStatusResponse.TableCopyStateEntry + nil, // 278: vtctldata.WorkflowStatusResponse.ShardStreamsEntry + (*WorkflowUpdateResponse_TabletInfo)(nil), // 279: vtctldata.WorkflowUpdateResponse.TabletInfo + (*logutil.Event)(nil), // 280: logutil.Event + (tabletmanagerdata.TabletSelectionPreference)(0), // 281: tabletmanagerdata.TabletSelectionPreference + (*topodata.Keyspace)(nil), // 282: topodata.Keyspace + (*vttime.Time)(nil), // 283: vttime.Time + (*topodata.TabletAlias)(nil), // 284: topodata.TabletAlias + (*vttime.Duration)(nil), // 285: vttime.Duration + (*topodata.Shard)(nil), // 286: topodata.Shard + (*topodata.CellInfo)(nil), // 287: topodata.CellInfo + (*vschema.RoutingRules)(nil), // 288: vschema.RoutingRules + (*vschema.ShardRoutingRules)(nil), // 289: vschema.ShardRoutingRules + (*vtrpc.CallerID)(nil), // 290: vtrpc.CallerID + (*vschema.Keyspace)(nil), // 291: vschema.Keyspace + (topodata.TabletType)(0), // 292: topodata.TabletType + (*topodata.Tablet)(nil), // 293: topodata.Tablet + (topodata.KeyspaceType)(0), // 294: topodata.KeyspaceType + (*query.QueryResult)(nil), // 295: query.QueryResult + (*tabletmanagerdata.ExecuteHookRequest)(nil), // 296: tabletmanagerdata.ExecuteHookRequest + (*tabletmanagerdata.ExecuteHookResponse)(nil), // 297: tabletmanagerdata.ExecuteHookResponse + (*mysqlctl.BackupInfo)(nil), // 298: mysqlctl.BackupInfo + (*replicationdata.FullStatus)(nil), // 299: replicationdata.FullStatus + (*tabletmanagerdata.Permissions)(nil), // 300: tabletmanagerdata.Permissions + (*tabletmanagerdata.SchemaDefinition)(nil), // 301: tabletmanagerdata.SchemaDefinition + (*topodata.ThrottledAppRule)(nil), // 302: topodata.ThrottledAppRule + (*vschema.SrvVSchema)(nil), // 303: vschema.SrvVSchema + (*topodata.ShardReplicationError)(nil), // 304: topodata.ShardReplicationError + (*topodata.KeyRange)(nil), // 305: topodata.KeyRange + (*topodata.CellsAlias)(nil), // 306: topodata.CellsAlias + (*tabletmanagerdata.UpdateVReplicationWorkflowRequest)(nil), // 307: tabletmanagerdata.UpdateVReplicationWorkflowRequest + (*vschema.MirrorRules)(nil), // 308: vschema.MirrorRules + (*topodata.Shard_TabletControl)(nil), // 309: topodata.Shard.TabletControl + (*binlogdata.BinlogSource)(nil), // 310: binlogdata.BinlogSource + (*topodata.SrvKeyspace)(nil), // 311: topodata.SrvKeyspace + (*replicationdata.Status)(nil), // 312: replicationdata.Status + (*tabletmanagerdata.VDiffResponse)(nil), // 313: tabletmanagerdata.VDiffResponse } var file_vtctldata_proto_depIdxs = []int32{ - 274, // 0: vtctldata.ExecuteVtctlCommandResponse.event:type_name -> logutil.Event + 280, // 0: vtctldata.ExecuteVtctlCommandResponse.event:type_name -> logutil.Event 6, // 1: vtctldata.MaterializeSettings.table_settings:type_name -> vtctldata.TableMaterializeSettings 0, // 2: vtctldata.MaterializeSettings.materialization_intent:type_name -> vtctldata.MaterializationIntent - 275, // 3: vtctldata.MaterializeSettings.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 276, // 4: vtctldata.Keyspace.keyspace:type_name -> topodata.Keyspace + 281, // 3: vtctldata.MaterializeSettings.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference + 282, // 4: vtctldata.Keyspace.keyspace:type_name -> topodata.Keyspace 2, // 5: vtctldata.SchemaMigration.strategy:type_name -> vtctldata.SchemaMigration.Strategy - 277, // 6: vtctldata.SchemaMigration.added_at:type_name -> vttime.Time - 277, // 7: vtctldata.SchemaMigration.requested_at:type_name -> vttime.Time - 277, // 8: vtctldata.SchemaMigration.ready_at:type_name -> vttime.Time - 277, // 9: vtctldata.SchemaMigration.started_at:type_name -> vttime.Time - 277, // 10: vtctldata.SchemaMigration.liveness_timestamp:type_name -> vttime.Time - 277, // 11: vtctldata.SchemaMigration.completed_at:type_name -> vttime.Time - 277, // 12: vtctldata.SchemaMigration.cleaned_up_at:type_name -> vttime.Time + 283, // 6: vtctldata.SchemaMigration.added_at:type_name -> vttime.Time + 283, // 7: vtctldata.SchemaMigration.requested_at:type_name -> vttime.Time + 283, // 8: vtctldata.SchemaMigration.ready_at:type_name -> vttime.Time + 283, // 9: vtctldata.SchemaMigration.started_at:type_name -> vttime.Time + 283, // 10: vtctldata.SchemaMigration.liveness_timestamp:type_name -> vttime.Time + 283, // 11: vtctldata.SchemaMigration.completed_at:type_name -> vttime.Time + 283, // 12: vtctldata.SchemaMigration.cleaned_up_at:type_name -> vttime.Time 3, // 13: vtctldata.SchemaMigration.status:type_name -> vtctldata.SchemaMigration.Status - 278, // 14: vtctldata.SchemaMigration.tablet:type_name -> topodata.TabletAlias - 279, // 15: vtctldata.SchemaMigration.artifact_retention:type_name -> vttime.Duration - 277, // 16: vtctldata.SchemaMigration.last_throttled_at:type_name -> vttime.Time - 277, // 17: vtctldata.SchemaMigration.cancelled_at:type_name -> vttime.Time - 277, // 18: vtctldata.SchemaMigration.reviewed_at:type_name -> vttime.Time - 277, // 19: vtctldata.SchemaMigration.ready_to_complete_at:type_name -> vttime.Time - 280, // 20: vtctldata.Shard.shard:type_name -> topodata.Shard - 237, // 21: vtctldata.Workflow.source:type_name -> vtctldata.Workflow.ReplicationLocation - 237, // 22: vtctldata.Workflow.target:type_name -> vtctldata.Workflow.ReplicationLocation - 236, // 23: vtctldata.Workflow.shard_streams:type_name -> vtctldata.Workflow.ShardStreamsEntry - 281, // 24: vtctldata.AddCellInfoRequest.cell_info:type_name -> topodata.CellInfo - 282, // 25: vtctldata.ApplyRoutingRulesRequest.routing_rules:type_name -> vschema.RoutingRules - 283, // 26: vtctldata.ApplyShardRoutingRulesRequest.shard_routing_rules:type_name -> vschema.ShardRoutingRules - 279, // 27: vtctldata.ApplySchemaRequest.wait_replicas_timeout:type_name -> vttime.Duration - 284, // 28: vtctldata.ApplySchemaRequest.caller_id:type_name -> vtrpc.CallerID - 243, // 29: vtctldata.ApplySchemaResponse.rows_affected_by_shard:type_name -> vtctldata.ApplySchemaResponse.RowsAffectedByShardEntry - 285, // 30: vtctldata.ApplyVSchemaRequest.v_schema:type_name -> vschema.Keyspace - 285, // 31: vtctldata.ApplyVSchemaResponse.v_schema:type_name -> vschema.Keyspace - 244, // 32: vtctldata.ApplyVSchemaResponse.unknown_vindex_params:type_name -> vtctldata.ApplyVSchemaResponse.UnknownVindexParamsEntry - 278, // 33: vtctldata.BackupRequest.tablet_alias:type_name -> topodata.TabletAlias - 278, // 34: vtctldata.BackupResponse.tablet_alias:type_name -> topodata.TabletAlias - 274, // 35: vtctldata.BackupResponse.event:type_name -> logutil.Event - 246, // 36: vtctldata.CancelSchemaMigrationResponse.rows_affected_by_shard:type_name -> vtctldata.CancelSchemaMigrationResponse.RowsAffectedByShardEntry - 278, // 37: vtctldata.ChangeTabletTypeRequest.tablet_alias:type_name -> topodata.TabletAlias - 286, // 38: vtctldata.ChangeTabletTypeRequest.db_type:type_name -> topodata.TabletType - 287, // 39: vtctldata.ChangeTabletTypeResponse.before_tablet:type_name -> topodata.Tablet - 287, // 40: vtctldata.ChangeTabletTypeResponse.after_tablet:type_name -> topodata.Tablet - 247, // 41: vtctldata.CleanupSchemaMigrationResponse.rows_affected_by_shard:type_name -> vtctldata.CleanupSchemaMigrationResponse.RowsAffectedByShardEntry - 248, // 42: vtctldata.CompleteSchemaMigrationResponse.rows_affected_by_shard:type_name -> vtctldata.CompleteSchemaMigrationResponse.RowsAffectedByShardEntry - 288, // 43: vtctldata.CreateKeyspaceRequest.type:type_name -> topodata.KeyspaceType - 277, // 44: vtctldata.CreateKeyspaceRequest.snapshot_time:type_name -> vttime.Time + 284, // 14: vtctldata.SchemaMigration.tablet:type_name -> topodata.TabletAlias + 285, // 15: vtctldata.SchemaMigration.artifact_retention:type_name -> vttime.Duration + 283, // 16: vtctldata.SchemaMigration.last_throttled_at:type_name -> vttime.Time + 283, // 17: vtctldata.SchemaMigration.cancelled_at:type_name -> vttime.Time + 283, // 18: vtctldata.SchemaMigration.reviewed_at:type_name -> vttime.Time + 283, // 19: vtctldata.SchemaMigration.ready_to_complete_at:type_name -> vttime.Time + 286, // 20: vtctldata.Shard.shard:type_name -> topodata.Shard + 243, // 21: vtctldata.Workflow.source:type_name -> vtctldata.Workflow.ReplicationLocation + 243, // 22: vtctldata.Workflow.target:type_name -> vtctldata.Workflow.ReplicationLocation + 242, // 23: vtctldata.Workflow.shard_streams:type_name -> vtctldata.Workflow.ShardStreamsEntry + 287, // 24: vtctldata.AddCellInfoRequest.cell_info:type_name -> topodata.CellInfo + 288, // 25: vtctldata.ApplyRoutingRulesRequest.routing_rules:type_name -> vschema.RoutingRules + 289, // 26: vtctldata.ApplyShardRoutingRulesRequest.shard_routing_rules:type_name -> vschema.ShardRoutingRules + 285, // 27: vtctldata.ApplySchemaRequest.wait_replicas_timeout:type_name -> vttime.Duration + 290, // 28: vtctldata.ApplySchemaRequest.caller_id:type_name -> vtrpc.CallerID + 249, // 29: vtctldata.ApplySchemaResponse.rows_affected_by_shard:type_name -> vtctldata.ApplySchemaResponse.RowsAffectedByShardEntry + 291, // 30: vtctldata.ApplyVSchemaRequest.v_schema:type_name -> vschema.Keyspace + 291, // 31: vtctldata.ApplyVSchemaResponse.v_schema:type_name -> vschema.Keyspace + 250, // 32: vtctldata.ApplyVSchemaResponse.unknown_vindex_params:type_name -> vtctldata.ApplyVSchemaResponse.UnknownVindexParamsEntry + 284, // 33: vtctldata.BackupRequest.tablet_alias:type_name -> topodata.TabletAlias + 284, // 34: vtctldata.BackupResponse.tablet_alias:type_name -> topodata.TabletAlias + 280, // 35: vtctldata.BackupResponse.event:type_name -> logutil.Event + 252, // 36: vtctldata.CancelSchemaMigrationResponse.rows_affected_by_shard:type_name -> vtctldata.CancelSchemaMigrationResponse.RowsAffectedByShardEntry + 284, // 37: vtctldata.ChangeTabletTypeRequest.tablet_alias:type_name -> topodata.TabletAlias + 292, // 38: vtctldata.ChangeTabletTypeRequest.db_type:type_name -> topodata.TabletType + 293, // 39: vtctldata.ChangeTabletTypeResponse.before_tablet:type_name -> topodata.Tablet + 293, // 40: vtctldata.ChangeTabletTypeResponse.after_tablet:type_name -> topodata.Tablet + 253, // 41: vtctldata.CleanupSchemaMigrationResponse.rows_affected_by_shard:type_name -> vtctldata.CleanupSchemaMigrationResponse.RowsAffectedByShardEntry + 254, // 42: vtctldata.CompleteSchemaMigrationResponse.rows_affected_by_shard:type_name -> vtctldata.CompleteSchemaMigrationResponse.RowsAffectedByShardEntry + 294, // 43: vtctldata.CreateKeyspaceRequest.type:type_name -> topodata.KeyspaceType + 283, // 44: vtctldata.CreateKeyspaceRequest.snapshot_time:type_name -> vttime.Time 8, // 45: vtctldata.CreateKeyspaceResponse.keyspace:type_name -> vtctldata.Keyspace 8, // 46: vtctldata.CreateShardResponse.keyspace:type_name -> vtctldata.Keyspace 10, // 47: vtctldata.CreateShardResponse.shard:type_name -> vtctldata.Shard 10, // 48: vtctldata.DeleteShardsRequest.shards:type_name -> vtctldata.Shard - 278, // 49: vtctldata.DeleteTabletsRequest.tablet_aliases:type_name -> topodata.TabletAlias - 278, // 50: vtctldata.EmergencyReparentShardRequest.new_primary:type_name -> topodata.TabletAlias - 278, // 51: vtctldata.EmergencyReparentShardRequest.ignore_replicas:type_name -> topodata.TabletAlias - 279, // 52: vtctldata.EmergencyReparentShardRequest.wait_replicas_timeout:type_name -> vttime.Duration - 278, // 53: vtctldata.EmergencyReparentShardResponse.promoted_primary:type_name -> topodata.TabletAlias - 274, // 54: vtctldata.EmergencyReparentShardResponse.events:type_name -> logutil.Event - 278, // 55: vtctldata.ExecuteFetchAsAppRequest.tablet_alias:type_name -> topodata.TabletAlias - 289, // 56: vtctldata.ExecuteFetchAsAppResponse.result:type_name -> query.QueryResult - 278, // 57: vtctldata.ExecuteFetchAsDBARequest.tablet_alias:type_name -> topodata.TabletAlias - 289, // 58: vtctldata.ExecuteFetchAsDBAResponse.result:type_name -> query.QueryResult - 278, // 59: vtctldata.ExecuteHookRequest.tablet_alias:type_name -> topodata.TabletAlias - 290, // 60: vtctldata.ExecuteHookRequest.tablet_hook_request:type_name -> tabletmanagerdata.ExecuteHookRequest - 291, // 61: vtctldata.ExecuteHookResponse.hook_result:type_name -> tabletmanagerdata.ExecuteHookResponse - 249, // 62: vtctldata.FindAllShardsInKeyspaceResponse.shards:type_name -> vtctldata.FindAllShardsInKeyspaceResponse.ShardsEntry - 250, // 63: vtctldata.ForceCutOverSchemaMigrationResponse.rows_affected_by_shard:type_name -> vtctldata.ForceCutOverSchemaMigrationResponse.RowsAffectedByShardEntry - 292, // 64: vtctldata.GetBackupsResponse.backups:type_name -> mysqlctl.BackupInfo - 281, // 65: vtctldata.GetCellInfoResponse.cell_info:type_name -> topodata.CellInfo - 251, // 66: vtctldata.GetCellsAliasesResponse.aliases:type_name -> vtctldata.GetCellsAliasesResponse.AliasesEntry - 278, // 67: vtctldata.GetFullStatusRequest.tablet_alias:type_name -> topodata.TabletAlias - 293, // 68: vtctldata.GetFullStatusResponse.status:type_name -> replicationdata.FullStatus + 284, // 49: vtctldata.DeleteTabletsRequest.tablet_aliases:type_name -> topodata.TabletAlias + 284, // 50: vtctldata.EmergencyReparentShardRequest.new_primary:type_name -> topodata.TabletAlias + 284, // 51: vtctldata.EmergencyReparentShardRequest.ignore_replicas:type_name -> topodata.TabletAlias + 285, // 52: vtctldata.EmergencyReparentShardRequest.wait_replicas_timeout:type_name -> vttime.Duration + 284, // 53: vtctldata.EmergencyReparentShardResponse.promoted_primary:type_name -> topodata.TabletAlias + 280, // 54: vtctldata.EmergencyReparentShardResponse.events:type_name -> logutil.Event + 284, // 55: vtctldata.ExecuteFetchAsAppRequest.tablet_alias:type_name -> topodata.TabletAlias + 295, // 56: vtctldata.ExecuteFetchAsAppResponse.result:type_name -> query.QueryResult + 284, // 57: vtctldata.ExecuteFetchAsDBARequest.tablet_alias:type_name -> topodata.TabletAlias + 295, // 58: vtctldata.ExecuteFetchAsDBAResponse.result:type_name -> query.QueryResult + 284, // 59: vtctldata.ExecuteHookRequest.tablet_alias:type_name -> topodata.TabletAlias + 296, // 60: vtctldata.ExecuteHookRequest.tablet_hook_request:type_name -> tabletmanagerdata.ExecuteHookRequest + 297, // 61: vtctldata.ExecuteHookResponse.hook_result:type_name -> tabletmanagerdata.ExecuteHookResponse + 255, // 62: vtctldata.FindAllShardsInKeyspaceResponse.shards:type_name -> vtctldata.FindAllShardsInKeyspaceResponse.ShardsEntry + 256, // 63: vtctldata.ForceCutOverSchemaMigrationResponse.rows_affected_by_shard:type_name -> vtctldata.ForceCutOverSchemaMigrationResponse.RowsAffectedByShardEntry + 298, // 64: vtctldata.GetBackupsResponse.backups:type_name -> mysqlctl.BackupInfo + 287, // 65: vtctldata.GetCellInfoResponse.cell_info:type_name -> topodata.CellInfo + 257, // 66: vtctldata.GetCellsAliasesResponse.aliases:type_name -> vtctldata.GetCellsAliasesResponse.AliasesEntry + 284, // 67: vtctldata.GetFullStatusRequest.tablet_alias:type_name -> topodata.TabletAlias + 299, // 68: vtctldata.GetFullStatusResponse.status:type_name -> replicationdata.FullStatus 8, // 69: vtctldata.GetKeyspacesResponse.keyspaces:type_name -> vtctldata.Keyspace 8, // 70: vtctldata.GetKeyspaceResponse.keyspace:type_name -> vtctldata.Keyspace - 278, // 71: vtctldata.GetPermissionsRequest.tablet_alias:type_name -> topodata.TabletAlias - 294, // 72: vtctldata.GetPermissionsResponse.permissions:type_name -> tabletmanagerdata.Permissions - 282, // 73: vtctldata.GetRoutingRulesResponse.routing_rules:type_name -> vschema.RoutingRules - 278, // 74: vtctldata.GetSchemaRequest.tablet_alias:type_name -> topodata.TabletAlias - 295, // 75: vtctldata.GetSchemaResponse.schema:type_name -> tabletmanagerdata.SchemaDefinition + 284, // 71: vtctldata.GetPermissionsRequest.tablet_alias:type_name -> topodata.TabletAlias + 300, // 72: vtctldata.GetPermissionsResponse.permissions:type_name -> tabletmanagerdata.Permissions + 288, // 73: vtctldata.GetRoutingRulesResponse.routing_rules:type_name -> vschema.RoutingRules + 284, // 74: vtctldata.GetSchemaRequest.tablet_alias:type_name -> topodata.TabletAlias + 301, // 75: vtctldata.GetSchemaResponse.schema:type_name -> tabletmanagerdata.SchemaDefinition 3, // 76: vtctldata.GetSchemaMigrationsRequest.status:type_name -> vtctldata.SchemaMigration.Status - 279, // 77: vtctldata.GetSchemaMigrationsRequest.recent:type_name -> vttime.Duration + 285, // 77: vtctldata.GetSchemaMigrationsRequest.recent:type_name -> vttime.Duration 1, // 78: vtctldata.GetSchemaMigrationsRequest.order:type_name -> vtctldata.QueryOrdering 9, // 79: vtctldata.GetSchemaMigrationsResponse.migrations:type_name -> vtctldata.SchemaMigration 10, // 80: vtctldata.GetShardResponse.shard:type_name -> vtctldata.Shard - 283, // 81: vtctldata.GetShardRoutingRulesResponse.shard_routing_rules:type_name -> vschema.ShardRoutingRules - 252, // 82: vtctldata.GetSrvKeyspaceNamesResponse.names:type_name -> vtctldata.GetSrvKeyspaceNamesResponse.NamesEntry - 254, // 83: vtctldata.GetSrvKeyspacesResponse.srv_keyspaces:type_name -> vtctldata.GetSrvKeyspacesResponse.SrvKeyspacesEntry - 296, // 84: vtctldata.UpdateThrottlerConfigRequest.throttled_app:type_name -> topodata.ThrottledAppRule - 297, // 85: vtctldata.GetSrvVSchemaResponse.srv_v_schema:type_name -> vschema.SrvVSchema - 255, // 86: vtctldata.GetSrvVSchemasResponse.srv_v_schemas:type_name -> vtctldata.GetSrvVSchemasResponse.SrvVSchemasEntry - 278, // 87: vtctldata.GetTabletRequest.tablet_alias:type_name -> topodata.TabletAlias - 287, // 88: vtctldata.GetTabletResponse.tablet:type_name -> topodata.Tablet - 278, // 89: vtctldata.GetTabletsRequest.tablet_aliases:type_name -> topodata.TabletAlias - 286, // 90: vtctldata.GetTabletsRequest.tablet_type:type_name -> topodata.TabletType - 287, // 91: vtctldata.GetTabletsResponse.tablets:type_name -> topodata.Tablet + 289, // 81: vtctldata.GetShardRoutingRulesResponse.shard_routing_rules:type_name -> vschema.ShardRoutingRules + 258, // 82: vtctldata.GetSrvKeyspaceNamesResponse.names:type_name -> vtctldata.GetSrvKeyspaceNamesResponse.NamesEntry + 260, // 83: vtctldata.GetSrvKeyspacesResponse.srv_keyspaces:type_name -> vtctldata.GetSrvKeyspacesResponse.SrvKeyspacesEntry + 302, // 84: vtctldata.UpdateThrottlerConfigRequest.throttled_app:type_name -> topodata.ThrottledAppRule + 303, // 85: vtctldata.GetSrvVSchemaResponse.srv_v_schema:type_name -> vschema.SrvVSchema + 261, // 86: vtctldata.GetSrvVSchemasResponse.srv_v_schemas:type_name -> vtctldata.GetSrvVSchemasResponse.SrvVSchemasEntry + 284, // 87: vtctldata.GetTabletRequest.tablet_alias:type_name -> topodata.TabletAlias + 293, // 88: vtctldata.GetTabletResponse.tablet:type_name -> topodata.Tablet + 284, // 89: vtctldata.GetTabletsRequest.tablet_aliases:type_name -> topodata.TabletAlias + 292, // 90: vtctldata.GetTabletsRequest.tablet_type:type_name -> topodata.TabletType + 293, // 91: vtctldata.GetTabletsResponse.tablets:type_name -> topodata.Tablet 105, // 92: vtctldata.GetTopologyPathResponse.cell:type_name -> vtctldata.TopologyCell - 278, // 93: vtctldata.GetVersionRequest.tablet_alias:type_name -> topodata.TabletAlias - 285, // 94: vtctldata.GetVSchemaResponse.v_schema:type_name -> vschema.Keyspace + 284, // 93: vtctldata.GetVersionRequest.tablet_alias:type_name -> topodata.TabletAlias + 291, // 94: vtctldata.GetVSchemaResponse.v_schema:type_name -> vschema.Keyspace 11, // 95: vtctldata.GetWorkflowsResponse.workflows:type_name -> vtctldata.Workflow - 278, // 96: vtctldata.InitShardPrimaryRequest.primary_elect_tablet_alias:type_name -> topodata.TabletAlias - 279, // 97: vtctldata.InitShardPrimaryRequest.wait_replicas_timeout:type_name -> vttime.Duration - 274, // 98: vtctldata.InitShardPrimaryResponse.events:type_name -> logutil.Event - 256, // 99: vtctldata.LaunchSchemaMigrationResponse.rows_affected_by_shard:type_name -> vtctldata.LaunchSchemaMigrationResponse.RowsAffectedByShardEntry - 285, // 100: vtctldata.LookupVindexCreateRequest.vindex:type_name -> vschema.Keyspace - 286, // 101: vtctldata.LookupVindexCreateRequest.tablet_types:type_name -> topodata.TabletType - 275, // 102: vtctldata.LookupVindexCreateRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference + 284, // 96: vtctldata.InitShardPrimaryRequest.primary_elect_tablet_alias:type_name -> topodata.TabletAlias + 285, // 97: vtctldata.InitShardPrimaryRequest.wait_replicas_timeout:type_name -> vttime.Duration + 280, // 98: vtctldata.InitShardPrimaryResponse.events:type_name -> logutil.Event + 262, // 99: vtctldata.LaunchSchemaMigrationResponse.rows_affected_by_shard:type_name -> vtctldata.LaunchSchemaMigrationResponse.RowsAffectedByShardEntry + 291, // 100: vtctldata.LookupVindexCreateRequest.vindex:type_name -> vschema.Keyspace + 292, // 101: vtctldata.LookupVindexCreateRequest.tablet_types:type_name -> topodata.TabletType + 281, // 102: vtctldata.LookupVindexCreateRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference 7, // 103: vtctldata.MaterializeCreateRequest.settings:type_name -> vtctldata.MaterializeSettings - 286, // 104: vtctldata.MigrateCreateRequest.tablet_types:type_name -> topodata.TabletType - 275, // 105: vtctldata.MigrateCreateRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 286, // 106: vtctldata.MoveTablesCreateRequest.tablet_types:type_name -> topodata.TabletType - 275, // 107: vtctldata.MoveTablesCreateRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 257, // 108: vtctldata.MoveTablesCreateResponse.details:type_name -> vtctldata.MoveTablesCreateResponse.TabletInfo - 278, // 109: vtctldata.PingTabletRequest.tablet_alias:type_name -> topodata.TabletAlias - 278, // 110: vtctldata.PlannedReparentShardRequest.new_primary:type_name -> topodata.TabletAlias - 278, // 111: vtctldata.PlannedReparentShardRequest.avoid_primary:type_name -> topodata.TabletAlias - 279, // 112: vtctldata.PlannedReparentShardRequest.wait_replicas_timeout:type_name -> vttime.Duration - 279, // 113: vtctldata.PlannedReparentShardRequest.tolerable_replication_lag:type_name -> vttime.Duration - 278, // 114: vtctldata.PlannedReparentShardResponse.promoted_primary:type_name -> topodata.TabletAlias - 274, // 115: vtctldata.PlannedReparentShardResponse.events:type_name -> logutil.Event - 278, // 116: vtctldata.RefreshStateRequest.tablet_alias:type_name -> topodata.TabletAlias - 278, // 117: vtctldata.ReloadSchemaRequest.tablet_alias:type_name -> topodata.TabletAlias - 274, // 118: vtctldata.ReloadSchemaKeyspaceResponse.events:type_name -> logutil.Event - 274, // 119: vtctldata.ReloadSchemaShardResponse.events:type_name -> logutil.Event - 278, // 120: vtctldata.ReparentTabletRequest.tablet:type_name -> topodata.TabletAlias - 278, // 121: vtctldata.ReparentTabletResponse.primary:type_name -> topodata.TabletAlias - 286, // 122: vtctldata.ReshardCreateRequest.tablet_types:type_name -> topodata.TabletType - 275, // 123: vtctldata.ReshardCreateRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 278, // 124: vtctldata.RestoreFromBackupRequest.tablet_alias:type_name -> topodata.TabletAlias - 277, // 125: vtctldata.RestoreFromBackupRequest.backup_time:type_name -> vttime.Time - 277, // 126: vtctldata.RestoreFromBackupRequest.restore_to_timestamp:type_name -> vttime.Time - 278, // 127: vtctldata.RestoreFromBackupResponse.tablet_alias:type_name -> topodata.TabletAlias - 274, // 128: vtctldata.RestoreFromBackupResponse.event:type_name -> logutil.Event - 258, // 129: vtctldata.RetrySchemaMigrationResponse.rows_affected_by_shard:type_name -> vtctldata.RetrySchemaMigrationResponse.RowsAffectedByShardEntry - 278, // 130: vtctldata.RunHealthCheckRequest.tablet_alias:type_name -> topodata.TabletAlias - 276, // 131: vtctldata.SetKeyspaceDurabilityPolicyResponse.keyspace:type_name -> topodata.Keyspace - 276, // 132: vtctldata.SetKeyspaceShardingInfoResponse.keyspace:type_name -> topodata.Keyspace - 280, // 133: vtctldata.SetShardIsPrimaryServingResponse.shard:type_name -> topodata.Shard - 286, // 134: vtctldata.SetShardTabletControlRequest.tablet_type:type_name -> topodata.TabletType - 280, // 135: vtctldata.SetShardTabletControlResponse.shard:type_name -> topodata.Shard - 278, // 136: vtctldata.SetWritableRequest.tablet_alias:type_name -> topodata.TabletAlias - 278, // 137: vtctldata.ShardReplicationAddRequest.tablet_alias:type_name -> topodata.TabletAlias - 298, // 138: vtctldata.ShardReplicationFixResponse.error:type_name -> topodata.ShardReplicationError - 259, // 139: vtctldata.ShardReplicationPositionsResponse.replication_statuses:type_name -> vtctldata.ShardReplicationPositionsResponse.ReplicationStatusesEntry - 260, // 140: vtctldata.ShardReplicationPositionsResponse.tablet_map:type_name -> vtctldata.ShardReplicationPositionsResponse.TabletMapEntry - 278, // 141: vtctldata.ShardReplicationRemoveRequest.tablet_alias:type_name -> topodata.TabletAlias - 278, // 142: vtctldata.SleepTabletRequest.tablet_alias:type_name -> topodata.TabletAlias - 279, // 143: vtctldata.SleepTabletRequest.duration:type_name -> vttime.Duration - 299, // 144: vtctldata.SourceShardAddRequest.key_range:type_name -> topodata.KeyRange - 280, // 145: vtctldata.SourceShardAddResponse.shard:type_name -> topodata.Shard - 280, // 146: vtctldata.SourceShardDeleteResponse.shard:type_name -> topodata.Shard - 278, // 147: vtctldata.StartReplicationRequest.tablet_alias:type_name -> topodata.TabletAlias - 278, // 148: vtctldata.StopReplicationRequest.tablet_alias:type_name -> topodata.TabletAlias - 278, // 149: vtctldata.TabletExternallyReparentedRequest.tablet:type_name -> topodata.TabletAlias - 278, // 150: vtctldata.TabletExternallyReparentedResponse.new_primary:type_name -> topodata.TabletAlias - 278, // 151: vtctldata.TabletExternallyReparentedResponse.old_primary:type_name -> topodata.TabletAlias - 281, // 152: vtctldata.UpdateCellInfoRequest.cell_info:type_name -> topodata.CellInfo - 281, // 153: vtctldata.UpdateCellInfoResponse.cell_info:type_name -> topodata.CellInfo - 300, // 154: vtctldata.UpdateCellsAliasRequest.cells_alias:type_name -> topodata.CellsAlias - 300, // 155: vtctldata.UpdateCellsAliasResponse.cells_alias:type_name -> topodata.CellsAlias - 261, // 156: vtctldata.ValidateResponse.results_by_keyspace:type_name -> vtctldata.ValidateResponse.ResultsByKeyspaceEntry - 262, // 157: vtctldata.ValidateKeyspaceResponse.results_by_shard:type_name -> vtctldata.ValidateKeyspaceResponse.ResultsByShardEntry - 263, // 158: vtctldata.ValidateSchemaKeyspaceResponse.results_by_shard:type_name -> vtctldata.ValidateSchemaKeyspaceResponse.ResultsByShardEntry - 264, // 159: vtctldata.ValidateVersionKeyspaceResponse.results_by_shard:type_name -> vtctldata.ValidateVersionKeyspaceResponse.ResultsByShardEntry - 265, // 160: vtctldata.ValidateVSchemaResponse.results_by_shard:type_name -> vtctldata.ValidateVSchemaResponse.ResultsByShardEntry - 286, // 161: vtctldata.VDiffCreateRequest.tablet_types:type_name -> topodata.TabletType - 275, // 162: vtctldata.VDiffCreateRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 279, // 163: vtctldata.VDiffCreateRequest.filtered_replication_wait_time:type_name -> vttime.Duration - 279, // 164: vtctldata.VDiffCreateRequest.wait_update_interval:type_name -> vttime.Duration - 279, // 165: vtctldata.VDiffCreateRequest.max_diff_duration:type_name -> vttime.Duration - 266, // 166: vtctldata.VDiffShowResponse.tablet_responses:type_name -> vtctldata.VDiffShowResponse.TabletResponsesEntry - 267, // 167: vtctldata.WorkflowDeleteResponse.details:type_name -> vtctldata.WorkflowDeleteResponse.TabletInfo - 271, // 168: vtctldata.WorkflowStatusResponse.table_copy_state:type_name -> vtctldata.WorkflowStatusResponse.TableCopyStateEntry - 272, // 169: vtctldata.WorkflowStatusResponse.shard_streams:type_name -> vtctldata.WorkflowStatusResponse.ShardStreamsEntry - 286, // 170: vtctldata.WorkflowSwitchTrafficRequest.tablet_types:type_name -> topodata.TabletType - 279, // 171: vtctldata.WorkflowSwitchTrafficRequest.max_replication_lag_allowed:type_name -> vttime.Duration - 279, // 172: vtctldata.WorkflowSwitchTrafficRequest.timeout:type_name -> vttime.Duration - 301, // 173: vtctldata.WorkflowUpdateRequest.tablet_request:type_name -> tabletmanagerdata.UpdateVReplicationWorkflowRequest - 273, // 174: vtctldata.WorkflowUpdateResponse.details:type_name -> vtctldata.WorkflowUpdateResponse.TabletInfo - 238, // 175: vtctldata.Workflow.ShardStreamsEntry.value:type_name -> vtctldata.Workflow.ShardStream - 239, // 176: vtctldata.Workflow.ShardStream.streams:type_name -> vtctldata.Workflow.Stream - 302, // 177: vtctldata.Workflow.ShardStream.tablet_controls:type_name -> topodata.Shard.TabletControl - 278, // 178: vtctldata.Workflow.Stream.tablet:type_name -> topodata.TabletAlias - 303, // 179: vtctldata.Workflow.Stream.binlog_source:type_name -> binlogdata.BinlogSource - 277, // 180: vtctldata.Workflow.Stream.transaction_timestamp:type_name -> vttime.Time - 277, // 181: vtctldata.Workflow.Stream.time_updated:type_name -> vttime.Time - 240, // 182: vtctldata.Workflow.Stream.copy_states:type_name -> vtctldata.Workflow.Stream.CopyState - 241, // 183: vtctldata.Workflow.Stream.logs:type_name -> vtctldata.Workflow.Stream.Log - 242, // 184: vtctldata.Workflow.Stream.throttler_status:type_name -> vtctldata.Workflow.Stream.ThrottlerStatus - 286, // 185: vtctldata.Workflow.Stream.tablet_types:type_name -> topodata.TabletType - 275, // 186: vtctldata.Workflow.Stream.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 277, // 187: vtctldata.Workflow.Stream.Log.created_at:type_name -> vttime.Time - 277, // 188: vtctldata.Workflow.Stream.Log.updated_at:type_name -> vttime.Time - 277, // 189: vtctldata.Workflow.Stream.ThrottlerStatus.time_throttled:type_name -> vttime.Time - 245, // 190: vtctldata.ApplyVSchemaResponse.UnknownVindexParamsEntry.value:type_name -> vtctldata.ApplyVSchemaResponse.ParamList - 10, // 191: vtctldata.FindAllShardsInKeyspaceResponse.ShardsEntry.value:type_name -> vtctldata.Shard - 300, // 192: vtctldata.GetCellsAliasesResponse.AliasesEntry.value:type_name -> topodata.CellsAlias - 253, // 193: vtctldata.GetSrvKeyspaceNamesResponse.NamesEntry.value:type_name -> vtctldata.GetSrvKeyspaceNamesResponse.NameList - 304, // 194: vtctldata.GetSrvKeyspacesResponse.SrvKeyspacesEntry.value:type_name -> topodata.SrvKeyspace - 297, // 195: vtctldata.GetSrvVSchemasResponse.SrvVSchemasEntry.value:type_name -> vschema.SrvVSchema - 278, // 196: vtctldata.MoveTablesCreateResponse.TabletInfo.tablet:type_name -> topodata.TabletAlias - 305, // 197: vtctldata.ShardReplicationPositionsResponse.ReplicationStatusesEntry.value:type_name -> replicationdata.Status - 287, // 198: vtctldata.ShardReplicationPositionsResponse.TabletMapEntry.value:type_name -> topodata.Tablet - 207, // 199: vtctldata.ValidateResponse.ResultsByKeyspaceEntry.value:type_name -> vtctldata.ValidateKeyspaceResponse - 211, // 200: vtctldata.ValidateKeyspaceResponse.ResultsByShardEntry.value:type_name -> vtctldata.ValidateShardResponse - 211, // 201: vtctldata.ValidateSchemaKeyspaceResponse.ResultsByShardEntry.value:type_name -> vtctldata.ValidateShardResponse - 211, // 202: vtctldata.ValidateVersionKeyspaceResponse.ResultsByShardEntry.value:type_name -> vtctldata.ValidateShardResponse - 211, // 203: vtctldata.ValidateVSchemaResponse.ResultsByShardEntry.value:type_name -> vtctldata.ValidateShardResponse - 306, // 204: vtctldata.VDiffShowResponse.TabletResponsesEntry.value:type_name -> tabletmanagerdata.VDiffResponse - 278, // 205: vtctldata.WorkflowDeleteResponse.TabletInfo.tablet:type_name -> topodata.TabletAlias - 278, // 206: vtctldata.WorkflowStatusResponse.ShardStreamState.tablet:type_name -> topodata.TabletAlias - 269, // 207: vtctldata.WorkflowStatusResponse.ShardStreams.streams:type_name -> vtctldata.WorkflowStatusResponse.ShardStreamState - 268, // 208: vtctldata.WorkflowStatusResponse.TableCopyStateEntry.value:type_name -> vtctldata.WorkflowStatusResponse.TableCopyState - 270, // 209: vtctldata.WorkflowStatusResponse.ShardStreamsEntry.value:type_name -> vtctldata.WorkflowStatusResponse.ShardStreams - 278, // 210: vtctldata.WorkflowUpdateResponse.TabletInfo.tablet:type_name -> topodata.TabletAlias - 211, // [211:211] is the sub-list for method output_type - 211, // [211:211] is the sub-list for method input_type - 211, // [211:211] is the sub-list for extension type_name - 211, // [211:211] is the sub-list for extension extendee - 0, // [0:211] is the sub-list for field type_name + 292, // 104: vtctldata.MigrateCreateRequest.tablet_types:type_name -> topodata.TabletType + 281, // 105: vtctldata.MigrateCreateRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference + 292, // 106: vtctldata.MoveTablesCreateRequest.tablet_types:type_name -> topodata.TabletType + 281, // 107: vtctldata.MoveTablesCreateRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference + 263, // 108: vtctldata.MoveTablesCreateResponse.details:type_name -> vtctldata.MoveTablesCreateResponse.TabletInfo + 284, // 109: vtctldata.PingTabletRequest.tablet_alias:type_name -> topodata.TabletAlias + 284, // 110: vtctldata.PlannedReparentShardRequest.new_primary:type_name -> topodata.TabletAlias + 284, // 111: vtctldata.PlannedReparentShardRequest.avoid_primary:type_name -> topodata.TabletAlias + 285, // 112: vtctldata.PlannedReparentShardRequest.wait_replicas_timeout:type_name -> vttime.Duration + 285, // 113: vtctldata.PlannedReparentShardRequest.tolerable_replication_lag:type_name -> vttime.Duration + 284, // 114: vtctldata.PlannedReparentShardResponse.promoted_primary:type_name -> topodata.TabletAlias + 280, // 115: vtctldata.PlannedReparentShardResponse.events:type_name -> logutil.Event + 284, // 116: vtctldata.RefreshStateRequest.tablet_alias:type_name -> topodata.TabletAlias + 284, // 117: vtctldata.ReloadSchemaRequest.tablet_alias:type_name -> topodata.TabletAlias + 280, // 118: vtctldata.ReloadSchemaKeyspaceResponse.events:type_name -> logutil.Event + 280, // 119: vtctldata.ReloadSchemaShardResponse.events:type_name -> logutil.Event + 284, // 120: vtctldata.ReparentTabletRequest.tablet:type_name -> topodata.TabletAlias + 284, // 121: vtctldata.ReparentTabletResponse.primary:type_name -> topodata.TabletAlias + 292, // 122: vtctldata.ReshardCreateRequest.tablet_types:type_name -> topodata.TabletType + 281, // 123: vtctldata.ReshardCreateRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference + 284, // 124: vtctldata.RestoreFromBackupRequest.tablet_alias:type_name -> topodata.TabletAlias + 283, // 125: vtctldata.RestoreFromBackupRequest.backup_time:type_name -> vttime.Time + 283, // 126: vtctldata.RestoreFromBackupRequest.restore_to_timestamp:type_name -> vttime.Time + 284, // 127: vtctldata.RestoreFromBackupResponse.tablet_alias:type_name -> topodata.TabletAlias + 280, // 128: vtctldata.RestoreFromBackupResponse.event:type_name -> logutil.Event + 264, // 129: vtctldata.RetrySchemaMigrationResponse.rows_affected_by_shard:type_name -> vtctldata.RetrySchemaMigrationResponse.RowsAffectedByShardEntry + 284, // 130: vtctldata.RunHealthCheckRequest.tablet_alias:type_name -> topodata.TabletAlias + 282, // 131: vtctldata.SetKeyspaceDurabilityPolicyResponse.keyspace:type_name -> topodata.Keyspace + 282, // 132: vtctldata.SetKeyspaceShardingInfoResponse.keyspace:type_name -> topodata.Keyspace + 286, // 133: vtctldata.SetShardIsPrimaryServingResponse.shard:type_name -> topodata.Shard + 292, // 134: vtctldata.SetShardTabletControlRequest.tablet_type:type_name -> topodata.TabletType + 286, // 135: vtctldata.SetShardTabletControlResponse.shard:type_name -> topodata.Shard + 284, // 136: vtctldata.SetWritableRequest.tablet_alias:type_name -> topodata.TabletAlias + 284, // 137: vtctldata.ShardReplicationAddRequest.tablet_alias:type_name -> topodata.TabletAlias + 304, // 138: vtctldata.ShardReplicationFixResponse.error:type_name -> topodata.ShardReplicationError + 265, // 139: vtctldata.ShardReplicationPositionsResponse.replication_statuses:type_name -> vtctldata.ShardReplicationPositionsResponse.ReplicationStatusesEntry + 266, // 140: vtctldata.ShardReplicationPositionsResponse.tablet_map:type_name -> vtctldata.ShardReplicationPositionsResponse.TabletMapEntry + 284, // 141: vtctldata.ShardReplicationRemoveRequest.tablet_alias:type_name -> topodata.TabletAlias + 284, // 142: vtctldata.SleepTabletRequest.tablet_alias:type_name -> topodata.TabletAlias + 285, // 143: vtctldata.SleepTabletRequest.duration:type_name -> vttime.Duration + 305, // 144: vtctldata.SourceShardAddRequest.key_range:type_name -> topodata.KeyRange + 286, // 145: vtctldata.SourceShardAddResponse.shard:type_name -> topodata.Shard + 286, // 146: vtctldata.SourceShardDeleteResponse.shard:type_name -> topodata.Shard + 284, // 147: vtctldata.StartReplicationRequest.tablet_alias:type_name -> topodata.TabletAlias + 284, // 148: vtctldata.StopReplicationRequest.tablet_alias:type_name -> topodata.TabletAlias + 284, // 149: vtctldata.TabletExternallyReparentedRequest.tablet:type_name -> topodata.TabletAlias + 284, // 150: vtctldata.TabletExternallyReparentedResponse.new_primary:type_name -> topodata.TabletAlias + 284, // 151: vtctldata.TabletExternallyReparentedResponse.old_primary:type_name -> topodata.TabletAlias + 287, // 152: vtctldata.UpdateCellInfoRequest.cell_info:type_name -> topodata.CellInfo + 287, // 153: vtctldata.UpdateCellInfoResponse.cell_info:type_name -> topodata.CellInfo + 306, // 154: vtctldata.UpdateCellsAliasRequest.cells_alias:type_name -> topodata.CellsAlias + 306, // 155: vtctldata.UpdateCellsAliasResponse.cells_alias:type_name -> topodata.CellsAlias + 267, // 156: vtctldata.ValidateResponse.results_by_keyspace:type_name -> vtctldata.ValidateResponse.ResultsByKeyspaceEntry + 268, // 157: vtctldata.ValidateKeyspaceResponse.results_by_shard:type_name -> vtctldata.ValidateKeyspaceResponse.ResultsByShardEntry + 269, // 158: vtctldata.ValidateSchemaKeyspaceResponse.results_by_shard:type_name -> vtctldata.ValidateSchemaKeyspaceResponse.ResultsByShardEntry + 270, // 159: vtctldata.ValidateVersionKeyspaceResponse.results_by_shard:type_name -> vtctldata.ValidateVersionKeyspaceResponse.ResultsByShardEntry + 271, // 160: vtctldata.ValidateVSchemaResponse.results_by_shard:type_name -> vtctldata.ValidateVSchemaResponse.ResultsByShardEntry + 292, // 161: vtctldata.VDiffCreateRequest.tablet_types:type_name -> topodata.TabletType + 281, // 162: vtctldata.VDiffCreateRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference + 285, // 163: vtctldata.VDiffCreateRequest.filtered_replication_wait_time:type_name -> vttime.Duration + 285, // 164: vtctldata.VDiffCreateRequest.wait_update_interval:type_name -> vttime.Duration + 285, // 165: vtctldata.VDiffCreateRequest.max_diff_duration:type_name -> vttime.Duration + 272, // 166: vtctldata.VDiffShowResponse.tablet_responses:type_name -> vtctldata.VDiffShowResponse.TabletResponsesEntry + 273, // 167: vtctldata.WorkflowDeleteResponse.details:type_name -> vtctldata.WorkflowDeleteResponse.TabletInfo + 277, // 168: vtctldata.WorkflowStatusResponse.table_copy_state:type_name -> vtctldata.WorkflowStatusResponse.TableCopyStateEntry + 278, // 169: vtctldata.WorkflowStatusResponse.shard_streams:type_name -> vtctldata.WorkflowStatusResponse.ShardStreamsEntry + 292, // 170: vtctldata.WorkflowSwitchTrafficRequest.tablet_types:type_name -> topodata.TabletType + 285, // 171: vtctldata.WorkflowSwitchTrafficRequest.max_replication_lag_allowed:type_name -> vttime.Duration + 285, // 172: vtctldata.WorkflowSwitchTrafficRequest.timeout:type_name -> vttime.Duration + 307, // 173: vtctldata.WorkflowUpdateRequest.tablet_request:type_name -> tabletmanagerdata.UpdateVReplicationWorkflowRequest + 279, // 174: vtctldata.WorkflowUpdateResponse.details:type_name -> vtctldata.WorkflowUpdateResponse.TabletInfo + 308, // 175: vtctldata.ApplyMirrorRulesRequest.mirror_rules:type_name -> vschema.MirrorRules + 308, // 176: vtctldata.GetMirrorRulesResponse.mirror_rules:type_name -> vschema.MirrorRules + 244, // 177: vtctldata.Workflow.ShardStreamsEntry.value:type_name -> vtctldata.Workflow.ShardStream + 245, // 178: vtctldata.Workflow.ShardStream.streams:type_name -> vtctldata.Workflow.Stream + 309, // 179: vtctldata.Workflow.ShardStream.tablet_controls:type_name -> topodata.Shard.TabletControl + 284, // 180: vtctldata.Workflow.Stream.tablet:type_name -> topodata.TabletAlias + 310, // 181: vtctldata.Workflow.Stream.binlog_source:type_name -> binlogdata.BinlogSource + 283, // 182: vtctldata.Workflow.Stream.transaction_timestamp:type_name -> vttime.Time + 283, // 183: vtctldata.Workflow.Stream.time_updated:type_name -> vttime.Time + 246, // 184: vtctldata.Workflow.Stream.copy_states:type_name -> vtctldata.Workflow.Stream.CopyState + 247, // 185: vtctldata.Workflow.Stream.logs:type_name -> vtctldata.Workflow.Stream.Log + 248, // 186: vtctldata.Workflow.Stream.throttler_status:type_name -> vtctldata.Workflow.Stream.ThrottlerStatus + 292, // 187: vtctldata.Workflow.Stream.tablet_types:type_name -> topodata.TabletType + 281, // 188: vtctldata.Workflow.Stream.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference + 283, // 189: vtctldata.Workflow.Stream.Log.created_at:type_name -> vttime.Time + 283, // 190: vtctldata.Workflow.Stream.Log.updated_at:type_name -> vttime.Time + 283, // 191: vtctldata.Workflow.Stream.ThrottlerStatus.time_throttled:type_name -> vttime.Time + 251, // 192: vtctldata.ApplyVSchemaResponse.UnknownVindexParamsEntry.value:type_name -> vtctldata.ApplyVSchemaResponse.ParamList + 10, // 193: vtctldata.FindAllShardsInKeyspaceResponse.ShardsEntry.value:type_name -> vtctldata.Shard + 306, // 194: vtctldata.GetCellsAliasesResponse.AliasesEntry.value:type_name -> topodata.CellsAlias + 259, // 195: vtctldata.GetSrvKeyspaceNamesResponse.NamesEntry.value:type_name -> vtctldata.GetSrvKeyspaceNamesResponse.NameList + 311, // 196: vtctldata.GetSrvKeyspacesResponse.SrvKeyspacesEntry.value:type_name -> topodata.SrvKeyspace + 303, // 197: vtctldata.GetSrvVSchemasResponse.SrvVSchemasEntry.value:type_name -> vschema.SrvVSchema + 284, // 198: vtctldata.MoveTablesCreateResponse.TabletInfo.tablet:type_name -> topodata.TabletAlias + 312, // 199: vtctldata.ShardReplicationPositionsResponse.ReplicationStatusesEntry.value:type_name -> replicationdata.Status + 293, // 200: vtctldata.ShardReplicationPositionsResponse.TabletMapEntry.value:type_name -> topodata.Tablet + 207, // 201: vtctldata.ValidateResponse.ResultsByKeyspaceEntry.value:type_name -> vtctldata.ValidateKeyspaceResponse + 211, // 202: vtctldata.ValidateKeyspaceResponse.ResultsByShardEntry.value:type_name -> vtctldata.ValidateShardResponse + 211, // 203: vtctldata.ValidateSchemaKeyspaceResponse.ResultsByShardEntry.value:type_name -> vtctldata.ValidateShardResponse + 211, // 204: vtctldata.ValidateVersionKeyspaceResponse.ResultsByShardEntry.value:type_name -> vtctldata.ValidateShardResponse + 211, // 205: vtctldata.ValidateVSchemaResponse.ResultsByShardEntry.value:type_name -> vtctldata.ValidateShardResponse + 313, // 206: vtctldata.VDiffShowResponse.TabletResponsesEntry.value:type_name -> tabletmanagerdata.VDiffResponse + 284, // 207: vtctldata.WorkflowDeleteResponse.TabletInfo.tablet:type_name -> topodata.TabletAlias + 284, // 208: vtctldata.WorkflowStatusResponse.ShardStreamState.tablet:type_name -> topodata.TabletAlias + 275, // 209: vtctldata.WorkflowStatusResponse.ShardStreams.streams:type_name -> vtctldata.WorkflowStatusResponse.ShardStreamState + 274, // 210: vtctldata.WorkflowStatusResponse.TableCopyStateEntry.value:type_name -> vtctldata.WorkflowStatusResponse.TableCopyState + 276, // 211: vtctldata.WorkflowStatusResponse.ShardStreamsEntry.value:type_name -> vtctldata.WorkflowStatusResponse.ShardStreams + 284, // 212: vtctldata.WorkflowUpdateResponse.TabletInfo.tablet:type_name -> topodata.TabletAlias + 213, // [213:213] is the sub-list for method output_type + 213, // [213:213] is the sub-list for method input_type + 213, // [213:213] is the sub-list for extension type_name + 213, // [213:213] is the sub-list for extension extendee + 0, // [0:213] is the sub-list for field type_name } func init() { file_vtctldata_proto_init() } @@ -21180,8 +21540,20 @@ func file_vtctldata_proto_init() { return nil } } + file_vtctldata_proto_msgTypes[232].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApplyMirrorRulesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } file_vtctldata_proto_msgTypes[233].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Workflow_ReplicationLocation); i { + switch v := v.(*ApplyMirrorRulesResponse); i { case 0: return &v.state case 1: @@ -21193,7 +21565,7 @@ func file_vtctldata_proto_init() { } } file_vtctldata_proto_msgTypes[234].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Workflow_ShardStream); i { + switch v := v.(*GetMirrorRulesRequest); i { case 0: return &v.state case 1: @@ -21205,7 +21577,7 @@ func file_vtctldata_proto_init() { } } file_vtctldata_proto_msgTypes[235].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Workflow_Stream); i { + switch v := v.(*GetMirrorRulesResponse); i { case 0: return &v.state case 1: @@ -21217,7 +21589,7 @@ func file_vtctldata_proto_init() { } } file_vtctldata_proto_msgTypes[236].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Workflow_Stream_CopyState); i { + switch v := v.(*WorkflowMirrorTrafficRequest); i { case 0: return &v.state case 1: @@ -21229,6 +21601,66 @@ func file_vtctldata_proto_init() { } } file_vtctldata_proto_msgTypes[237].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WorkflowMirrorTrafficResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_vtctldata_proto_msgTypes[239].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Workflow_ReplicationLocation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_vtctldata_proto_msgTypes[240].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Workflow_ShardStream); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_vtctldata_proto_msgTypes[241].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Workflow_Stream); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_vtctldata_proto_msgTypes[242].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Workflow_Stream_CopyState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_vtctldata_proto_msgTypes[243].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Workflow_Stream_Log); i { case 0: return &v.state @@ -21240,7 +21672,7 @@ func file_vtctldata_proto_init() { return nil } } - file_vtctldata_proto_msgTypes[238].Exporter = func(v interface{}, i int) interface{} { + file_vtctldata_proto_msgTypes[244].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Workflow_Stream_ThrottlerStatus); i { case 0: return &v.state @@ -21252,7 +21684,7 @@ func file_vtctldata_proto_init() { return nil } } - file_vtctldata_proto_msgTypes[241].Exporter = func(v interface{}, i int) interface{} { + file_vtctldata_proto_msgTypes[247].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ApplyVSchemaResponse_ParamList); i { case 0: return &v.state @@ -21264,7 +21696,7 @@ func file_vtctldata_proto_init() { return nil } } - file_vtctldata_proto_msgTypes[249].Exporter = func(v interface{}, i int) interface{} { + file_vtctldata_proto_msgTypes[255].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetSrvKeyspaceNamesResponse_NameList); i { case 0: return &v.state @@ -21276,7 +21708,7 @@ func file_vtctldata_proto_init() { return nil } } - file_vtctldata_proto_msgTypes[253].Exporter = func(v interface{}, i int) interface{} { + file_vtctldata_proto_msgTypes[259].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MoveTablesCreateResponse_TabletInfo); i { case 0: return &v.state @@ -21288,7 +21720,7 @@ func file_vtctldata_proto_init() { return nil } } - file_vtctldata_proto_msgTypes[263].Exporter = func(v interface{}, i int) interface{} { + file_vtctldata_proto_msgTypes[269].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WorkflowDeleteResponse_TabletInfo); i { case 0: return &v.state @@ -21300,7 +21732,7 @@ func file_vtctldata_proto_init() { return nil } } - file_vtctldata_proto_msgTypes[264].Exporter = func(v interface{}, i int) interface{} { + file_vtctldata_proto_msgTypes[270].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WorkflowStatusResponse_TableCopyState); i { case 0: return &v.state @@ -21312,7 +21744,7 @@ func file_vtctldata_proto_init() { return nil } } - file_vtctldata_proto_msgTypes[265].Exporter = func(v interface{}, i int) interface{} { + file_vtctldata_proto_msgTypes[271].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WorkflowStatusResponse_ShardStreamState); i { case 0: return &v.state @@ -21324,7 +21756,7 @@ func file_vtctldata_proto_init() { return nil } } - file_vtctldata_proto_msgTypes[266].Exporter = func(v interface{}, i int) interface{} { + file_vtctldata_proto_msgTypes[272].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WorkflowStatusResponse_ShardStreams); i { case 0: return &v.state @@ -21336,7 +21768,7 @@ func file_vtctldata_proto_init() { return nil } } - file_vtctldata_proto_msgTypes[269].Exporter = func(v interface{}, i int) interface{} { + file_vtctldata_proto_msgTypes[275].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WorkflowUpdateResponse_TabletInfo); i { case 0: return &v.state @@ -21355,7 +21787,7 @@ func file_vtctldata_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_vtctldata_proto_rawDesc, NumEnums: 4, - NumMessages: 270, + NumMessages: 276, NumExtensions: 0, NumServices: 0, }, diff --git a/go/vt/proto/vtctldata/vtctldata_vtproto.pb.go b/go/vt/proto/vtctldata/vtctldata_vtproto.pb.go index d62ee7c9cdb..249528575f0 100644 --- a/go/vt/proto/vtctldata/vtctldata_vtproto.pb.go +++ b/go/vt/proto/vtctldata/vtctldata_vtproto.pb.go @@ -5365,6 +5365,120 @@ func (m *WorkflowUpdateResponse) CloneMessageVT() proto.Message { return m.CloneVT() } +func (m *ApplyMirrorRulesRequest) CloneVT() *ApplyMirrorRulesRequest { + if m == nil { + return (*ApplyMirrorRulesRequest)(nil) + } + r := &ApplyMirrorRulesRequest{ + MirrorRules: m.MirrorRules.CloneVT(), + SkipRebuild: m.SkipRebuild, + } + if rhs := m.RebuildCells; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.RebuildCells = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ApplyMirrorRulesRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ApplyMirrorRulesResponse) CloneVT() *ApplyMirrorRulesResponse { + if m == nil { + return (*ApplyMirrorRulesResponse)(nil) + } + r := &ApplyMirrorRulesResponse{} + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ApplyMirrorRulesResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *GetMirrorRulesRequest) CloneVT() *GetMirrorRulesRequest { + if m == nil { + return (*GetMirrorRulesRequest)(nil) + } + r := &GetMirrorRulesRequest{} + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *GetMirrorRulesRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *GetMirrorRulesResponse) CloneVT() *GetMirrorRulesResponse { + if m == nil { + return (*GetMirrorRulesResponse)(nil) + } + r := &GetMirrorRulesResponse{ + MirrorRules: m.MirrorRules.CloneVT(), + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *GetMirrorRulesResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *WorkflowMirrorTrafficRequest) CloneVT() *WorkflowMirrorTrafficRequest { + if m == nil { + return (*WorkflowMirrorTrafficRequest)(nil) + } + r := &WorkflowMirrorTrafficRequest{ + Keyspace: m.Keyspace, + Workflow: m.Workflow, + Percent: m.Percent, + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *WorkflowMirrorTrafficRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *WorkflowMirrorTrafficResponse) CloneVT() *WorkflowMirrorTrafficResponse { + if m == nil { + return (*WorkflowMirrorTrafficResponse)(nil) + } + r := &WorkflowMirrorTrafficResponse{ + Summary: m.Summary, + StartState: m.StartState, + CurrentState: m.CurrentState, + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *WorkflowMirrorTrafficResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + func (m *ExecuteVtctlCommandRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -19555,6 +19669,284 @@ func (m *WorkflowUpdateResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error return len(dAtA) - i, nil } +func (m *ApplyMirrorRulesRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ApplyMirrorRulesRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ApplyMirrorRulesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.RebuildCells) > 0 { + for iNdEx := len(m.RebuildCells) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RebuildCells[iNdEx]) + copy(dAtA[i:], m.RebuildCells[iNdEx]) + i = encodeVarint(dAtA, i, uint64(len(m.RebuildCells[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if m.SkipRebuild { + i-- + if m.SkipRebuild { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.MirrorRules != nil { + size, err := m.MirrorRules.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ApplyMirrorRulesResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ApplyMirrorRulesResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ApplyMirrorRulesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + return len(dAtA) - i, nil +} + +func (m *GetMirrorRulesRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetMirrorRulesRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *GetMirrorRulesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + return len(dAtA) - i, nil +} + +func (m *GetMirrorRulesResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetMirrorRulesResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *GetMirrorRulesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.MirrorRules != nil { + size, err := m.MirrorRules.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *WorkflowMirrorTrafficRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkflowMirrorTrafficRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *WorkflowMirrorTrafficRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Percent != 0 { + i -= 4 + binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Percent)))) + i-- + dAtA[i] = 0x1d + } + if len(m.Workflow) > 0 { + i -= len(m.Workflow) + copy(dAtA[i:], m.Workflow) + i = encodeVarint(dAtA, i, uint64(len(m.Workflow))) + i-- + dAtA[i] = 0x12 + } + if len(m.Keyspace) > 0 { + i -= len(m.Keyspace) + copy(dAtA[i:], m.Keyspace) + i = encodeVarint(dAtA, i, uint64(len(m.Keyspace))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *WorkflowMirrorTrafficResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkflowMirrorTrafficResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *WorkflowMirrorTrafficResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.CurrentState) > 0 { + i -= len(m.CurrentState) + copy(dAtA[i:], m.CurrentState) + i = encodeVarint(dAtA, i, uint64(len(m.CurrentState))) + i-- + dAtA[i] = 0x1a + } + if len(m.StartState) > 0 { + i -= len(m.StartState) + copy(dAtA[i:], m.StartState) + i = encodeVarint(dAtA, i, uint64(len(m.StartState))) + i-- + dAtA[i] = 0x12 + } + if len(m.Summary) > 0 { + i -= len(m.Summary) + copy(dAtA[i:], m.Summary) + i = encodeVarint(dAtA, i, uint64(len(m.Summary))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarint(dAtA []byte, offset int, v uint64) int { offset -= sov(v) base := offset @@ -24901,6 +25293,106 @@ func (m *WorkflowUpdateResponse) SizeVT() (n int) { return n } +func (m *ApplyMirrorRulesRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MirrorRules != nil { + l = m.MirrorRules.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.SkipRebuild { + n += 2 + } + if len(m.RebuildCells) > 0 { + for _, s := range m.RebuildCells { + l = len(s) + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *ApplyMirrorRulesResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *GetMirrorRulesRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *GetMirrorRulesResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MirrorRules != nil { + l = m.MirrorRules.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *WorkflowMirrorTrafficRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Keyspace) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Workflow) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.Percent != 0 { + n += 5 + } + n += len(m.unknownFields) + return n +} + +func (m *WorkflowMirrorTrafficResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Summary) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.StartState) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.CurrentState) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + func sov(x uint64) (n int) { return (bits.Len64(x|1) + 6) / 7 } @@ -59686,6 +60178,607 @@ func (m *WorkflowUpdateResponse) UnmarshalVT(dAtA []byte) error { } return nil } +func (m *ApplyMirrorRulesRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ApplyMirrorRulesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ApplyMirrorRulesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MirrorRules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MirrorRules == nil { + m.MirrorRules = &vschema.MirrorRules{} + } + if err := m.MirrorRules.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SkipRebuild", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SkipRebuild = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RebuildCells", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RebuildCells = append(m.RebuildCells, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ApplyMirrorRulesResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ApplyMirrorRulesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ApplyMirrorRulesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetMirrorRulesRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetMirrorRulesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetMirrorRulesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetMirrorRulesResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetMirrorRulesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetMirrorRulesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MirrorRules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MirrorRules == nil { + m.MirrorRules = &vschema.MirrorRules{} + } + if err := m.MirrorRules.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkflowMirrorTrafficRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkflowMirrorTrafficRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkflowMirrorTrafficRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Keyspace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Workflow", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Workflow = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field Percent", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.Percent = float32(math.Float32frombits(v)) + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkflowMirrorTrafficResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkflowMirrorTrafficResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkflowMirrorTrafficResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Summary", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Summary = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartState", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StartState = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentState", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CurrentState = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skip(dAtA []byte) (n int, err error) { l := len(dAtA) diff --git a/go/vt/proto/vtctlservice/vtctlservice.pb.go b/go/vt/proto/vtctlservice/vtctlservice.pb.go index 96b3eeadd26..60ee9f0e098 100644 --- a/go/vt/proto/vtctlservice/vtctlservice.pb.go +++ b/go/vt/proto/vtctlservice/vtctlservice.pb.go @@ -51,7 +51,7 @@ var file_vtctlservice_proto_rawDesc = []byte{ 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x76, 0x74, 0x63, 0x74, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x56, 0x74, 0x63, 0x74, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x32, 0x93, 0x51, 0x0a, 0x06, 0x56, 0x74, 0x63, 0x74, 0x6c, + 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x32, 0xb9, 0x53, 0x0a, 0x06, 0x56, 0x74, 0x63, 0x74, 0x6c, 0x64, 0x12, 0x4e, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x43, 0x65, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x2e, 0x76, 0x74, 0x63, 0x74, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x65, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, @@ -700,11 +700,29 @@ var file_vtctlservice_proto_rawDesc = []byte{ 0x61, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x76, 0x74, 0x63, 0x74, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x2b, 0x5a, 0x29, - 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, - 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x74, 0x63, - 0x74, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x10, + 0x41, 0x70, 0x70, 0x6c, 0x79, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x75, 0x6c, 0x65, 0x73, + 0x12, 0x22, 0x2e, 0x76, 0x74, 0x63, 0x74, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x41, 0x70, 0x70, + 0x6c, 0x79, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x76, 0x74, 0x63, 0x74, 0x6c, 0x64, 0x61, 0x74, 0x61, + 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x75, 0x6c, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x0e, 0x47, + 0x65, 0x74, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x20, 0x2e, + 0x76, 0x74, 0x63, 0x74, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x72, + 0x72, 0x6f, 0x72, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x21, 0x2e, 0x76, 0x74, 0x63, 0x74, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x4d, + 0x69, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x6c, 0x0a, 0x15, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, + 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x12, 0x27, 0x2e, + 0x76, 0x74, 0x63, 0x74, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, + 0x6f, 0x77, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x76, 0x74, 0x63, 0x74, 0x6c, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x4d, 0x69, 0x72, 0x72, 0x6f, + 0x72, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x42, 0x2b, 0x5a, 0x29, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6f, 0x2f, + 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x74, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x76, 0x74, 0x63, 0x74, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_vtctlservice_proto_goTypes = []interface{}{ @@ -820,114 +838,120 @@ var file_vtctlservice_proto_goTypes = []interface{}{ (*vtctldata.WorkflowStatusRequest)(nil), // 109: vtctldata.WorkflowStatusRequest (*vtctldata.WorkflowSwitchTrafficRequest)(nil), // 110: vtctldata.WorkflowSwitchTrafficRequest (*vtctldata.WorkflowUpdateRequest)(nil), // 111: vtctldata.WorkflowUpdateRequest - (*vtctldata.ExecuteVtctlCommandResponse)(nil), // 112: vtctldata.ExecuteVtctlCommandResponse - (*vtctldata.AddCellInfoResponse)(nil), // 113: vtctldata.AddCellInfoResponse - (*vtctldata.AddCellsAliasResponse)(nil), // 114: vtctldata.AddCellsAliasResponse - (*vtctldata.ApplyRoutingRulesResponse)(nil), // 115: vtctldata.ApplyRoutingRulesResponse - (*vtctldata.ApplySchemaResponse)(nil), // 116: vtctldata.ApplySchemaResponse - (*vtctldata.ApplyShardRoutingRulesResponse)(nil), // 117: vtctldata.ApplyShardRoutingRulesResponse - (*vtctldata.ApplyVSchemaResponse)(nil), // 118: vtctldata.ApplyVSchemaResponse - (*vtctldata.BackupResponse)(nil), // 119: vtctldata.BackupResponse - (*vtctldata.CancelSchemaMigrationResponse)(nil), // 120: vtctldata.CancelSchemaMigrationResponse - (*vtctldata.ChangeTabletTypeResponse)(nil), // 121: vtctldata.ChangeTabletTypeResponse - (*vtctldata.CleanupSchemaMigrationResponse)(nil), // 122: vtctldata.CleanupSchemaMigrationResponse - (*vtctldata.CompleteSchemaMigrationResponse)(nil), // 123: vtctldata.CompleteSchemaMigrationResponse - (*vtctldata.CreateKeyspaceResponse)(nil), // 124: vtctldata.CreateKeyspaceResponse - (*vtctldata.CreateShardResponse)(nil), // 125: vtctldata.CreateShardResponse - (*vtctldata.DeleteCellInfoResponse)(nil), // 126: vtctldata.DeleteCellInfoResponse - (*vtctldata.DeleteCellsAliasResponse)(nil), // 127: vtctldata.DeleteCellsAliasResponse - (*vtctldata.DeleteKeyspaceResponse)(nil), // 128: vtctldata.DeleteKeyspaceResponse - (*vtctldata.DeleteShardsResponse)(nil), // 129: vtctldata.DeleteShardsResponse - (*vtctldata.DeleteSrvVSchemaResponse)(nil), // 130: vtctldata.DeleteSrvVSchemaResponse - (*vtctldata.DeleteTabletsResponse)(nil), // 131: vtctldata.DeleteTabletsResponse - (*vtctldata.EmergencyReparentShardResponse)(nil), // 132: vtctldata.EmergencyReparentShardResponse - (*vtctldata.ExecuteFetchAsAppResponse)(nil), // 133: vtctldata.ExecuteFetchAsAppResponse - (*vtctldata.ExecuteFetchAsDBAResponse)(nil), // 134: vtctldata.ExecuteFetchAsDBAResponse - (*vtctldata.ExecuteHookResponse)(nil), // 135: vtctldata.ExecuteHookResponse - (*vtctldata.FindAllShardsInKeyspaceResponse)(nil), // 136: vtctldata.FindAllShardsInKeyspaceResponse - (*vtctldata.ForceCutOverSchemaMigrationResponse)(nil), // 137: vtctldata.ForceCutOverSchemaMigrationResponse - (*vtctldata.GetBackupsResponse)(nil), // 138: vtctldata.GetBackupsResponse - (*vtctldata.GetCellInfoResponse)(nil), // 139: vtctldata.GetCellInfoResponse - (*vtctldata.GetCellInfoNamesResponse)(nil), // 140: vtctldata.GetCellInfoNamesResponse - (*vtctldata.GetCellsAliasesResponse)(nil), // 141: vtctldata.GetCellsAliasesResponse - (*vtctldata.GetFullStatusResponse)(nil), // 142: vtctldata.GetFullStatusResponse - (*vtctldata.GetKeyspaceResponse)(nil), // 143: vtctldata.GetKeyspaceResponse - (*vtctldata.GetKeyspacesResponse)(nil), // 144: vtctldata.GetKeyspacesResponse - (*vtctldata.GetPermissionsResponse)(nil), // 145: vtctldata.GetPermissionsResponse - (*vtctldata.GetRoutingRulesResponse)(nil), // 146: vtctldata.GetRoutingRulesResponse - (*vtctldata.GetSchemaResponse)(nil), // 147: vtctldata.GetSchemaResponse - (*vtctldata.GetSchemaMigrationsResponse)(nil), // 148: vtctldata.GetSchemaMigrationsResponse - (*vtctldata.GetShardResponse)(nil), // 149: vtctldata.GetShardResponse - (*vtctldata.GetShardRoutingRulesResponse)(nil), // 150: vtctldata.GetShardRoutingRulesResponse - (*vtctldata.GetSrvKeyspaceNamesResponse)(nil), // 151: vtctldata.GetSrvKeyspaceNamesResponse - (*vtctldata.GetSrvKeyspacesResponse)(nil), // 152: vtctldata.GetSrvKeyspacesResponse - (*vtctldata.UpdateThrottlerConfigResponse)(nil), // 153: vtctldata.UpdateThrottlerConfigResponse - (*vtctldata.GetSrvVSchemaResponse)(nil), // 154: vtctldata.GetSrvVSchemaResponse - (*vtctldata.GetSrvVSchemasResponse)(nil), // 155: vtctldata.GetSrvVSchemasResponse - (*vtctldata.GetTabletResponse)(nil), // 156: vtctldata.GetTabletResponse - (*vtctldata.GetTabletsResponse)(nil), // 157: vtctldata.GetTabletsResponse - (*vtctldata.GetTopologyPathResponse)(nil), // 158: vtctldata.GetTopologyPathResponse - (*vtctldata.GetVersionResponse)(nil), // 159: vtctldata.GetVersionResponse - (*vtctldata.GetVSchemaResponse)(nil), // 160: vtctldata.GetVSchemaResponse - (*vtctldata.GetWorkflowsResponse)(nil), // 161: vtctldata.GetWorkflowsResponse - (*vtctldata.InitShardPrimaryResponse)(nil), // 162: vtctldata.InitShardPrimaryResponse - (*vtctldata.LaunchSchemaMigrationResponse)(nil), // 163: vtctldata.LaunchSchemaMigrationResponse - (*vtctldata.LookupVindexCreateResponse)(nil), // 164: vtctldata.LookupVindexCreateResponse - (*vtctldata.LookupVindexExternalizeResponse)(nil), // 165: vtctldata.LookupVindexExternalizeResponse - (*vtctldata.MaterializeCreateResponse)(nil), // 166: vtctldata.MaterializeCreateResponse - (*vtctldata.WorkflowStatusResponse)(nil), // 167: vtctldata.WorkflowStatusResponse - (*vtctldata.MountRegisterResponse)(nil), // 168: vtctldata.MountRegisterResponse - (*vtctldata.MountUnregisterResponse)(nil), // 169: vtctldata.MountUnregisterResponse - (*vtctldata.MountShowResponse)(nil), // 170: vtctldata.MountShowResponse - (*vtctldata.MountListResponse)(nil), // 171: vtctldata.MountListResponse - (*vtctldata.MoveTablesCompleteResponse)(nil), // 172: vtctldata.MoveTablesCompleteResponse - (*vtctldata.PingTabletResponse)(nil), // 173: vtctldata.PingTabletResponse - (*vtctldata.PlannedReparentShardResponse)(nil), // 174: vtctldata.PlannedReparentShardResponse - (*vtctldata.RebuildKeyspaceGraphResponse)(nil), // 175: vtctldata.RebuildKeyspaceGraphResponse - (*vtctldata.RebuildVSchemaGraphResponse)(nil), // 176: vtctldata.RebuildVSchemaGraphResponse - (*vtctldata.RefreshStateResponse)(nil), // 177: vtctldata.RefreshStateResponse - (*vtctldata.RefreshStateByShardResponse)(nil), // 178: vtctldata.RefreshStateByShardResponse - (*vtctldata.ReloadSchemaResponse)(nil), // 179: vtctldata.ReloadSchemaResponse - (*vtctldata.ReloadSchemaKeyspaceResponse)(nil), // 180: vtctldata.ReloadSchemaKeyspaceResponse - (*vtctldata.ReloadSchemaShardResponse)(nil), // 181: vtctldata.ReloadSchemaShardResponse - (*vtctldata.RemoveBackupResponse)(nil), // 182: vtctldata.RemoveBackupResponse - (*vtctldata.RemoveKeyspaceCellResponse)(nil), // 183: vtctldata.RemoveKeyspaceCellResponse - (*vtctldata.RemoveShardCellResponse)(nil), // 184: vtctldata.RemoveShardCellResponse - (*vtctldata.ReparentTabletResponse)(nil), // 185: vtctldata.ReparentTabletResponse - (*vtctldata.RestoreFromBackupResponse)(nil), // 186: vtctldata.RestoreFromBackupResponse - (*vtctldata.RetrySchemaMigrationResponse)(nil), // 187: vtctldata.RetrySchemaMigrationResponse - (*vtctldata.RunHealthCheckResponse)(nil), // 188: vtctldata.RunHealthCheckResponse - (*vtctldata.SetKeyspaceDurabilityPolicyResponse)(nil), // 189: vtctldata.SetKeyspaceDurabilityPolicyResponse - (*vtctldata.SetShardIsPrimaryServingResponse)(nil), // 190: vtctldata.SetShardIsPrimaryServingResponse - (*vtctldata.SetShardTabletControlResponse)(nil), // 191: vtctldata.SetShardTabletControlResponse - (*vtctldata.SetWritableResponse)(nil), // 192: vtctldata.SetWritableResponse - (*vtctldata.ShardReplicationAddResponse)(nil), // 193: vtctldata.ShardReplicationAddResponse - (*vtctldata.ShardReplicationFixResponse)(nil), // 194: vtctldata.ShardReplicationFixResponse - (*vtctldata.ShardReplicationPositionsResponse)(nil), // 195: vtctldata.ShardReplicationPositionsResponse - (*vtctldata.ShardReplicationRemoveResponse)(nil), // 196: vtctldata.ShardReplicationRemoveResponse - (*vtctldata.SleepTabletResponse)(nil), // 197: vtctldata.SleepTabletResponse - (*vtctldata.SourceShardAddResponse)(nil), // 198: vtctldata.SourceShardAddResponse - (*vtctldata.SourceShardDeleteResponse)(nil), // 199: vtctldata.SourceShardDeleteResponse - (*vtctldata.StartReplicationResponse)(nil), // 200: vtctldata.StartReplicationResponse - (*vtctldata.StopReplicationResponse)(nil), // 201: vtctldata.StopReplicationResponse - (*vtctldata.TabletExternallyReparentedResponse)(nil), // 202: vtctldata.TabletExternallyReparentedResponse - (*vtctldata.UpdateCellInfoResponse)(nil), // 203: vtctldata.UpdateCellInfoResponse - (*vtctldata.UpdateCellsAliasResponse)(nil), // 204: vtctldata.UpdateCellsAliasResponse - (*vtctldata.ValidateResponse)(nil), // 205: vtctldata.ValidateResponse - (*vtctldata.ValidateKeyspaceResponse)(nil), // 206: vtctldata.ValidateKeyspaceResponse - (*vtctldata.ValidateSchemaKeyspaceResponse)(nil), // 207: vtctldata.ValidateSchemaKeyspaceResponse - (*vtctldata.ValidateShardResponse)(nil), // 208: vtctldata.ValidateShardResponse - (*vtctldata.ValidateVersionKeyspaceResponse)(nil), // 209: vtctldata.ValidateVersionKeyspaceResponse - (*vtctldata.ValidateVersionShardResponse)(nil), // 210: vtctldata.ValidateVersionShardResponse - (*vtctldata.ValidateVSchemaResponse)(nil), // 211: vtctldata.ValidateVSchemaResponse - (*vtctldata.VDiffCreateResponse)(nil), // 212: vtctldata.VDiffCreateResponse - (*vtctldata.VDiffDeleteResponse)(nil), // 213: vtctldata.VDiffDeleteResponse - (*vtctldata.VDiffResumeResponse)(nil), // 214: vtctldata.VDiffResumeResponse - (*vtctldata.VDiffShowResponse)(nil), // 215: vtctldata.VDiffShowResponse - (*vtctldata.VDiffStopResponse)(nil), // 216: vtctldata.VDiffStopResponse - (*vtctldata.WorkflowDeleteResponse)(nil), // 217: vtctldata.WorkflowDeleteResponse - (*vtctldata.WorkflowSwitchTrafficResponse)(nil), // 218: vtctldata.WorkflowSwitchTrafficResponse - (*vtctldata.WorkflowUpdateResponse)(nil), // 219: vtctldata.WorkflowUpdateResponse + (*vtctldata.ApplyMirrorRulesRequest)(nil), // 112: vtctldata.ApplyMirrorRulesRequest + (*vtctldata.GetMirrorRulesRequest)(nil), // 113: vtctldata.GetMirrorRulesRequest + (*vtctldata.WorkflowMirrorTrafficRequest)(nil), // 114: vtctldata.WorkflowMirrorTrafficRequest + (*vtctldata.ExecuteVtctlCommandResponse)(nil), // 115: vtctldata.ExecuteVtctlCommandResponse + (*vtctldata.AddCellInfoResponse)(nil), // 116: vtctldata.AddCellInfoResponse + (*vtctldata.AddCellsAliasResponse)(nil), // 117: vtctldata.AddCellsAliasResponse + (*vtctldata.ApplyRoutingRulesResponse)(nil), // 118: vtctldata.ApplyRoutingRulesResponse + (*vtctldata.ApplySchemaResponse)(nil), // 119: vtctldata.ApplySchemaResponse + (*vtctldata.ApplyShardRoutingRulesResponse)(nil), // 120: vtctldata.ApplyShardRoutingRulesResponse + (*vtctldata.ApplyVSchemaResponse)(nil), // 121: vtctldata.ApplyVSchemaResponse + (*vtctldata.BackupResponse)(nil), // 122: vtctldata.BackupResponse + (*vtctldata.CancelSchemaMigrationResponse)(nil), // 123: vtctldata.CancelSchemaMigrationResponse + (*vtctldata.ChangeTabletTypeResponse)(nil), // 124: vtctldata.ChangeTabletTypeResponse + (*vtctldata.CleanupSchemaMigrationResponse)(nil), // 125: vtctldata.CleanupSchemaMigrationResponse + (*vtctldata.CompleteSchemaMigrationResponse)(nil), // 126: vtctldata.CompleteSchemaMigrationResponse + (*vtctldata.CreateKeyspaceResponse)(nil), // 127: vtctldata.CreateKeyspaceResponse + (*vtctldata.CreateShardResponse)(nil), // 128: vtctldata.CreateShardResponse + (*vtctldata.DeleteCellInfoResponse)(nil), // 129: vtctldata.DeleteCellInfoResponse + (*vtctldata.DeleteCellsAliasResponse)(nil), // 130: vtctldata.DeleteCellsAliasResponse + (*vtctldata.DeleteKeyspaceResponse)(nil), // 131: vtctldata.DeleteKeyspaceResponse + (*vtctldata.DeleteShardsResponse)(nil), // 132: vtctldata.DeleteShardsResponse + (*vtctldata.DeleteSrvVSchemaResponse)(nil), // 133: vtctldata.DeleteSrvVSchemaResponse + (*vtctldata.DeleteTabletsResponse)(nil), // 134: vtctldata.DeleteTabletsResponse + (*vtctldata.EmergencyReparentShardResponse)(nil), // 135: vtctldata.EmergencyReparentShardResponse + (*vtctldata.ExecuteFetchAsAppResponse)(nil), // 136: vtctldata.ExecuteFetchAsAppResponse + (*vtctldata.ExecuteFetchAsDBAResponse)(nil), // 137: vtctldata.ExecuteFetchAsDBAResponse + (*vtctldata.ExecuteHookResponse)(nil), // 138: vtctldata.ExecuteHookResponse + (*vtctldata.FindAllShardsInKeyspaceResponse)(nil), // 139: vtctldata.FindAllShardsInKeyspaceResponse + (*vtctldata.ForceCutOverSchemaMigrationResponse)(nil), // 140: vtctldata.ForceCutOverSchemaMigrationResponse + (*vtctldata.GetBackupsResponse)(nil), // 141: vtctldata.GetBackupsResponse + (*vtctldata.GetCellInfoResponse)(nil), // 142: vtctldata.GetCellInfoResponse + (*vtctldata.GetCellInfoNamesResponse)(nil), // 143: vtctldata.GetCellInfoNamesResponse + (*vtctldata.GetCellsAliasesResponse)(nil), // 144: vtctldata.GetCellsAliasesResponse + (*vtctldata.GetFullStatusResponse)(nil), // 145: vtctldata.GetFullStatusResponse + (*vtctldata.GetKeyspaceResponse)(nil), // 146: vtctldata.GetKeyspaceResponse + (*vtctldata.GetKeyspacesResponse)(nil), // 147: vtctldata.GetKeyspacesResponse + (*vtctldata.GetPermissionsResponse)(nil), // 148: vtctldata.GetPermissionsResponse + (*vtctldata.GetRoutingRulesResponse)(nil), // 149: vtctldata.GetRoutingRulesResponse + (*vtctldata.GetSchemaResponse)(nil), // 150: vtctldata.GetSchemaResponse + (*vtctldata.GetSchemaMigrationsResponse)(nil), // 151: vtctldata.GetSchemaMigrationsResponse + (*vtctldata.GetShardResponse)(nil), // 152: vtctldata.GetShardResponse + (*vtctldata.GetShardRoutingRulesResponse)(nil), // 153: vtctldata.GetShardRoutingRulesResponse + (*vtctldata.GetSrvKeyspaceNamesResponse)(nil), // 154: vtctldata.GetSrvKeyspaceNamesResponse + (*vtctldata.GetSrvKeyspacesResponse)(nil), // 155: vtctldata.GetSrvKeyspacesResponse + (*vtctldata.UpdateThrottlerConfigResponse)(nil), // 156: vtctldata.UpdateThrottlerConfigResponse + (*vtctldata.GetSrvVSchemaResponse)(nil), // 157: vtctldata.GetSrvVSchemaResponse + (*vtctldata.GetSrvVSchemasResponse)(nil), // 158: vtctldata.GetSrvVSchemasResponse + (*vtctldata.GetTabletResponse)(nil), // 159: vtctldata.GetTabletResponse + (*vtctldata.GetTabletsResponse)(nil), // 160: vtctldata.GetTabletsResponse + (*vtctldata.GetTopologyPathResponse)(nil), // 161: vtctldata.GetTopologyPathResponse + (*vtctldata.GetVersionResponse)(nil), // 162: vtctldata.GetVersionResponse + (*vtctldata.GetVSchemaResponse)(nil), // 163: vtctldata.GetVSchemaResponse + (*vtctldata.GetWorkflowsResponse)(nil), // 164: vtctldata.GetWorkflowsResponse + (*vtctldata.InitShardPrimaryResponse)(nil), // 165: vtctldata.InitShardPrimaryResponse + (*vtctldata.LaunchSchemaMigrationResponse)(nil), // 166: vtctldata.LaunchSchemaMigrationResponse + (*vtctldata.LookupVindexCreateResponse)(nil), // 167: vtctldata.LookupVindexCreateResponse + (*vtctldata.LookupVindexExternalizeResponse)(nil), // 168: vtctldata.LookupVindexExternalizeResponse + (*vtctldata.MaterializeCreateResponse)(nil), // 169: vtctldata.MaterializeCreateResponse + (*vtctldata.WorkflowStatusResponse)(nil), // 170: vtctldata.WorkflowStatusResponse + (*vtctldata.MountRegisterResponse)(nil), // 171: vtctldata.MountRegisterResponse + (*vtctldata.MountUnregisterResponse)(nil), // 172: vtctldata.MountUnregisterResponse + (*vtctldata.MountShowResponse)(nil), // 173: vtctldata.MountShowResponse + (*vtctldata.MountListResponse)(nil), // 174: vtctldata.MountListResponse + (*vtctldata.MoveTablesCompleteResponse)(nil), // 175: vtctldata.MoveTablesCompleteResponse + (*vtctldata.PingTabletResponse)(nil), // 176: vtctldata.PingTabletResponse + (*vtctldata.PlannedReparentShardResponse)(nil), // 177: vtctldata.PlannedReparentShardResponse + (*vtctldata.RebuildKeyspaceGraphResponse)(nil), // 178: vtctldata.RebuildKeyspaceGraphResponse + (*vtctldata.RebuildVSchemaGraphResponse)(nil), // 179: vtctldata.RebuildVSchemaGraphResponse + (*vtctldata.RefreshStateResponse)(nil), // 180: vtctldata.RefreshStateResponse + (*vtctldata.RefreshStateByShardResponse)(nil), // 181: vtctldata.RefreshStateByShardResponse + (*vtctldata.ReloadSchemaResponse)(nil), // 182: vtctldata.ReloadSchemaResponse + (*vtctldata.ReloadSchemaKeyspaceResponse)(nil), // 183: vtctldata.ReloadSchemaKeyspaceResponse + (*vtctldata.ReloadSchemaShardResponse)(nil), // 184: vtctldata.ReloadSchemaShardResponse + (*vtctldata.RemoveBackupResponse)(nil), // 185: vtctldata.RemoveBackupResponse + (*vtctldata.RemoveKeyspaceCellResponse)(nil), // 186: vtctldata.RemoveKeyspaceCellResponse + (*vtctldata.RemoveShardCellResponse)(nil), // 187: vtctldata.RemoveShardCellResponse + (*vtctldata.ReparentTabletResponse)(nil), // 188: vtctldata.ReparentTabletResponse + (*vtctldata.RestoreFromBackupResponse)(nil), // 189: vtctldata.RestoreFromBackupResponse + (*vtctldata.RetrySchemaMigrationResponse)(nil), // 190: vtctldata.RetrySchemaMigrationResponse + (*vtctldata.RunHealthCheckResponse)(nil), // 191: vtctldata.RunHealthCheckResponse + (*vtctldata.SetKeyspaceDurabilityPolicyResponse)(nil), // 192: vtctldata.SetKeyspaceDurabilityPolicyResponse + (*vtctldata.SetShardIsPrimaryServingResponse)(nil), // 193: vtctldata.SetShardIsPrimaryServingResponse + (*vtctldata.SetShardTabletControlResponse)(nil), // 194: vtctldata.SetShardTabletControlResponse + (*vtctldata.SetWritableResponse)(nil), // 195: vtctldata.SetWritableResponse + (*vtctldata.ShardReplicationAddResponse)(nil), // 196: vtctldata.ShardReplicationAddResponse + (*vtctldata.ShardReplicationFixResponse)(nil), // 197: vtctldata.ShardReplicationFixResponse + (*vtctldata.ShardReplicationPositionsResponse)(nil), // 198: vtctldata.ShardReplicationPositionsResponse + (*vtctldata.ShardReplicationRemoveResponse)(nil), // 199: vtctldata.ShardReplicationRemoveResponse + (*vtctldata.SleepTabletResponse)(nil), // 200: vtctldata.SleepTabletResponse + (*vtctldata.SourceShardAddResponse)(nil), // 201: vtctldata.SourceShardAddResponse + (*vtctldata.SourceShardDeleteResponse)(nil), // 202: vtctldata.SourceShardDeleteResponse + (*vtctldata.StartReplicationResponse)(nil), // 203: vtctldata.StartReplicationResponse + (*vtctldata.StopReplicationResponse)(nil), // 204: vtctldata.StopReplicationResponse + (*vtctldata.TabletExternallyReparentedResponse)(nil), // 205: vtctldata.TabletExternallyReparentedResponse + (*vtctldata.UpdateCellInfoResponse)(nil), // 206: vtctldata.UpdateCellInfoResponse + (*vtctldata.UpdateCellsAliasResponse)(nil), // 207: vtctldata.UpdateCellsAliasResponse + (*vtctldata.ValidateResponse)(nil), // 208: vtctldata.ValidateResponse + (*vtctldata.ValidateKeyspaceResponse)(nil), // 209: vtctldata.ValidateKeyspaceResponse + (*vtctldata.ValidateSchemaKeyspaceResponse)(nil), // 210: vtctldata.ValidateSchemaKeyspaceResponse + (*vtctldata.ValidateShardResponse)(nil), // 211: vtctldata.ValidateShardResponse + (*vtctldata.ValidateVersionKeyspaceResponse)(nil), // 212: vtctldata.ValidateVersionKeyspaceResponse + (*vtctldata.ValidateVersionShardResponse)(nil), // 213: vtctldata.ValidateVersionShardResponse + (*vtctldata.ValidateVSchemaResponse)(nil), // 214: vtctldata.ValidateVSchemaResponse + (*vtctldata.VDiffCreateResponse)(nil), // 215: vtctldata.VDiffCreateResponse + (*vtctldata.VDiffDeleteResponse)(nil), // 216: vtctldata.VDiffDeleteResponse + (*vtctldata.VDiffResumeResponse)(nil), // 217: vtctldata.VDiffResumeResponse + (*vtctldata.VDiffShowResponse)(nil), // 218: vtctldata.VDiffShowResponse + (*vtctldata.VDiffStopResponse)(nil), // 219: vtctldata.VDiffStopResponse + (*vtctldata.WorkflowDeleteResponse)(nil), // 220: vtctldata.WorkflowDeleteResponse + (*vtctldata.WorkflowSwitchTrafficResponse)(nil), // 221: vtctldata.WorkflowSwitchTrafficResponse + (*vtctldata.WorkflowUpdateResponse)(nil), // 222: vtctldata.WorkflowUpdateResponse + (*vtctldata.ApplyMirrorRulesResponse)(nil), // 223: vtctldata.ApplyMirrorRulesResponse + (*vtctldata.GetMirrorRulesResponse)(nil), // 224: vtctldata.GetMirrorRulesResponse + (*vtctldata.WorkflowMirrorTrafficResponse)(nil), // 225: vtctldata.WorkflowMirrorTrafficResponse } var file_vtctlservice_proto_depIdxs = []int32{ 0, // 0: vtctlservice.Vtctl.ExecuteVtctlCommand:input_type -> vtctldata.ExecuteVtctlCommandRequest @@ -1042,120 +1066,126 @@ var file_vtctlservice_proto_depIdxs = []int32{ 109, // 109: vtctlservice.Vtctld.WorkflowStatus:input_type -> vtctldata.WorkflowStatusRequest 110, // 110: vtctlservice.Vtctld.WorkflowSwitchTraffic:input_type -> vtctldata.WorkflowSwitchTrafficRequest 111, // 111: vtctlservice.Vtctld.WorkflowUpdate:input_type -> vtctldata.WorkflowUpdateRequest - 112, // 112: vtctlservice.Vtctl.ExecuteVtctlCommand:output_type -> vtctldata.ExecuteVtctlCommandResponse - 113, // 113: vtctlservice.Vtctld.AddCellInfo:output_type -> vtctldata.AddCellInfoResponse - 114, // 114: vtctlservice.Vtctld.AddCellsAlias:output_type -> vtctldata.AddCellsAliasResponse - 115, // 115: vtctlservice.Vtctld.ApplyRoutingRules:output_type -> vtctldata.ApplyRoutingRulesResponse - 116, // 116: vtctlservice.Vtctld.ApplySchema:output_type -> vtctldata.ApplySchemaResponse - 117, // 117: vtctlservice.Vtctld.ApplyShardRoutingRules:output_type -> vtctldata.ApplyShardRoutingRulesResponse - 118, // 118: vtctlservice.Vtctld.ApplyVSchema:output_type -> vtctldata.ApplyVSchemaResponse - 119, // 119: vtctlservice.Vtctld.Backup:output_type -> vtctldata.BackupResponse - 119, // 120: vtctlservice.Vtctld.BackupShard:output_type -> vtctldata.BackupResponse - 120, // 121: vtctlservice.Vtctld.CancelSchemaMigration:output_type -> vtctldata.CancelSchemaMigrationResponse - 121, // 122: vtctlservice.Vtctld.ChangeTabletType:output_type -> vtctldata.ChangeTabletTypeResponse - 122, // 123: vtctlservice.Vtctld.CleanupSchemaMigration:output_type -> vtctldata.CleanupSchemaMigrationResponse - 123, // 124: vtctlservice.Vtctld.CompleteSchemaMigration:output_type -> vtctldata.CompleteSchemaMigrationResponse - 124, // 125: vtctlservice.Vtctld.CreateKeyspace:output_type -> vtctldata.CreateKeyspaceResponse - 125, // 126: vtctlservice.Vtctld.CreateShard:output_type -> vtctldata.CreateShardResponse - 126, // 127: vtctlservice.Vtctld.DeleteCellInfo:output_type -> vtctldata.DeleteCellInfoResponse - 127, // 128: vtctlservice.Vtctld.DeleteCellsAlias:output_type -> vtctldata.DeleteCellsAliasResponse - 128, // 129: vtctlservice.Vtctld.DeleteKeyspace:output_type -> vtctldata.DeleteKeyspaceResponse - 129, // 130: vtctlservice.Vtctld.DeleteShards:output_type -> vtctldata.DeleteShardsResponse - 130, // 131: vtctlservice.Vtctld.DeleteSrvVSchema:output_type -> vtctldata.DeleteSrvVSchemaResponse - 131, // 132: vtctlservice.Vtctld.DeleteTablets:output_type -> vtctldata.DeleteTabletsResponse - 132, // 133: vtctlservice.Vtctld.EmergencyReparentShard:output_type -> vtctldata.EmergencyReparentShardResponse - 133, // 134: vtctlservice.Vtctld.ExecuteFetchAsApp:output_type -> vtctldata.ExecuteFetchAsAppResponse - 134, // 135: vtctlservice.Vtctld.ExecuteFetchAsDBA:output_type -> vtctldata.ExecuteFetchAsDBAResponse - 135, // 136: vtctlservice.Vtctld.ExecuteHook:output_type -> vtctldata.ExecuteHookResponse - 136, // 137: vtctlservice.Vtctld.FindAllShardsInKeyspace:output_type -> vtctldata.FindAllShardsInKeyspaceResponse - 137, // 138: vtctlservice.Vtctld.ForceCutOverSchemaMigration:output_type -> vtctldata.ForceCutOverSchemaMigrationResponse - 138, // 139: vtctlservice.Vtctld.GetBackups:output_type -> vtctldata.GetBackupsResponse - 139, // 140: vtctlservice.Vtctld.GetCellInfo:output_type -> vtctldata.GetCellInfoResponse - 140, // 141: vtctlservice.Vtctld.GetCellInfoNames:output_type -> vtctldata.GetCellInfoNamesResponse - 141, // 142: vtctlservice.Vtctld.GetCellsAliases:output_type -> vtctldata.GetCellsAliasesResponse - 142, // 143: vtctlservice.Vtctld.GetFullStatus:output_type -> vtctldata.GetFullStatusResponse - 143, // 144: vtctlservice.Vtctld.GetKeyspace:output_type -> vtctldata.GetKeyspaceResponse - 144, // 145: vtctlservice.Vtctld.GetKeyspaces:output_type -> vtctldata.GetKeyspacesResponse - 145, // 146: vtctlservice.Vtctld.GetPermissions:output_type -> vtctldata.GetPermissionsResponse - 146, // 147: vtctlservice.Vtctld.GetRoutingRules:output_type -> vtctldata.GetRoutingRulesResponse - 147, // 148: vtctlservice.Vtctld.GetSchema:output_type -> vtctldata.GetSchemaResponse - 148, // 149: vtctlservice.Vtctld.GetSchemaMigrations:output_type -> vtctldata.GetSchemaMigrationsResponse - 149, // 150: vtctlservice.Vtctld.GetShard:output_type -> vtctldata.GetShardResponse - 150, // 151: vtctlservice.Vtctld.GetShardRoutingRules:output_type -> vtctldata.GetShardRoutingRulesResponse - 151, // 152: vtctlservice.Vtctld.GetSrvKeyspaceNames:output_type -> vtctldata.GetSrvKeyspaceNamesResponse - 152, // 153: vtctlservice.Vtctld.GetSrvKeyspaces:output_type -> vtctldata.GetSrvKeyspacesResponse - 153, // 154: vtctlservice.Vtctld.UpdateThrottlerConfig:output_type -> vtctldata.UpdateThrottlerConfigResponse - 154, // 155: vtctlservice.Vtctld.GetSrvVSchema:output_type -> vtctldata.GetSrvVSchemaResponse - 155, // 156: vtctlservice.Vtctld.GetSrvVSchemas:output_type -> vtctldata.GetSrvVSchemasResponse - 156, // 157: vtctlservice.Vtctld.GetTablet:output_type -> vtctldata.GetTabletResponse - 157, // 158: vtctlservice.Vtctld.GetTablets:output_type -> vtctldata.GetTabletsResponse - 158, // 159: vtctlservice.Vtctld.GetTopologyPath:output_type -> vtctldata.GetTopologyPathResponse - 159, // 160: vtctlservice.Vtctld.GetVersion:output_type -> vtctldata.GetVersionResponse - 160, // 161: vtctlservice.Vtctld.GetVSchema:output_type -> vtctldata.GetVSchemaResponse - 161, // 162: vtctlservice.Vtctld.GetWorkflows:output_type -> vtctldata.GetWorkflowsResponse - 162, // 163: vtctlservice.Vtctld.InitShardPrimary:output_type -> vtctldata.InitShardPrimaryResponse - 163, // 164: vtctlservice.Vtctld.LaunchSchemaMigration:output_type -> vtctldata.LaunchSchemaMigrationResponse - 164, // 165: vtctlservice.Vtctld.LookupVindexCreate:output_type -> vtctldata.LookupVindexCreateResponse - 165, // 166: vtctlservice.Vtctld.LookupVindexExternalize:output_type -> vtctldata.LookupVindexExternalizeResponse - 166, // 167: vtctlservice.Vtctld.MaterializeCreate:output_type -> vtctldata.MaterializeCreateResponse - 167, // 168: vtctlservice.Vtctld.MigrateCreate:output_type -> vtctldata.WorkflowStatusResponse - 168, // 169: vtctlservice.Vtctld.MountRegister:output_type -> vtctldata.MountRegisterResponse - 169, // 170: vtctlservice.Vtctld.MountUnregister:output_type -> vtctldata.MountUnregisterResponse - 170, // 171: vtctlservice.Vtctld.MountShow:output_type -> vtctldata.MountShowResponse - 171, // 172: vtctlservice.Vtctld.MountList:output_type -> vtctldata.MountListResponse - 167, // 173: vtctlservice.Vtctld.MoveTablesCreate:output_type -> vtctldata.WorkflowStatusResponse - 172, // 174: vtctlservice.Vtctld.MoveTablesComplete:output_type -> vtctldata.MoveTablesCompleteResponse - 173, // 175: vtctlservice.Vtctld.PingTablet:output_type -> vtctldata.PingTabletResponse - 174, // 176: vtctlservice.Vtctld.PlannedReparentShard:output_type -> vtctldata.PlannedReparentShardResponse - 175, // 177: vtctlservice.Vtctld.RebuildKeyspaceGraph:output_type -> vtctldata.RebuildKeyspaceGraphResponse - 176, // 178: vtctlservice.Vtctld.RebuildVSchemaGraph:output_type -> vtctldata.RebuildVSchemaGraphResponse - 177, // 179: vtctlservice.Vtctld.RefreshState:output_type -> vtctldata.RefreshStateResponse - 178, // 180: vtctlservice.Vtctld.RefreshStateByShard:output_type -> vtctldata.RefreshStateByShardResponse - 179, // 181: vtctlservice.Vtctld.ReloadSchema:output_type -> vtctldata.ReloadSchemaResponse - 180, // 182: vtctlservice.Vtctld.ReloadSchemaKeyspace:output_type -> vtctldata.ReloadSchemaKeyspaceResponse - 181, // 183: vtctlservice.Vtctld.ReloadSchemaShard:output_type -> vtctldata.ReloadSchemaShardResponse - 182, // 184: vtctlservice.Vtctld.RemoveBackup:output_type -> vtctldata.RemoveBackupResponse - 183, // 185: vtctlservice.Vtctld.RemoveKeyspaceCell:output_type -> vtctldata.RemoveKeyspaceCellResponse - 184, // 186: vtctlservice.Vtctld.RemoveShardCell:output_type -> vtctldata.RemoveShardCellResponse - 185, // 187: vtctlservice.Vtctld.ReparentTablet:output_type -> vtctldata.ReparentTabletResponse - 167, // 188: vtctlservice.Vtctld.ReshardCreate:output_type -> vtctldata.WorkflowStatusResponse - 186, // 189: vtctlservice.Vtctld.RestoreFromBackup:output_type -> vtctldata.RestoreFromBackupResponse - 187, // 190: vtctlservice.Vtctld.RetrySchemaMigration:output_type -> vtctldata.RetrySchemaMigrationResponse - 188, // 191: vtctlservice.Vtctld.RunHealthCheck:output_type -> vtctldata.RunHealthCheckResponse - 189, // 192: vtctlservice.Vtctld.SetKeyspaceDurabilityPolicy:output_type -> vtctldata.SetKeyspaceDurabilityPolicyResponse - 190, // 193: vtctlservice.Vtctld.SetShardIsPrimaryServing:output_type -> vtctldata.SetShardIsPrimaryServingResponse - 191, // 194: vtctlservice.Vtctld.SetShardTabletControl:output_type -> vtctldata.SetShardTabletControlResponse - 192, // 195: vtctlservice.Vtctld.SetWritable:output_type -> vtctldata.SetWritableResponse - 193, // 196: vtctlservice.Vtctld.ShardReplicationAdd:output_type -> vtctldata.ShardReplicationAddResponse - 194, // 197: vtctlservice.Vtctld.ShardReplicationFix:output_type -> vtctldata.ShardReplicationFixResponse - 195, // 198: vtctlservice.Vtctld.ShardReplicationPositions:output_type -> vtctldata.ShardReplicationPositionsResponse - 196, // 199: vtctlservice.Vtctld.ShardReplicationRemove:output_type -> vtctldata.ShardReplicationRemoveResponse - 197, // 200: vtctlservice.Vtctld.SleepTablet:output_type -> vtctldata.SleepTabletResponse - 198, // 201: vtctlservice.Vtctld.SourceShardAdd:output_type -> vtctldata.SourceShardAddResponse - 199, // 202: vtctlservice.Vtctld.SourceShardDelete:output_type -> vtctldata.SourceShardDeleteResponse - 200, // 203: vtctlservice.Vtctld.StartReplication:output_type -> vtctldata.StartReplicationResponse - 201, // 204: vtctlservice.Vtctld.StopReplication:output_type -> vtctldata.StopReplicationResponse - 202, // 205: vtctlservice.Vtctld.TabletExternallyReparented:output_type -> vtctldata.TabletExternallyReparentedResponse - 203, // 206: vtctlservice.Vtctld.UpdateCellInfo:output_type -> vtctldata.UpdateCellInfoResponse - 204, // 207: vtctlservice.Vtctld.UpdateCellsAlias:output_type -> vtctldata.UpdateCellsAliasResponse - 205, // 208: vtctlservice.Vtctld.Validate:output_type -> vtctldata.ValidateResponse - 206, // 209: vtctlservice.Vtctld.ValidateKeyspace:output_type -> vtctldata.ValidateKeyspaceResponse - 207, // 210: vtctlservice.Vtctld.ValidateSchemaKeyspace:output_type -> vtctldata.ValidateSchemaKeyspaceResponse - 208, // 211: vtctlservice.Vtctld.ValidateShard:output_type -> vtctldata.ValidateShardResponse - 209, // 212: vtctlservice.Vtctld.ValidateVersionKeyspace:output_type -> vtctldata.ValidateVersionKeyspaceResponse - 210, // 213: vtctlservice.Vtctld.ValidateVersionShard:output_type -> vtctldata.ValidateVersionShardResponse - 211, // 214: vtctlservice.Vtctld.ValidateVSchema:output_type -> vtctldata.ValidateVSchemaResponse - 212, // 215: vtctlservice.Vtctld.VDiffCreate:output_type -> vtctldata.VDiffCreateResponse - 213, // 216: vtctlservice.Vtctld.VDiffDelete:output_type -> vtctldata.VDiffDeleteResponse - 214, // 217: vtctlservice.Vtctld.VDiffResume:output_type -> vtctldata.VDiffResumeResponse - 215, // 218: vtctlservice.Vtctld.VDiffShow:output_type -> vtctldata.VDiffShowResponse - 216, // 219: vtctlservice.Vtctld.VDiffStop:output_type -> vtctldata.VDiffStopResponse - 217, // 220: vtctlservice.Vtctld.WorkflowDelete:output_type -> vtctldata.WorkflowDeleteResponse - 167, // 221: vtctlservice.Vtctld.WorkflowStatus:output_type -> vtctldata.WorkflowStatusResponse - 218, // 222: vtctlservice.Vtctld.WorkflowSwitchTraffic:output_type -> vtctldata.WorkflowSwitchTrafficResponse - 219, // 223: vtctlservice.Vtctld.WorkflowUpdate:output_type -> vtctldata.WorkflowUpdateResponse - 112, // [112:224] is the sub-list for method output_type - 0, // [0:112] is the sub-list for method input_type + 112, // 112: vtctlservice.Vtctld.ApplyMirrorRules:input_type -> vtctldata.ApplyMirrorRulesRequest + 113, // 113: vtctlservice.Vtctld.GetMirrorRules:input_type -> vtctldata.GetMirrorRulesRequest + 114, // 114: vtctlservice.Vtctld.WorkflowMirrorTraffic:input_type -> vtctldata.WorkflowMirrorTrafficRequest + 115, // 115: vtctlservice.Vtctl.ExecuteVtctlCommand:output_type -> vtctldata.ExecuteVtctlCommandResponse + 116, // 116: vtctlservice.Vtctld.AddCellInfo:output_type -> vtctldata.AddCellInfoResponse + 117, // 117: vtctlservice.Vtctld.AddCellsAlias:output_type -> vtctldata.AddCellsAliasResponse + 118, // 118: vtctlservice.Vtctld.ApplyRoutingRules:output_type -> vtctldata.ApplyRoutingRulesResponse + 119, // 119: vtctlservice.Vtctld.ApplySchema:output_type -> vtctldata.ApplySchemaResponse + 120, // 120: vtctlservice.Vtctld.ApplyShardRoutingRules:output_type -> vtctldata.ApplyShardRoutingRulesResponse + 121, // 121: vtctlservice.Vtctld.ApplyVSchema:output_type -> vtctldata.ApplyVSchemaResponse + 122, // 122: vtctlservice.Vtctld.Backup:output_type -> vtctldata.BackupResponse + 122, // 123: vtctlservice.Vtctld.BackupShard:output_type -> vtctldata.BackupResponse + 123, // 124: vtctlservice.Vtctld.CancelSchemaMigration:output_type -> vtctldata.CancelSchemaMigrationResponse + 124, // 125: vtctlservice.Vtctld.ChangeTabletType:output_type -> vtctldata.ChangeTabletTypeResponse + 125, // 126: vtctlservice.Vtctld.CleanupSchemaMigration:output_type -> vtctldata.CleanupSchemaMigrationResponse + 126, // 127: vtctlservice.Vtctld.CompleteSchemaMigration:output_type -> vtctldata.CompleteSchemaMigrationResponse + 127, // 128: vtctlservice.Vtctld.CreateKeyspace:output_type -> vtctldata.CreateKeyspaceResponse + 128, // 129: vtctlservice.Vtctld.CreateShard:output_type -> vtctldata.CreateShardResponse + 129, // 130: vtctlservice.Vtctld.DeleteCellInfo:output_type -> vtctldata.DeleteCellInfoResponse + 130, // 131: vtctlservice.Vtctld.DeleteCellsAlias:output_type -> vtctldata.DeleteCellsAliasResponse + 131, // 132: vtctlservice.Vtctld.DeleteKeyspace:output_type -> vtctldata.DeleteKeyspaceResponse + 132, // 133: vtctlservice.Vtctld.DeleteShards:output_type -> vtctldata.DeleteShardsResponse + 133, // 134: vtctlservice.Vtctld.DeleteSrvVSchema:output_type -> vtctldata.DeleteSrvVSchemaResponse + 134, // 135: vtctlservice.Vtctld.DeleteTablets:output_type -> vtctldata.DeleteTabletsResponse + 135, // 136: vtctlservice.Vtctld.EmergencyReparentShard:output_type -> vtctldata.EmergencyReparentShardResponse + 136, // 137: vtctlservice.Vtctld.ExecuteFetchAsApp:output_type -> vtctldata.ExecuteFetchAsAppResponse + 137, // 138: vtctlservice.Vtctld.ExecuteFetchAsDBA:output_type -> vtctldata.ExecuteFetchAsDBAResponse + 138, // 139: vtctlservice.Vtctld.ExecuteHook:output_type -> vtctldata.ExecuteHookResponse + 139, // 140: vtctlservice.Vtctld.FindAllShardsInKeyspace:output_type -> vtctldata.FindAllShardsInKeyspaceResponse + 140, // 141: vtctlservice.Vtctld.ForceCutOverSchemaMigration:output_type -> vtctldata.ForceCutOverSchemaMigrationResponse + 141, // 142: vtctlservice.Vtctld.GetBackups:output_type -> vtctldata.GetBackupsResponse + 142, // 143: vtctlservice.Vtctld.GetCellInfo:output_type -> vtctldata.GetCellInfoResponse + 143, // 144: vtctlservice.Vtctld.GetCellInfoNames:output_type -> vtctldata.GetCellInfoNamesResponse + 144, // 145: vtctlservice.Vtctld.GetCellsAliases:output_type -> vtctldata.GetCellsAliasesResponse + 145, // 146: vtctlservice.Vtctld.GetFullStatus:output_type -> vtctldata.GetFullStatusResponse + 146, // 147: vtctlservice.Vtctld.GetKeyspace:output_type -> vtctldata.GetKeyspaceResponse + 147, // 148: vtctlservice.Vtctld.GetKeyspaces:output_type -> vtctldata.GetKeyspacesResponse + 148, // 149: vtctlservice.Vtctld.GetPermissions:output_type -> vtctldata.GetPermissionsResponse + 149, // 150: vtctlservice.Vtctld.GetRoutingRules:output_type -> vtctldata.GetRoutingRulesResponse + 150, // 151: vtctlservice.Vtctld.GetSchema:output_type -> vtctldata.GetSchemaResponse + 151, // 152: vtctlservice.Vtctld.GetSchemaMigrations:output_type -> vtctldata.GetSchemaMigrationsResponse + 152, // 153: vtctlservice.Vtctld.GetShard:output_type -> vtctldata.GetShardResponse + 153, // 154: vtctlservice.Vtctld.GetShardRoutingRules:output_type -> vtctldata.GetShardRoutingRulesResponse + 154, // 155: vtctlservice.Vtctld.GetSrvKeyspaceNames:output_type -> vtctldata.GetSrvKeyspaceNamesResponse + 155, // 156: vtctlservice.Vtctld.GetSrvKeyspaces:output_type -> vtctldata.GetSrvKeyspacesResponse + 156, // 157: vtctlservice.Vtctld.UpdateThrottlerConfig:output_type -> vtctldata.UpdateThrottlerConfigResponse + 157, // 158: vtctlservice.Vtctld.GetSrvVSchema:output_type -> vtctldata.GetSrvVSchemaResponse + 158, // 159: vtctlservice.Vtctld.GetSrvVSchemas:output_type -> vtctldata.GetSrvVSchemasResponse + 159, // 160: vtctlservice.Vtctld.GetTablet:output_type -> vtctldata.GetTabletResponse + 160, // 161: vtctlservice.Vtctld.GetTablets:output_type -> vtctldata.GetTabletsResponse + 161, // 162: vtctlservice.Vtctld.GetTopologyPath:output_type -> vtctldata.GetTopologyPathResponse + 162, // 163: vtctlservice.Vtctld.GetVersion:output_type -> vtctldata.GetVersionResponse + 163, // 164: vtctlservice.Vtctld.GetVSchema:output_type -> vtctldata.GetVSchemaResponse + 164, // 165: vtctlservice.Vtctld.GetWorkflows:output_type -> vtctldata.GetWorkflowsResponse + 165, // 166: vtctlservice.Vtctld.InitShardPrimary:output_type -> vtctldata.InitShardPrimaryResponse + 166, // 167: vtctlservice.Vtctld.LaunchSchemaMigration:output_type -> vtctldata.LaunchSchemaMigrationResponse + 167, // 168: vtctlservice.Vtctld.LookupVindexCreate:output_type -> vtctldata.LookupVindexCreateResponse + 168, // 169: vtctlservice.Vtctld.LookupVindexExternalize:output_type -> vtctldata.LookupVindexExternalizeResponse + 169, // 170: vtctlservice.Vtctld.MaterializeCreate:output_type -> vtctldata.MaterializeCreateResponse + 170, // 171: vtctlservice.Vtctld.MigrateCreate:output_type -> vtctldata.WorkflowStatusResponse + 171, // 172: vtctlservice.Vtctld.MountRegister:output_type -> vtctldata.MountRegisterResponse + 172, // 173: vtctlservice.Vtctld.MountUnregister:output_type -> vtctldata.MountUnregisterResponse + 173, // 174: vtctlservice.Vtctld.MountShow:output_type -> vtctldata.MountShowResponse + 174, // 175: vtctlservice.Vtctld.MountList:output_type -> vtctldata.MountListResponse + 170, // 176: vtctlservice.Vtctld.MoveTablesCreate:output_type -> vtctldata.WorkflowStatusResponse + 175, // 177: vtctlservice.Vtctld.MoveTablesComplete:output_type -> vtctldata.MoveTablesCompleteResponse + 176, // 178: vtctlservice.Vtctld.PingTablet:output_type -> vtctldata.PingTabletResponse + 177, // 179: vtctlservice.Vtctld.PlannedReparentShard:output_type -> vtctldata.PlannedReparentShardResponse + 178, // 180: vtctlservice.Vtctld.RebuildKeyspaceGraph:output_type -> vtctldata.RebuildKeyspaceGraphResponse + 179, // 181: vtctlservice.Vtctld.RebuildVSchemaGraph:output_type -> vtctldata.RebuildVSchemaGraphResponse + 180, // 182: vtctlservice.Vtctld.RefreshState:output_type -> vtctldata.RefreshStateResponse + 181, // 183: vtctlservice.Vtctld.RefreshStateByShard:output_type -> vtctldata.RefreshStateByShardResponse + 182, // 184: vtctlservice.Vtctld.ReloadSchema:output_type -> vtctldata.ReloadSchemaResponse + 183, // 185: vtctlservice.Vtctld.ReloadSchemaKeyspace:output_type -> vtctldata.ReloadSchemaKeyspaceResponse + 184, // 186: vtctlservice.Vtctld.ReloadSchemaShard:output_type -> vtctldata.ReloadSchemaShardResponse + 185, // 187: vtctlservice.Vtctld.RemoveBackup:output_type -> vtctldata.RemoveBackupResponse + 186, // 188: vtctlservice.Vtctld.RemoveKeyspaceCell:output_type -> vtctldata.RemoveKeyspaceCellResponse + 187, // 189: vtctlservice.Vtctld.RemoveShardCell:output_type -> vtctldata.RemoveShardCellResponse + 188, // 190: vtctlservice.Vtctld.ReparentTablet:output_type -> vtctldata.ReparentTabletResponse + 170, // 191: vtctlservice.Vtctld.ReshardCreate:output_type -> vtctldata.WorkflowStatusResponse + 189, // 192: vtctlservice.Vtctld.RestoreFromBackup:output_type -> vtctldata.RestoreFromBackupResponse + 190, // 193: vtctlservice.Vtctld.RetrySchemaMigration:output_type -> vtctldata.RetrySchemaMigrationResponse + 191, // 194: vtctlservice.Vtctld.RunHealthCheck:output_type -> vtctldata.RunHealthCheckResponse + 192, // 195: vtctlservice.Vtctld.SetKeyspaceDurabilityPolicy:output_type -> vtctldata.SetKeyspaceDurabilityPolicyResponse + 193, // 196: vtctlservice.Vtctld.SetShardIsPrimaryServing:output_type -> vtctldata.SetShardIsPrimaryServingResponse + 194, // 197: vtctlservice.Vtctld.SetShardTabletControl:output_type -> vtctldata.SetShardTabletControlResponse + 195, // 198: vtctlservice.Vtctld.SetWritable:output_type -> vtctldata.SetWritableResponse + 196, // 199: vtctlservice.Vtctld.ShardReplicationAdd:output_type -> vtctldata.ShardReplicationAddResponse + 197, // 200: vtctlservice.Vtctld.ShardReplicationFix:output_type -> vtctldata.ShardReplicationFixResponse + 198, // 201: vtctlservice.Vtctld.ShardReplicationPositions:output_type -> vtctldata.ShardReplicationPositionsResponse + 199, // 202: vtctlservice.Vtctld.ShardReplicationRemove:output_type -> vtctldata.ShardReplicationRemoveResponse + 200, // 203: vtctlservice.Vtctld.SleepTablet:output_type -> vtctldata.SleepTabletResponse + 201, // 204: vtctlservice.Vtctld.SourceShardAdd:output_type -> vtctldata.SourceShardAddResponse + 202, // 205: vtctlservice.Vtctld.SourceShardDelete:output_type -> vtctldata.SourceShardDeleteResponse + 203, // 206: vtctlservice.Vtctld.StartReplication:output_type -> vtctldata.StartReplicationResponse + 204, // 207: vtctlservice.Vtctld.StopReplication:output_type -> vtctldata.StopReplicationResponse + 205, // 208: vtctlservice.Vtctld.TabletExternallyReparented:output_type -> vtctldata.TabletExternallyReparentedResponse + 206, // 209: vtctlservice.Vtctld.UpdateCellInfo:output_type -> vtctldata.UpdateCellInfoResponse + 207, // 210: vtctlservice.Vtctld.UpdateCellsAlias:output_type -> vtctldata.UpdateCellsAliasResponse + 208, // 211: vtctlservice.Vtctld.Validate:output_type -> vtctldata.ValidateResponse + 209, // 212: vtctlservice.Vtctld.ValidateKeyspace:output_type -> vtctldata.ValidateKeyspaceResponse + 210, // 213: vtctlservice.Vtctld.ValidateSchemaKeyspace:output_type -> vtctldata.ValidateSchemaKeyspaceResponse + 211, // 214: vtctlservice.Vtctld.ValidateShard:output_type -> vtctldata.ValidateShardResponse + 212, // 215: vtctlservice.Vtctld.ValidateVersionKeyspace:output_type -> vtctldata.ValidateVersionKeyspaceResponse + 213, // 216: vtctlservice.Vtctld.ValidateVersionShard:output_type -> vtctldata.ValidateVersionShardResponse + 214, // 217: vtctlservice.Vtctld.ValidateVSchema:output_type -> vtctldata.ValidateVSchemaResponse + 215, // 218: vtctlservice.Vtctld.VDiffCreate:output_type -> vtctldata.VDiffCreateResponse + 216, // 219: vtctlservice.Vtctld.VDiffDelete:output_type -> vtctldata.VDiffDeleteResponse + 217, // 220: vtctlservice.Vtctld.VDiffResume:output_type -> vtctldata.VDiffResumeResponse + 218, // 221: vtctlservice.Vtctld.VDiffShow:output_type -> vtctldata.VDiffShowResponse + 219, // 222: vtctlservice.Vtctld.VDiffStop:output_type -> vtctldata.VDiffStopResponse + 220, // 223: vtctlservice.Vtctld.WorkflowDelete:output_type -> vtctldata.WorkflowDeleteResponse + 170, // 224: vtctlservice.Vtctld.WorkflowStatus:output_type -> vtctldata.WorkflowStatusResponse + 221, // 225: vtctlservice.Vtctld.WorkflowSwitchTraffic:output_type -> vtctldata.WorkflowSwitchTrafficResponse + 222, // 226: vtctlservice.Vtctld.WorkflowUpdate:output_type -> vtctldata.WorkflowUpdateResponse + 223, // 227: vtctlservice.Vtctld.ApplyMirrorRules:output_type -> vtctldata.ApplyMirrorRulesResponse + 224, // 228: vtctlservice.Vtctld.GetMirrorRules:output_type -> vtctldata.GetMirrorRulesResponse + 225, // 229: vtctlservice.Vtctld.WorkflowMirrorTraffic:output_type -> vtctldata.WorkflowMirrorTrafficResponse + 115, // [115:230] is the sub-list for method output_type + 0, // [0:115] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name diff --git a/go/vt/proto/vtctlservice/vtctlservice_grpc.pb.go b/go/vt/proto/vtctlservice/vtctlservice_grpc.pb.go index f7996d22231..ef41a7755c1 100644 --- a/go/vt/proto/vtctlservice/vtctlservice_grpc.pb.go +++ b/go/vt/proto/vtctlservice/vtctlservice_grpc.pb.go @@ -452,6 +452,11 @@ type VtctldClient interface { // WorkflowUpdate updates the configuration of a vreplication workflow // using the provided updated parameters. WorkflowUpdate(ctx context.Context, in *vtctldata.WorkflowUpdateRequest, opts ...grpc.CallOption) (*vtctldata.WorkflowUpdateResponse, error) + // ApplyMirrorRules applies the VSchema routing rules. + ApplyMirrorRules(ctx context.Context, in *vtctldata.ApplyMirrorRulesRequest, opts ...grpc.CallOption) (*vtctldata.ApplyMirrorRulesResponse, error) + // GetMirrorRules returns the VSchema routing rules. + GetMirrorRules(ctx context.Context, in *vtctldata.GetMirrorRulesRequest, opts ...grpc.CallOption) (*vtctldata.GetMirrorRulesResponse, error) + WorkflowMirrorTraffic(ctx context.Context, in *vtctldata.WorkflowMirrorTrafficRequest, opts ...grpc.CallOption) (*vtctldata.WorkflowMirrorTrafficResponse, error) } type vtctldClient struct { @@ -1530,6 +1535,33 @@ func (c *vtctldClient) WorkflowUpdate(ctx context.Context, in *vtctldata.Workflo return out, nil } +func (c *vtctldClient) ApplyMirrorRules(ctx context.Context, in *vtctldata.ApplyMirrorRulesRequest, opts ...grpc.CallOption) (*vtctldata.ApplyMirrorRulesResponse, error) { + out := new(vtctldata.ApplyMirrorRulesResponse) + err := c.cc.Invoke(ctx, "/vtctlservice.Vtctld/ApplyMirrorRules", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *vtctldClient) GetMirrorRules(ctx context.Context, in *vtctldata.GetMirrorRulesRequest, opts ...grpc.CallOption) (*vtctldata.GetMirrorRulesResponse, error) { + out := new(vtctldata.GetMirrorRulesResponse) + err := c.cc.Invoke(ctx, "/vtctlservice.Vtctld/GetMirrorRules", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *vtctldClient) WorkflowMirrorTraffic(ctx context.Context, in *vtctldata.WorkflowMirrorTrafficRequest, opts ...grpc.CallOption) (*vtctldata.WorkflowMirrorTrafficResponse, error) { + out := new(vtctldata.WorkflowMirrorTrafficResponse) + err := c.cc.Invoke(ctx, "/vtctlservice.Vtctld/WorkflowMirrorTraffic", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // VtctldServer is the server API for Vtctld service. // All implementations must embed UnimplementedVtctldServer // for forward compatibility @@ -1850,6 +1882,11 @@ type VtctldServer interface { // WorkflowUpdate updates the configuration of a vreplication workflow // using the provided updated parameters. WorkflowUpdate(context.Context, *vtctldata.WorkflowUpdateRequest) (*vtctldata.WorkflowUpdateResponse, error) + // ApplyMirrorRules applies the VSchema routing rules. + ApplyMirrorRules(context.Context, *vtctldata.ApplyMirrorRulesRequest) (*vtctldata.ApplyMirrorRulesResponse, error) + // GetMirrorRules returns the VSchema routing rules. + GetMirrorRules(context.Context, *vtctldata.GetMirrorRulesRequest) (*vtctldata.GetMirrorRulesResponse, error) + WorkflowMirrorTraffic(context.Context, *vtctldata.WorkflowMirrorTrafficRequest) (*vtctldata.WorkflowMirrorTrafficResponse, error) mustEmbedUnimplementedVtctldServer() } @@ -2190,6 +2227,15 @@ func (UnimplementedVtctldServer) WorkflowSwitchTraffic(context.Context, *vtctlda func (UnimplementedVtctldServer) WorkflowUpdate(context.Context, *vtctldata.WorkflowUpdateRequest) (*vtctldata.WorkflowUpdateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method WorkflowUpdate not implemented") } +func (UnimplementedVtctldServer) ApplyMirrorRules(context.Context, *vtctldata.ApplyMirrorRulesRequest) (*vtctldata.ApplyMirrorRulesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ApplyMirrorRules not implemented") +} +func (UnimplementedVtctldServer) GetMirrorRules(context.Context, *vtctldata.GetMirrorRulesRequest) (*vtctldata.GetMirrorRulesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMirrorRules not implemented") +} +func (UnimplementedVtctldServer) WorkflowMirrorTraffic(context.Context, *vtctldata.WorkflowMirrorTrafficRequest) (*vtctldata.WorkflowMirrorTrafficResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WorkflowMirrorTraffic not implemented") +} func (UnimplementedVtctldServer) mustEmbedUnimplementedVtctldServer() {} // UnsafeVtctldServer may be embedded to opt out of forward compatibility for this service. @@ -4210,6 +4256,60 @@ func _Vtctld_WorkflowUpdate_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Vtctld_ApplyMirrorRules_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(vtctldata.ApplyMirrorRulesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VtctldServer).ApplyMirrorRules(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vtctlservice.Vtctld/ApplyMirrorRules", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VtctldServer).ApplyMirrorRules(ctx, req.(*vtctldata.ApplyMirrorRulesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Vtctld_GetMirrorRules_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(vtctldata.GetMirrorRulesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VtctldServer).GetMirrorRules(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vtctlservice.Vtctld/GetMirrorRules", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VtctldServer).GetMirrorRules(ctx, req.(*vtctldata.GetMirrorRulesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Vtctld_WorkflowMirrorTraffic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(vtctldata.WorkflowMirrorTrafficRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VtctldServer).WorkflowMirrorTraffic(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vtctlservice.Vtctld/WorkflowMirrorTraffic", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VtctldServer).WorkflowMirrorTraffic(ctx, req.(*vtctldata.WorkflowMirrorTrafficRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Vtctld_ServiceDesc is the grpc.ServiceDesc for Vtctld service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -4649,6 +4749,18 @@ var Vtctld_ServiceDesc = grpc.ServiceDesc{ MethodName: "WorkflowUpdate", Handler: _Vtctld_WorkflowUpdate_Handler, }, + { + MethodName: "ApplyMirrorRules", + Handler: _Vtctld_ApplyMirrorRules_Handler, + }, + { + MethodName: "GetMirrorRules", + Handler: _Vtctld_GetMirrorRules_Handler, + }, + { + MethodName: "WorkflowMirrorTraffic", + Handler: _Vtctld_WorkflowMirrorTraffic_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/go/vt/topo/server.go b/go/vt/topo/server.go index 1995e8b6ec4..e20c810ef14 100644 --- a/go/vt/topo/server.go +++ b/go/vt/topo/server.go @@ -79,6 +79,7 @@ const ( RoutingRulesFile = "RoutingRules" ExternalClustersFile = "ExternalClusters" ShardRoutingRulesFile = "ShardRoutingRules" + MirrorRulesFile = "MirrorRules" ) // Path for all object types. diff --git a/go/vt/topo/srv_vschema.go b/go/vt/topo/srv_vschema.go index 453e8c5f8d0..3f95c1fc3ab 100644 --- a/go/vt/topo/srv_vschema.go +++ b/go/vt/topo/srv_vschema.go @@ -204,6 +204,12 @@ func (ts *Server) RebuildSrvVSchema(ctx context.Context, cells []string) error { } srvVSchema.ShardRoutingRules = srr + mr, err := ts.GetMirrorRules(ctx) + if err != nil { + return fmt.Errorf("GetMirrorRules failed: %v", err) + } + srvVSchema.MirrorRules = mr + // now save the SrvVSchema in all cells in parallel for _, cell := range cells { wg.Add(1) diff --git a/go/vt/topo/vschema.go b/go/vt/topo/vschema.go index 0f63a26c2ae..733a9ca79bc 100644 --- a/go/vt/topo/vschema.go +++ b/go/vt/topo/vschema.go @@ -158,3 +158,39 @@ func (ts *Server) GetShardRoutingRules(ctx context.Context) (*vschemapb.ShardRou } return srr, nil } + +// GetMirrorRules fetches the mirror rules from the topo. +func (ts *Server) GetMirrorRules(ctx context.Context) (*vschemapb.MirrorRules, error) { + rr := &vschemapb.MirrorRules{} + data, _, err := ts.globalCell.Get(ctx, MirrorRulesFile) + if err != nil { + if IsErrType(err, NoNode) { + return rr, nil + } + return nil, err + } + err = rr.UnmarshalVT(data) + if err != nil { + return nil, vterrors.Wrapf(err, "bad mirror rules data: %q", data) + } + return rr, nil +} + +// SaveMirrorRules saves the mirror rules into the topo. +func (ts *Server) SaveMirrorRules(ctx context.Context, mirrorRules *vschemapb.MirrorRules) error { + data, err := mirrorRules.MarshalVT() + if err != nil { + return err + } + + if len(data) == 0 { + // No vschema, remove it. So we can remove the keyspace. + if err := ts.globalCell.Delete(ctx, MirrorRulesFile, nil); err != nil && !IsErrType(err, NoNode) { + return err + } + return nil + } + + _, err = ts.globalCell.Update(ctx, MirrorRulesFile, data, nil) + return err +} diff --git a/go/vt/topotools/mirror_rules.go b/go/vt/topotools/mirror_rules.go new file mode 100644 index 00000000000..e968b01e199 --- /dev/null +++ b/go/vt/topotools/mirror_rules.go @@ -0,0 +1,77 @@ +/* +Copyright 2024 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. +*/ + +package topotools + +import ( + "context" + + "vitess.io/vitess/go/vt/log" + "vitess.io/vitess/go/vt/topo" + + vschemapb "vitess.io/vitess/go/vt/proto/vschema" +) + +type MirrorRule struct { + Percent float32 + ToKeyspace string +} + +//region mirror rules + +func GetMirrorRulesMap(rules *vschemapb.MirrorRules) map[string]MirrorRule { + if rules == nil { + return nil + } + rulesMap := make(map[string]MirrorRule, len(rules.Rules)) + for _, mr := range rules.Rules { + rulesMap[mr.FromKeyspace] = MirrorRule{ + mr.Percent, + mr.ToKeyspace, + } + } + return rulesMap +} + +// GetMirrorRules fetches mirror rules from the topology server and returns a +// mapping of fromKeyspace=>*MirrorRule. +func GetMirrorRules(ctx context.Context, ts *topo.Server) (map[string]MirrorRule, error) { + mrs, err := ts.GetMirrorRules(ctx) + if err != nil { + return nil, err + } + + rules := GetMirrorRulesMap(mrs) + + return rules, nil +} + +// SaveMirrorRules converts a mapping of fromTable=>[]toTables into a +// vschemapb.MirrorRules protobuf message and saves it in the topology. +func SaveMirrorRules(ctx context.Context, ts *topo.Server, rules map[string]MirrorRule) error { + log.Infof("Saving mirror rules %v\n", rules) + + rrs := &vschemapb.MirrorRules{Rules: make([]*vschemapb.MirrorRule, 0, len(rules))} + for from, r := range rules { + rrs.Rules = append(rrs.Rules, &vschemapb.MirrorRule{ + FromKeyspace: from, + Percent: r.Percent, + ToKeyspace: r.ToKeyspace, + }) + } + + return ts.SaveMirrorRules(ctx, rrs) +} diff --git a/go/vt/vtctl/grpcvtctldclient/client_gen.go b/go/vt/vtctl/grpcvtctldclient/client_gen.go index c1d251487fd..4f795ca005b 100644 --- a/go/vt/vtctl/grpcvtctldclient/client_gen.go +++ b/go/vt/vtctl/grpcvtctldclient/client_gen.go @@ -47,6 +47,15 @@ func (client *gRPCVtctldClient) AddCellsAlias(ctx context.Context, in *vtctldata return client.c.AddCellsAlias(ctx, in, opts...) } +// ApplyMirrorRules is part of the vtctlservicepb.VtctldClient interface. +func (client *gRPCVtctldClient) ApplyMirrorRules(ctx context.Context, in *vtctldatapb.ApplyMirrorRulesRequest, opts ...grpc.CallOption) (*vtctldatapb.ApplyMirrorRulesResponse, error) { + if client.c == nil { + return nil, status.Error(codes.Unavailable, connClosedMsg) + } + + return client.c.ApplyMirrorRules(ctx, in, opts...) +} + // ApplyRoutingRules is part of the vtctlservicepb.VtctldClient interface. func (client *gRPCVtctldClient) ApplyRoutingRules(ctx context.Context, in *vtctldatapb.ApplyRoutingRulesRequest, opts ...grpc.CallOption) (*vtctldatapb.ApplyRoutingRulesResponse, error) { if client.c == nil { @@ -326,6 +335,15 @@ func (client *gRPCVtctldClient) GetKeyspaces(ctx context.Context, in *vtctldatap return client.c.GetKeyspaces(ctx, in, opts...) } +// GetMirrorRules is part of the vtctlservicepb.VtctldClient interface. +func (client *gRPCVtctldClient) GetMirrorRules(ctx context.Context, in *vtctldatapb.GetMirrorRulesRequest, opts ...grpc.CallOption) (*vtctldatapb.GetMirrorRulesResponse, error) { + if client.c == nil { + return nil, status.Error(codes.Unavailable, connClosedMsg) + } + + return client.c.GetMirrorRules(ctx, in, opts...) +} + // GetPermissions is part of the vtctlservicepb.VtctldClient interface. func (client *gRPCVtctldClient) GetPermissions(ctx context.Context, in *vtctldatapb.GetPermissionsRequest, opts ...grpc.CallOption) (*vtctldatapb.GetPermissionsResponse, error) { if client.c == nil { @@ -1001,6 +1019,15 @@ func (client *gRPCVtctldClient) WorkflowDelete(ctx context.Context, in *vtctldat return client.c.WorkflowDelete(ctx, in, opts...) } +// WorkflowMirrorTraffic is part of the vtctlservicepb.VtctldClient interface. +func (client *gRPCVtctldClient) WorkflowMirrorTraffic(ctx context.Context, in *vtctldatapb.WorkflowMirrorTrafficRequest, opts ...grpc.CallOption) (*vtctldatapb.WorkflowMirrorTrafficResponse, error) { + if client.c == nil { + return nil, status.Error(codes.Unavailable, connClosedMsg) + } + + return client.c.WorkflowMirrorTraffic(ctx, in, opts...) +} + // WorkflowStatus is part of the vtctlservicepb.VtctldClient interface. func (client *gRPCVtctldClient) WorkflowStatus(ctx context.Context, in *vtctldatapb.WorkflowStatusRequest, opts ...grpc.CallOption) (*vtctldatapb.WorkflowStatusResponse, error) { if client.c == nil { diff --git a/go/vt/vtctl/grpcvtctldserver/server.go b/go/vt/vtctl/grpcvtctldserver/server.go index 0d131e36f96..1127256f133 100644 --- a/go/vt/vtctl/grpcvtctldserver/server.go +++ b/go/vt/vtctl/grpcvtctldserver/server.go @@ -4991,6 +4991,67 @@ func (s *VtctldServer) WorkflowUpdate(ctx context.Context, req *vtctldatapb.Work return resp, err } +// ApplyMirrorRules is part of the vtctlservicepb.VtctldServer interface. +func (s *VtctldServer) ApplyMirrorRules(ctx context.Context, req *vtctldatapb.ApplyMirrorRulesRequest) (resp *vtctldatapb.ApplyMirrorRulesResponse, err error) { + span, ctx := trace.NewSpan(ctx, "VtctldServer.ApplyMirrorRules") + defer span.Finish() + + defer panicHandler(&err) + + span.Annotate("skip_rebuild", req.SkipRebuild) + span.Annotate("rebuild_cells", strings.Join(req.RebuildCells, ",")) + + if err = s.ts.SaveMirrorRules(ctx, req.MirrorRules); err != nil { + return nil, err + } + + resp = &vtctldatapb.ApplyMirrorRulesResponse{} + + if req.SkipRebuild { + log.Warningf("Skipping rebuild of SrvVSchema, will need to run RebuildVSchemaGraph for changes to take effect") + return resp, nil + } + + if err = s.ts.RebuildSrvVSchema(ctx, req.RebuildCells); err != nil { + err = vterrors.Wrapf(err, "RebuildSrvVSchema(%v) failed: %v", req.RebuildCells, err) + return nil, err + } + + return resp, nil +} + +// GetMirrorRules is part of the vtctlservicepb.VtctldServer interface. +func (s *VtctldServer) GetMirrorRules(ctx context.Context, req *vtctldatapb.GetMirrorRulesRequest) (resp *vtctldatapb.GetMirrorRulesResponse, err error) { + span, ctx := trace.NewSpan(ctx, "VtctldServer.GetMirrorRules") + defer span.Finish() + + defer panicHandler(&err) + + mr, err := s.ts.GetMirrorRules(ctx) + if err != nil { + return nil, err + } + + return &vtctldatapb.GetMirrorRulesResponse{ + MirrorRules: mr, + }, nil +} + +// WorkflowMirrorTraffic is part of the vtctlservicepb.VtctldServer interface. +func (s *VtctldServer) WorkflowMirrorTraffic(ctx context.Context, req *vtctldatapb.WorkflowMirrorTrafficRequest) (resp *vtctldatapb.WorkflowMirrorTrafficResponse, err error) { + span, ctx := trace.NewSpan(ctx, "VtctldServer.WorkflowMirrorTraffic") + defer span.Finish() + + defer panicHandler(&err) + + span.Annotate("keyspace", req.Keyspace) + span.Annotate("workflow", req.Workflow) + span.Annotate("percent", req.Percent) + + resp, err = s.ws.WorkflowMirrorTraffic(ctx, req) + return resp, err +} + // StartServer registers a VtctldServer for RPCs on the given gRPC server. func StartServer(s *grpc.Server, env *vtenv.Environment, ts *topo.Server) { vtctlservicepb.RegisterVtctldServer(s, NewVtctldServer(env, ts)) diff --git a/go/vt/vtctl/localvtctldclient/client_gen.go b/go/vt/vtctl/localvtctldclient/client_gen.go index cbde68f1b27..980c51ec824 100644 --- a/go/vt/vtctl/localvtctldclient/client_gen.go +++ b/go/vt/vtctl/localvtctldclient/client_gen.go @@ -39,6 +39,11 @@ func (client *localVtctldClient) AddCellsAlias(ctx context.Context, in *vtctldat return client.s.AddCellsAlias(ctx, in) } +// ApplyMirrorRules is part of the vtctlservicepb.VtctldClient interface. +func (client *localVtctldClient) ApplyMirrorRules(ctx context.Context, in *vtctldatapb.ApplyMirrorRulesRequest, opts ...grpc.CallOption) (*vtctldatapb.ApplyMirrorRulesResponse, error) { + return client.s.ApplyMirrorRules(ctx, in) +} + // ApplyRoutingRules is part of the vtctlservicepb.VtctldClient interface. func (client *localVtctldClient) ApplyRoutingRules(ctx context.Context, in *vtctldatapb.ApplyRoutingRulesRequest, opts ...grpc.CallOption) (*vtctldatapb.ApplyRoutingRulesResponse, error) { return client.s.ApplyRoutingRules(ctx, in) @@ -286,6 +291,11 @@ func (client *localVtctldClient) GetKeyspaces(ctx context.Context, in *vtctldata return client.s.GetKeyspaces(ctx, in) } +// GetMirrorRules is part of the vtctlservicepb.VtctldClient interface. +func (client *localVtctldClient) GetMirrorRules(ctx context.Context, in *vtctldatapb.GetMirrorRulesRequest, opts ...grpc.CallOption) (*vtctldatapb.GetMirrorRulesResponse, error) { + return client.s.GetMirrorRules(ctx, in) +} + // GetPermissions is part of the vtctlservicepb.VtctldClient interface. func (client *localVtctldClient) GetPermissions(ctx context.Context, in *vtctldatapb.GetPermissionsRequest, opts ...grpc.CallOption) (*vtctldatapb.GetPermissionsResponse, error) { return client.s.GetPermissions(ctx, in) @@ -707,6 +717,11 @@ func (client *localVtctldClient) WorkflowDelete(ctx context.Context, in *vtctlda return client.s.WorkflowDelete(ctx, in) } +// WorkflowMirrorTraffic is part of the vtctlservicepb.VtctldClient interface. +func (client *localVtctldClient) WorkflowMirrorTraffic(ctx context.Context, in *vtctldatapb.WorkflowMirrorTrafficRequest, opts ...grpc.CallOption) (*vtctldatapb.WorkflowMirrorTrafficResponse, error) { + return client.s.WorkflowMirrorTraffic(ctx, in) +} + // WorkflowStatus is part of the vtctlservicepb.VtctldClient interface. func (client *localVtctldClient) WorkflowStatus(ctx context.Context, in *vtctldatapb.WorkflowStatusRequest, opts ...grpc.CallOption) (*vtctldatapb.WorkflowStatusResponse, error) { return client.s.WorkflowStatus(ctx, in) diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index e298d3f64f3..c52f5acc551 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -107,6 +107,7 @@ type vdiffOutput struct { } const ( + cannotMirrorSwitched = "cannot mirror traffic after workflow traffic is switched" cannotSwitchError = "workflow has errors" cannotSwitchCopyIncomplete = "copy is still in progress" cannotSwitchHighLag = "replication lag %ds is higher than allowed lag %ds" @@ -3899,3 +3900,87 @@ func (s *Server) MigrateCreate(ctx context.Context, req *vtctldatapb.MigrateCrea } return s.moveTablesCreate(ctx, moveTablesCreateRequest, binlogdatapb.VReplicationWorkflowType_Migrate) } + +// WorkflowMirrorTraffic mirrors traffic from the source keyspace to the target keyspace. +func (s *Server) WorkflowMirrorTraffic(ctx context.Context, req *vtctldatapb.WorkflowMirrorTrafficRequest) (*vtctldatapb.WorkflowMirrorTrafficResponse, error) { + ts, startState, err := s.getWorkflowState(ctx, req.Keyspace, req.Workflow) + if err != nil { + return nil, err + } + + if startState.WorkflowType == TypeMigrate { + return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "invalid action for Migrate workflow: MirrorTraffic") + } + + reason, err := s.canMirror(startState) + if err != nil { + return nil, err + } + if reason != "" { + return nil, vterrors.Errorf(vtrpcpb.Code_FAILED_PRECONDITION, "cannot mirror traffic for workflow %s at this time: %s", startState.Workflow, reason) + } + if err := s.mirrorTraffic(ctx, req, ts, startState); err != nil { + return nil, err + } + cmd := "MirrorTraffic" + resp := &vtctldatapb.WorkflowMirrorTrafficResponse{} + log.Infof("Mirror Traffic done for workflow %s.%s", req.Keyspace, req.Workflow) + resp.Summary = fmt.Sprintf("%s was successful for workflow %s.%s", cmd, req.Keyspace, req.Workflow) + // Reload the state after the MirrorTraffic operation + // and return that as a string. + keyspace := req.Keyspace + workflow := req.Workflow + resp.StartState = startState.String() + log.Infof("Before reloading workflow state after mirror traffic: %+v\n", resp.StartState) + _, currentState, err := s.getWorkflowState(ctx, keyspace, workflow) + if err != nil { + resp.CurrentState = fmt.Sprintf("Error reloading workflow state after mirror traffic: %v", err) + } else { + resp.CurrentState = currentState.String() + } + return resp, nil +} + +func (s *Server) canMirror(state *State) (reason string, err error) { + if len(state.RdonlyCellsSwitched) > 0 || len(state.ReplicaCellsSwitched) > 0 || + len(state.ShardsAlreadySwitched) > 0 || state.WritesSwitched { + return cannotMirrorSwitched, nil + } + + return "", nil +} + +// mirrorTraffic manages mirror routing rules for tables in the workflow. +func (s *Server) mirrorTraffic(ctx context.Context, req *vtctldatapb.WorkflowMirrorTrafficRequest, ts *trafficSwitcher, state *State) (err error) { + // Consistently handle errors by logging and returning them. + handleError := func(message string, err error) error { + ts.Logger().Error(err) + return err + } + + log.Infof("Mirroring traffic: %s.%s, workflow state: %s", ts.targetKeyspace, ts.workflow, state.String()) + + sw := &switcher{ts: ts, s: s} + + if err := ts.validate(ctx); err != nil { + return handleError("workflow validation failed", err) + } + + // For reads, locking the source keyspace is sufficient. + ctx, unlock, lockErr := sw.lockKeyspace(ctx, ts.SourceKeyspaceName(), "MirrorTraffic") + if lockErr != nil { + return handleError(fmt.Sprintf("failed to lock the %s keyspace", ts.SourceKeyspaceName()), lockErr) + } + defer unlock(&err) + + if ts.MigrationType() == binlogdatapb.MigrationType_TABLES { + if ts.isPartialMigration { + ts.Logger().Infof("Partial migration, mirror traffic is not currently supported.") + } else if err := sw.mirrorTableTraffic(ctx, req.Percent); err != nil { + return handleError("failed to mirror traffic for the tables", err) + } + return nil + } + + return nil +} diff --git a/go/vt/vtctl/workflow/switcher.go b/go/vt/vtctl/workflow/switcher.go index 0cbdce164dc..3a00d0687fc 100644 --- a/go/vt/vtctl/workflow/switcher.go +++ b/go/vt/vtctl/workflow/switcher.go @@ -149,3 +149,7 @@ func (r *switcher) resetSequences(ctx context.Context) error { func (r *switcher) initializeTargetSequences(ctx context.Context, sequencesByBackingTable map[string]*sequenceMetadata) error { return r.ts.initializeTargetSequences(ctx, sequencesByBackingTable) } + +func (r *switcher) mirrorTableTraffic(ctx context.Context, percent float32) error { + return r.ts.mirrorTableTraffic(ctx, percent) +} diff --git a/go/vt/vtctl/workflow/traffic_switcher.go b/go/vt/vtctl/workflow/traffic_switcher.go index 890ffd098a0..40746e54161 100644 --- a/go/vt/vtctl/workflow/traffic_switcher.go +++ b/go/vt/vtctl/workflow/traffic_switcher.go @@ -1561,3 +1561,23 @@ func (ts *trafficSwitcher) resetSequences(ctx context.Context) error { return ts.TabletManagerClient().ResetSequences(ctx, source.GetPrimary().Tablet, ts.Tables()) }) } + +func (ts *trafficSwitcher) mirrorTableTraffic(ctx context.Context, percent float32) error { + log.Infof("mirrorTableTraffic") + + mrs, err := topotools.GetMirrorRules(ctx, ts.TopoServer()) + if err != nil { + return err + } + + mrs[ts.SourceKeyspaceName()] = topotools.MirrorRule{ + ToKeyspace: ts.TargetKeyspaceName(), + Percent: percent, + } + + if err := topotools.SaveMirrorRules(ctx, ts.TopoServer(), mrs); err != nil { + return err + } + + return ts.TopoServer().RebuildSrvVSchema(ctx, nil) +} diff --git a/go/vt/vtgate/engine/cached_size.go b/go/vt/vtgate/engine/cached_size.go index 5f0e79f5608..84490b4a4cc 100644 --- a/go/vt/vtgate/engine/cached_size.go +++ b/go/vt/vtgate/engine/cached_size.go @@ -684,6 +684,24 @@ func (cached *MergeSort) CachedSize(alloc bool) int64 { } return size } +func (cached *Mirror) CachedSize(alloc bool) int64 { + if cached == nil { + return int64(0) + } + size := int64(0) + if alloc { + size += int64(32) + } + // field Primitive vitess.io/vitess/go/vt/vtgate/engine.Primitive + if cc, ok := cached.Primitive.(cachedObject); ok { + size += cc.CachedSize(true) + } + // field Target vitess.io/vitess/go/vt/vtgate/engine.MirrorTarget + if cc, ok := cached.Target.(cachedObject); ok { + size += cc.CachedSize(true) + } + return size +} func (cached *NonLiteralUpdateInfo) CachedSize(alloc bool) int64 { if cached == nil { return int64(0) @@ -750,6 +768,20 @@ func (cached *OrderedAggregate) CachedSize(alloc bool) int64 { size += cached.CollationEnv.CachedSize(true) return size } +func (cached *PercentMirrorTarget) CachedSize(alloc bool) int64 { + if cached == nil { + return int64(0) + } + size := int64(0) + if alloc { + size += int64(24) + } + // field Primitive vitess.io/vitess/go/vt/vtgate/engine.Primitive + if cc, ok := cached.Primitive.(cachedObject); ok { + size += cc.CachedSize(true) + } + return size +} func (cached *Plan) CachedSize(alloc bool) int64 { if cached == nil { return int64(0) @@ -773,11 +805,11 @@ func (cached *Plan) CachedSize(alloc bool) int64 { size += elem.CachedSize(true) } } - // field TablesUsed []string + // field TablesUsed vitess.io/vitess/go/vt/sqlparser.TableNames { - size += hack.RuntimeAllocSize(int64(cap(cached.TablesUsed)) * int64(16)) + size += hack.RuntimeAllocSize(int64(cap(cached.TablesUsed)) * int64(32)) for _, elem := range cached.TablesUsed { - size += hack.RuntimeAllocSize(int64(len(elem))) + size += elem.CachedSize(false) } } return size diff --git a/go/vt/vtgate/engine/fake_vcursor_test.go b/go/vt/vtgate/engine/fake_vcursor_test.go index 08a40c0d835..64a519eab4f 100644 --- a/go/vt/vtgate/engine/fake_vcursor_test.go +++ b/go/vt/vtgate/engine/fake_vcursor_test.go @@ -112,6 +112,10 @@ func (t *noopVCursor) CloneForReplicaWarming(ctx context.Context) VCursor { panic("implement me") } +func (t *noopVCursor) CloneForMirroring(ctx context.Context) VCursor { + panic("implement me") +} + func (t *noopVCursor) SetExec(ctx context.Context, name string, value string) error { panic("implement me") } @@ -421,6 +425,8 @@ type loggingVCursor struct { shardSession []*srvtopo.ResolvedShard parser *sqlparser.Parser + + mirrorClonesFn func(context.Context) VCursor } func (f *loggingVCursor) HasCreatedTempTable() { @@ -536,6 +542,13 @@ func (f *loggingVCursor) CloneForReplicaWarming(ctx context.Context) VCursor { return f } +func (f *loggingVCursor) CloneForMirroring(ctx context.Context) VCursor { + if f.mirrorClonesFn != nil { + return f.mirrorClonesFn(ctx) + } + panic("no mirror clones available") +} + func (f *loggingVCursor) Execute(ctx context.Context, method string, query string, bindvars map[string]*querypb.BindVariable, rollbackOnError bool, co vtgatepb.CommitOrder) (*sqltypes.Result, error) { name := "Unknown" switch co { diff --git a/go/vt/vtgate/engine/mirror.go b/go/vt/vtgate/engine/mirror.go new file mode 100644 index 00000000000..50b7e308200 --- /dev/null +++ b/go/vt/vtgate/engine/mirror.go @@ -0,0 +1,184 @@ +/* +Copyright 2024 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. +*/ + +package engine + +import ( + "context" + "math/rand" + "sync" + + "vitess.io/vitess/go/sqltypes" + querypb "vitess.io/vitess/go/vt/proto/query" +) + +type ( + // Mirror represents the instructions to execute an authoritative source, + // and compare the results of that execution to those of one or more + // non-authoritative mirroring targets. + Mirror struct { + Primitive Primitive + Target MirrorTarget + } + + // MirrorTarget contains the Primitive for mirroring a query to the + // non-authoritative target of the Mirror primitive. + MirrorTarget interface { + Primitive + Accept() bool + } + + // PercentMirrorTarget contains the Primitive to mirror to, an will + // Accept() an execution based if a random dice-roll is less than Percent. + PercentMirrorTarget struct { + Percent float32 + Primitive Primitive + } +) + +var ( + _ Primitive = (*Mirror)(nil) + _ Primitive = (MirrorTarget)(nil) + _ Primitive = (*PercentMirrorTarget)(nil) + _ MirrorTarget = (*PercentMirrorTarget)(nil) +) + +// NewMirror creates a Mirror. +func NewMirror(primitive Primitive, target MirrorTarget) *Mirror { + return &Mirror{primitive, target} +} + +// NewPercentMirrorTarget creates a percentage-based Mirror target. +func NewPercentMirrorTarget(percent float32, primitive Primitive) *PercentMirrorTarget { + return &PercentMirrorTarget{percent, primitive} +} + +func (m *Mirror) RouteType() string { + return "Mirror" +} + +func (m *Mirror) GetKeyspaceName() string { + return m.Primitive.GetKeyspaceName() +} + +func (m *Mirror) GetTableName() string { + return m.Primitive.GetTableName() +} + +func (m *Mirror) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error) { + return m.Primitive.GetFields(ctx, vcursor, bindVars) +} + +func (m *Mirror) NeedsTransaction() bool { + return m.Primitive.NeedsTransaction() +} + +func (m *Mirror) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error) { + if m.Target.Accept() { + var wg sync.WaitGroup + defer wg.Wait() + wg.Add(1) + go func(target Primitive, vcursor VCursor) { + defer wg.Done() + _, _ = target.TryExecute(ctx, vcursor, bindVars, wantfields) + }(m.Target, vcursor.CloneForMirroring(ctx)) + } + + return m.Primitive.TryExecute(ctx, vcursor, bindVars, wantfields) +} + +// TODO(maxeng): does it make sense mirror stream executions? One of the goals +// of mirroring is to be able to compare the error codes returned by the main +// and mirrored queries. Can we do that here? +func (m *Mirror) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error { + if m.Target.Accept() { + var wg sync.WaitGroup + defer wg.Wait() + wg.Add(1) + go func(target Primitive, vcursor VCursor) { + defer wg.Done() + _ = target.TryStreamExecute(ctx, vcursor, bindVars, wantfields, func(_ *sqltypes.Result) error { + return nil + }) + }(m.Target, vcursor.CloneForMirroring(ctx)) + } + + return m.Primitive.TryStreamExecute(ctx, vcursor, bindVars, wantfields, callback) +} + +// Inputs is a slice containing the inputs to this Primitive. +// The returned map has additional information about the inputs, that is used in the description. +func (m *Mirror) Inputs() ([]Primitive, []map[string]any) { + return []Primitive{m.Primitive, m.Target}, nil +} + +// description is the description, sans the inputs, of this Primitive. +// to get the plan description with all children, use PrimitiveToPlanDescription() +func (m *Mirror) description() PrimitiveDescription { + return PrimitiveDescription{ + OperatorType: "Mirror", + } +} + +func (m *PercentMirrorTarget) RouteType() string { + return "PercentMirrorTarget" +} + +func (m *PercentMirrorTarget) GetKeyspaceName() string { + return m.Primitive.GetKeyspaceName() +} + +func (m *PercentMirrorTarget) GetTableName() string { + return m.Primitive.GetTableName() +} + +func (m *PercentMirrorTarget) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error) { + return m.Primitive.GetFields(ctx, vcursor, bindVars) +} + +func (m *PercentMirrorTarget) NeedsTransaction() bool { + return m.Primitive.NeedsTransaction() +} + +func (m *PercentMirrorTarget) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error) { + return m.Primitive.TryExecute(ctx, vcursor, bindVars, wantfields) +} + +func (m *PercentMirrorTarget) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error { + return m.Primitive.TryStreamExecute(ctx, vcursor, bindVars, wantfields, callback) +} + +// Inputs is a slice containing the inputs to this Primitive. +// The returned map has additional information about the inputs, that is used in the description. +func (m *PercentMirrorTarget) Inputs() ([]Primitive, []map[string]any) { + return []Primitive{m.Primitive}, nil +} + +// description is the description, sans the inputs, of this Primitive. +// to get the plan description with all children, use PrimitiveToPlanDescription() +func (m *PercentMirrorTarget) description() PrimitiveDescription { + return PrimitiveDescription{ + OperatorType: "MirrorTarget", + Variant: "Percent", + Other: map[string]any{ + "Percent": m.Percent, + }, + } +} + +func (m *PercentMirrorTarget) Accept() bool { + return m.Percent >= (rand.Float32() * 100.0) +} diff --git a/go/vt/vtgate/engine/mirror_test.go b/go/vt/vtgate/engine/mirror_test.go new file mode 100644 index 00000000000..b9478fddea4 --- /dev/null +++ b/go/vt/vtgate/engine/mirror_test.go @@ -0,0 +1,276 @@ +/* +Copyright 2024 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. +*/ + +package engine + +import ( + "context" + "fmt" + "testing" + + "github.com/stretchr/testify/require" + + "vitess.io/vitess/go/sqltypes" + querypb "vitess.io/vitess/go/vt/proto/query" + "vitess.io/vitess/go/vt/vtgate/evalengine" + "vitess.io/vitess/go/vt/vtgate/vindexes" +) + +func TestMirror(t *testing.T) { + vindex, _ := vindexes.CreateVindex("xxhash", "xxhash_vdx", nil) + + primitive := NewRoute( + Unsharded, + &vindexes.Keyspace{ + Name: "ks1", + }, + "select f.bar from foo f where f.id = 1", + "select 1 from foo f where f.id = 1 and 1 != 1", + ) + + mirrorPrimitive1 := NewRoute( + EqualUnique, + &vindexes.Keyspace{ + Name: "ks2", + Sharded: true, + }, + "select f.bar from foo f where f.id = 1", + "select 1 from foo f where f.id = 1 and 1 != 1", + ) + mirrorPrimitive1.Vindex = vindex.(vindexes.SingleColumn) + mirrorPrimitive1.Values = []evalengine.Expr{ + evalengine.NewLiteralInt(1), + } + + mirror := &Mirror{ + Primitive: primitive, + Target: &PercentMirrorTarget{ + Percent: 100, + Primitive: mirrorPrimitive1, + }, + } + + mirrorVc := &loggingVCursor{ + shards: []string{"-20", "20-"}, + ksShardMap: map[string][]string{ + "ks2": {"-20", "20-"}, + }, + results: []*sqltypes.Result{ + sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "bar", + "varchar", + ), + "hello", + ), + }, + } + + vc := &loggingVCursor{ + shards: []string{"0"}, + ksShardMap: map[string][]string{ + "ks1": {"0"}, + }, + results: []*sqltypes.Result{ + sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "bar", + "varchar", + ), + "hello", + ), + }, + mirrorClonesFn: func(ctx context.Context) VCursor { + return mirrorVc + }, + } + + t.Run("TryExecute success", func(t *testing.T) { + defer func() { + vc.Rewind() + mirrorVc.Rewind() + }() + + want := vc.results[0] + res, err := mirror.TryExecute(context.Background(), vc, map[string]*querypb.BindVariable{}, true) + require.Equal(t, want, res) + require.NoError(t, err) + + vc.ExpectLog(t, []string{ + "ResolveDestinations ks1 [] Destinations:DestinationAllShards()", + "ExecuteMultiShard ks1.0: select f.bar from foo f where f.id = 1 {} false false", + }) + mirrorVc.ExpectLog(t, []string{ + `ResolveDestinations ks2 [type:INT64 value:"1"] Destinations:DestinationKeyspaceID(d46405367612b4b7)`, + "ExecuteMultiShard ks2.-20: select f.bar from foo f where f.id = 1 {} false false", + }) + }) + + t.Run("TryExecute return primitive error", func(t *testing.T) { + results := vc.results + + defer func() { + vc.Rewind() + vc.results = results + vc.resultErr = nil + mirrorVc.Rewind() + }() + + vc.results = nil + vc.resultErr = fmt.Errorf("return me") + + res, err := mirror.TryExecute(context.Background(), vc, map[string]*querypb.BindVariable{}, true) + require.Nil(t, res) + require.Error(t, err) + require.Equal(t, vc.resultErr, err) + + vc.ExpectLog(t, []string{ + "ResolveDestinations ks1 [] Destinations:DestinationAllShards()", + "ExecuteMultiShard ks1.0: select f.bar from foo f where f.id = 1 {} false false", + }) + mirrorVc.ExpectLog(t, []string{ + `ResolveDestinations ks2 [type:INT64 value:"1"] Destinations:DestinationKeyspaceID(d46405367612b4b7)`, + "ExecuteMultiShard ks2.-20: select f.bar from foo f where f.id = 1 {} false false", + }) + }) + + t.Run("TryExecute ignore mirror target error", func(t *testing.T) { + results := mirrorVc.results + + defer func() { + vc.Rewind() + mirrorVc.Rewind() + mirrorVc.results = results + mirrorVc.resultErr = nil + }() + + mirrorVc.results = nil + mirrorVc.resultErr = fmt.Errorf("ignore me") + + want := vc.results[0] + res, err := mirror.TryExecute(context.Background(), vc, map[string]*querypb.BindVariable{}, true) + require.Equal(t, res, want) + require.NoError(t, err) + + vc.ExpectLog(t, []string{ + "ResolveDestinations ks1 [] Destinations:DestinationAllShards()", + "ExecuteMultiShard ks1.0: select f.bar from foo f where f.id = 1 {} false false", + }) + mirrorVc.ExpectLog(t, []string{ + `ResolveDestinations ks2 [type:INT64 value:"1"] Destinations:DestinationKeyspaceID(d46405367612b4b7)`, + "ExecuteMultiShard ks2.-20: select f.bar from foo f where f.id = 1 {} false false", + }) + }) + + t.Run("TryStreamExecute success", func(t *testing.T) { + want := vc.results[0] + err := mirror.TryStreamExecute( + context.Background(), + vc, + map[string]*querypb.BindVariable{}, + true, + func(result *sqltypes.Result) error { + require.Equal(t, want, result) + return nil + }, + ) + require.NoError(t, err) + + vc.ExpectLog(t, []string{ + "ResolveDestinations ks1 [] Destinations:DestinationAllShards()", + "StreamExecuteMulti select f.bar from foo f where f.id = 1 ks1.0: {} ", + }) + mirrorVc.ExpectLog(t, []string{ + `ResolveDestinations ks2 [type:INT64 value:"1"] Destinations:DestinationKeyspaceID(d46405367612b4b7)`, + "StreamExecuteMulti select f.bar from foo f where f.id = 1 ks2.-20: {} ", + }) + + vc.Rewind() + mirrorVc.Rewind() + }) + + t.Run("TryStreamExecute return primitive error", func(t *testing.T) { + results := vc.results + + defer func() { + vc.Rewind() + vc.results = results + vc.resultErr = nil + mirrorVc.Rewind() + }() + + vc.results = nil + vc.resultErr = fmt.Errorf("return me") + + err := mirror.TryStreamExecute( + context.Background(), + vc, + map[string]*querypb.BindVariable{}, + true, + func(result *sqltypes.Result) error { + require.Nil(t, result) + return nil + }, + ) + require.Error(t, err) + require.Equal(t, vc.resultErr, err) + + vc.ExpectLog(t, []string{ + "ResolveDestinations ks1 [] Destinations:DestinationAllShards()", + "StreamExecuteMulti select f.bar from foo f where f.id = 1 ks1.0: {} ", + }) + mirrorVc.ExpectLog(t, []string{ + `ResolveDestinations ks2 [type:INT64 value:"1"] Destinations:DestinationKeyspaceID(d46405367612b4b7)`, + "StreamExecuteMulti select f.bar from foo f where f.id = 1 ks2.-20: {} ", + }) + }) + + t.Run("TryStreamExecute ignore mirror target error", func(t *testing.T) { + results := mirrorVc.results + + defer func() { + vc.Rewind() + mirrorVc.Rewind() + mirrorVc.results = results + mirrorVc.resultErr = nil + }() + + mirrorVc.results = nil + mirrorVc.resultErr = fmt.Errorf("ignore me") + + want := vc.results[0] + err := mirror.TryStreamExecute( + context.Background(), + vc, + map[string]*querypb.BindVariable{}, + true, + func(result *sqltypes.Result) error { + require.Equal(t, want, result) + return nil + }, + ) + require.NoError(t, err) + + vc.ExpectLog(t, []string{ + "ResolveDestinations ks1 [] Destinations:DestinationAllShards()", + "StreamExecuteMulti select f.bar from foo f where f.id = 1 ks1.0: {} ", + }) + mirrorVc.ExpectLog(t, []string{ + `ResolveDestinations ks2 [type:INT64 value:"1"] Destinations:DestinationKeyspaceID(d46405367612b4b7)`, + "StreamExecuteMulti select f.bar from foo f where f.id = 1 ks2.-20: {} ", + }) + }) +} diff --git a/go/vt/vtgate/engine/plan.go b/go/vt/vtgate/engine/plan.go index 769c69aaa06..8de1ed808d5 100644 --- a/go/vt/vtgate/engine/plan.go +++ b/go/vt/vtgate/engine/plan.go @@ -19,6 +19,7 @@ package engine import ( "bytes" "encoding/json" + "fmt" "sync/atomic" "time" @@ -37,7 +38,7 @@ type Plan struct { Instructions Primitive // Instructions contains the instructions needed to fulfil the query. BindVarNeeds *sqlparser.BindVarNeeds // Stores BindVars needed to be provided as part of expression rewriting Warnings []*query.QueryWarning // Warnings that need to be yielded every time this query runs - TablesUsed []string // TablesUsed is the list of tables that this plan will query + TablesUsed sqlparser.TableNames // TablesUsed is the list of tables that this plan will query ExecCount uint64 // Count of times this plan was executed ExecTime uint64 // Total execution time @@ -76,6 +77,15 @@ func (p *Plan) MarshalJSON() ([]byte, error) { instructions = &description } + tablesUsed := make([]string, len(p.TablesUsed)) + for i, table := range p.TablesUsed { + if table.Qualifier.NotEmpty() { + tablesUsed[i] = fmt.Sprintf("%s.%s", table.Qualifier.String(), table.Name.String()) + } else { + tablesUsed[i] = table.Name.String() + } + } + marshalPlan := struct { QueryType string Original string `json:",omitempty"` @@ -97,7 +107,7 @@ func (p *Plan) MarshalJSON() ([]byte, error) { RowsAffected: atomic.LoadUint64(&p.RowsAffected), RowsReturned: atomic.LoadUint64(&p.RowsReturned), Errors: atomic.LoadUint64(&p.Errors), - TablesUsed: p.TablesUsed, + TablesUsed: tablesUsed, } b := new(bytes.Buffer) diff --git a/go/vt/vtgate/engine/primitive.go b/go/vt/vtgate/engine/primitive.go index 1c0e7de7a19..99b14e4a5af 100644 --- a/go/vt/vtgate/engine/primitive.go +++ b/go/vt/vtgate/engine/primitive.go @@ -131,6 +131,9 @@ type ( // CloneForReplicaWarming clones the VCursor for re-use in warming queries to replicas CloneForReplicaWarming(ctx context.Context) VCursor + + // CloneForMirroring clones the VCursor for re-use in mirroring queries to other keyspaces + CloneForMirroring(ctx context.Context) VCursor } // SessionActions gives primitives ability to interact with the session state diff --git a/go/vt/vtgate/logstats/logstats.go b/go/vt/vtgate/logstats/logstats.go index 5ea7820a72e..309b2244de6 100644 --- a/go/vt/vtgate/logstats/logstats.go +++ b/go/vt/vtgate/logstats/logstats.go @@ -32,6 +32,7 @@ import ( "vitess.io/vitess/go/vt/callerid" "vitess.io/vitess/go/vt/callinfo" "vitess.io/vitess/go/vt/log" + "vitess.io/vitess/go/vt/sqlparser" querypb "vitess.io/vitess/go/vt/proto/query" ) @@ -53,7 +54,7 @@ type LogStats struct { ExecuteTime time.Duration CommitTime time.Duration Error error - TablesUsed []string + TablesUsed []sqlparser.TableName SessionUUID string CachedPlan bool ActiveKeyspace string // ActiveKeyspace is the selected keyspace `use ks` @@ -157,9 +158,9 @@ func (stats *LogStats) Logf(w io.Writer, params url.Values) error { fmtString = "{\"Method\": %q, \"RemoteAddr\": %q, \"Username\": %q, \"ImmediateCaller\": %q, \"Effective Caller\": %q, \"Start\": \"%v\", \"End\": \"%v\", \"TotalTime\": %.6f, \"PlanTime\": %v, \"ExecuteTime\": %v, \"CommitTime\": %v, \"StmtType\": %q, \"SQL\": %q, \"BindVars\": %v, \"ShardQueries\": %v, \"RowsAffected\": %v, \"Error\": %q, \"TabletType\": %q, \"SessionUUID\": %q, \"Cached Plan\": %v, \"TablesUsed\": %v, \"ActiveKeyspace\": %q}\n" } - tables := stats.TablesUsed - if tables == nil { - tables = []string{} + tables := make([]string, len(stats.TablesUsed)) + for i, table := range stats.TablesUsed { + tables[i] = sqlparser.String(table) } tablesUsed, marshalErr := json.Marshal(tables) if marshalErr != nil { diff --git a/go/vt/vtgate/logstats/logstats_test.go b/go/vt/vtgate/logstats/logstats_test.go index dbe49b200b8..1cc489a1358 100644 --- a/go/vt/vtgate/logstats/logstats_test.go +++ b/go/vt/vtgate/logstats/logstats_test.go @@ -40,6 +40,7 @@ import ( "vitess.io/vitess/go/vt/callinfo" "vitess.io/vitess/go/vt/callinfo/fakecallinfo" querypb "vitess.io/vitess/go/vt/proto/query" + "vitess.io/vitess/go/vt/sqlparser" ) func TestMain(m *testing.M) { @@ -62,7 +63,10 @@ func TestLogStatsFormat(t *testing.T) { logStats := NewLogStats(context.Background(), "test", "sql1", "suuid", nil) logStats.StartTime = time.Date(2017, time.January, 1, 1, 2, 3, 0, time.UTC) logStats.EndTime = time.Date(2017, time.January, 1, 1, 2, 4, 1234, time.UTC) - logStats.TablesUsed = []string{"ks1.tbl1", "ks2.tbl2"} + logStats.TablesUsed = []sqlparser.TableName{ + sqlparser.NewTableNameWithQualifier("tbl1", "ks1"), + sqlparser.NewTableNameWithQualifier("tbl2", "ks2"), + } logStats.TabletType = "PRIMARY" logStats.ActiveKeyspace = "db" params := map[string][]string{"full": {}} diff --git a/go/vt/vtgate/planbuilder/builder.go b/go/vt/vtgate/planbuilder/builder.go index e79e19ee96b..6fe147e9cb2 100644 --- a/go/vt/vtgate/planbuilder/builder.go +++ b/go/vt/vtgate/planbuilder/builder.go @@ -29,6 +29,7 @@ import ( "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/vterrors" "vitess.io/vitess/go/vt/vtgate/engine" + "vitess.io/vitess/go/vt/vtgate/planbuilder/operators" "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" "vitess.io/vitess/go/vt/vtgate/vindexes" ) @@ -53,13 +54,13 @@ type ( planResult struct { primitive engine.Primitive - tables []string + tables sqlparser.TableNames } stmtPlanner func(sqlparser.Statement, *sqlparser.ReservedVars, plancontext.VSchema) (*planResult, error) ) -func newPlanResult(prim engine.Primitive, tablesUsed ...string) *planResult { +func newPlanResult(prim engine.Primitive, tablesUsed ...sqlparser.TableName) *planResult { return &planResult{primitive: prim, tables: tablesUsed} } @@ -104,7 +105,7 @@ func BuildFromStmt(ctx context.Context, query string, stmt sqlparser.Statement, } var primitive engine.Primitive - var tablesUsed []string + var tablesUsed []sqlparser.TableName if planResult != nil { primitive = planResult.primitive tablesUsed = planResult.tables @@ -119,6 +120,71 @@ func BuildFromStmt(ctx context.Context, query string, stmt sqlparser.Statement, return plan, nil } +func buildMirrorPlan(ctx context.Context, from *planResult, query string, stmt sqlparser.Statement, reservedVars *sqlparser.ReservedVars, vschema plancontext.VSchema, enableOnlineDDL, enableDirectDDL bool) (*planResult, error) { + // Collect keyspaces and validate tables. + fromKeyspaces := make(map[string]any) + toKeyspaces := make(map[string]float32) + + for _, table := range from.tables { + // Record the from keyspace. + fromKeyspace := table.Qualifier.String() + fromKeyspaces[fromKeyspace] = true + + // Find the mirror rule for the from keyspace. + mirrorRule, err := vschema.FindMirrorRule(fromKeyspace) + if err != nil { + return nil, err + } + if mirrorRule == nil { + return nil, nil + } + + // Record the to keyspace. + toKeyspaces[mirrorRule.ToKeyspace] = mirrorRule.Percent + + // Validate that the to table exists in the vschema (always true if the + // keyspace is unsharded). + table, err := vschema.GetVSchema().FindTable(mirrorRule.ToKeyspace, table.Name.String()) + if err != nil { + return nil, err + } + if table == nil { + return nil, nil + } + } + + // Nothing to mirror if we can't identify any to keyspaces. + if len(toKeyspaces) == 0 { + return nil, nil + } + + // Use the smallest mirror percent. + var i int + var percent float32 + for _, p := range toKeyspaces { + if i == 0 || p < percent { + percent = p + } + i++ + } + + mirrorVSchema := plancontext.ForMirroring(vschema) + target, err := createInstructionFor(ctx, query, stmt, reservedVars, mirrorVSchema, enableOnlineDDL, enableDirectDDL) + if err != nil { + return nil, err + } + + target.primitive = engine.NewMirror( + from.primitive, + engine.NewPercentMirrorTarget(percent, target.primitive), + ) + tables := append(from.tables, target.tables...) + operators.SortTableNames(tables) + target.tables = tables + + return target, nil +} + func getConfiguredPlanner(vschema plancontext.VSchema, stmt sqlparser.Statement, query string) (stmtPlanner, error) { planner, found := getPlannerFromQueryHint(stmt) if !found { @@ -155,9 +221,43 @@ func buildRoutePlan(stmt sqlparser.Statement, reservedVars *sqlparser.ReservedVa return f(stmt, reservedVars, vschema) } +func buildMirroredRoutePlan(ctx context.Context, query string, stmt sqlparser.Statement, reservedVars *sqlparser.ReservedVars, vschema plancontext.VSchema, enableOnlineDDL, enableDirectDDL bool) (*planResult, error) { + // Building the query changes the statement. Clone the statement in case we + // need to mirror it. + var mirrorStmt sqlparser.Statement + + // TODO(maxeng): find a more precise way to skip mirroring work when + // statement cannot be mirrored for one reason or another. + if vschema.HasMirrorRules() { + mirrorStmt = sqlparser.CloneStatement(stmt) + } + + configuredPlanner, err := getConfiguredPlanner(vschema, stmt, query) + if err != nil { + return nil, err + } + plan, err := buildRoutePlan(stmt, reservedVars, vschema, configuredPlanner) + if err != nil { + return nil, err + } + + if len(plan.tables) > 0 && vschema.HasMirrorRules() { + mirrorPlan, err := buildMirrorPlan(ctx, plan, query, mirrorStmt, reservedVars, vschema, enableOnlineDDL, enableDirectDDL) + if err != nil { + // TODO(maxeng): logs? metrics? + } else if mirrorPlan != nil { + plan = mirrorPlan + } + } + + return plan, nil +} + func createInstructionFor(ctx context.Context, query string, stmt sqlparser.Statement, reservedVars *sqlparser.ReservedVars, vschema plancontext.VSchema, enableOnlineDDL, enableDirectDDL bool) (*planResult, error) { switch stmt := stmt.(type) { - case *sqlparser.Select, *sqlparser.Insert, *sqlparser.Update, *sqlparser.Delete: + case *sqlparser.Select: + return buildMirroredRoutePlan(ctx, query, stmt, reservedVars, vschema, enableOnlineDDL, enableDirectDDL) + case *sqlparser.Insert, *sqlparser.Update, *sqlparser.Delete: configuredPlanner, err := getConfiguredPlanner(vschema, stmt, query) if err != nil { return nil, err @@ -269,7 +369,7 @@ func buildAnalyzePlan(stmt sqlparser.Statement, _ *sqlparser.ReservedVars, vsche TargetDestination: dest, Query: sqlparser.String(analyzeStmt), } - return newPlanResult(prim, sqlparser.String(analyzeStmt.Table)), nil + return newPlanResult(prim, analyzeStmt.Table), nil } func buildDBDDLPlan(stmt sqlparser.Statement, _ *sqlparser.ReservedVars, vschema plancontext.VSchema) (*planResult, error) { @@ -341,7 +441,7 @@ func buildVSchemaDDLPlan(stmt *sqlparser.AlterVschema, vschema plancontext.VSche return newPlanResult(&engine.AlterVSchema{ Keyspace: keyspace, AlterVschemaDDL: stmt, - }, singleTable(keyspace.Name, stmt.Table.Name.String())), nil + }, sqlparser.NewTableNameWithQualifier(stmt.Table.Name.String(), keyspace.Name)), nil } func buildFlushPlan(stmt *sqlparser.Flush, vschema plancontext.VSchema) (*planResult, error) { @@ -401,7 +501,7 @@ func buildFlushTables(stmt *sqlparser.Flush, vschema plancontext.VSchema) (*plan if tbl == nil { return nil, vindexes.NotFoundError{TableName: tab.Name.String()} } - tc.addTable(tbl.Keyspace.Name, tbl.Name.String()) + tc.addTable(sqlparser.NewTableNameWithQualifier(tbl.Name.String(), tbl.Keyspace.Name)) ksTab = tbl.Keyspace stmt.TableNames[i] = sqlparser.TableName{ Name: tbl.Name, @@ -445,28 +545,23 @@ func buildFlushTables(stmt *sqlparser.Flush, vschema plancontext.VSchema) (*plan } type tableCollector struct { - tables map[string]any + tables map[sqlparser.TableName]any } -func (tc *tableCollector) addTable(ks, tbl string) { +func (tc *tableCollector) addTable(t sqlparser.TableName) { if tc.tables == nil { - tc.tables = map[string]any{} + tc.tables = map[sqlparser.TableName]any{} } - tc.tables[fmt.Sprintf("%s.%s", ks, tbl)] = nil + tc.tables[t] = nil } -func (tc *tableCollector) addASTTable(ks string, tbl sqlparser.TableName) { - tc.addTable(ks, tbl.Name.String()) -} - -func (tc *tableCollector) getTables() []string { - tableNames := make([]string, 0, len(tc.tables)) - for tbl := range tc.tables { - tableNames = append(tableNames, tbl) +func (tc *tableCollector) getTables() []sqlparser.TableName { + tables := make([]sqlparser.TableName, 0, len(tc.tables)) + for t := range tc.tables { + tables = append(tables, t) } - - sort.Strings(tableNames) - return tableNames + operators.SortTableNames(tables) + return tables } func newFlushStmt(stmt *sqlparser.Flush, tables sqlparser.TableNames) *sqlparser.Flush { diff --git a/go/vt/vtgate/planbuilder/ddl.go b/go/vt/vtgate/planbuilder/ddl.go index fe5ebeb0889..b457bbf6ebe 100644 --- a/go/vt/vtgate/planbuilder/ddl.go +++ b/go/vt/vtgate/planbuilder/ddl.go @@ -74,7 +74,7 @@ func buildGeneralDDLPlan(ctx context.Context, sql string, ddlStatement sqlparser } tc := &tableCollector{} for _, tbl := range ddlStatement.AffectedTables() { - tc.addASTTable(normalDDLPlan.Keyspace.Name, tbl) + tc.addTable(sqlparser.NewTableNameWithQualifier(tbl.Name.String(), normalDDLPlan.Keyspace.Name)) } return newPlanResult(eddl, tc.getTables()...), nil diff --git a/go/vt/vtgate/planbuilder/operators/delete.go b/go/vt/vtgate/planbuilder/operators/delete.go index 82ab6fe09ca..387ebaad9a6 100644 --- a/go/vt/vtgate/planbuilder/operators/delete.go +++ b/go/vt/vtgate/planbuilder/operators/delete.go @@ -37,6 +37,11 @@ type Delete struct { noPredicates } +var ( + _ Operator = (*Delete)(nil) + _ TableUser = (*Delete)(nil) +) + type TargetTable struct { ID semantics.TableSet VTable *vindexes.Table @@ -66,8 +71,8 @@ func (d *Delete) SetInputs(inputs []Operator) { d.Source = inputs[0] } -func (d *Delete) TablesUsed() []string { - return SingleQualifiedIdentifier(d.Target.VTable.Keyspace, d.Target.VTable.Name) +func (d *Delete) TablesUsed() []sqlparser.TableName { + return SingleTableName(d.Target.VTable.Keyspace, d.Target.VTable.Name) } func (d *Delete) GetOrdering(*plancontext.PlanningContext) []OrderBy { diff --git a/go/vt/vtgate/planbuilder/operators/helpers.go b/go/vt/vtgate/planbuilder/operators/helpers.go index 0049a919e2a..e13e84a159b 100644 --- a/go/vt/vtgate/planbuilder/operators/helpers.go +++ b/go/vt/vtgate/planbuilder/operators/helpers.go @@ -17,8 +17,8 @@ limitations under the License. package operators import ( - "fmt" - "sort" + "slices" + "strings" "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" @@ -82,15 +82,15 @@ func TableID(op Operator) (result semantics.TableSet) { // TableUser is used to signal that this operator directly interacts with one or more tables type TableUser interface { - TablesUsed() []string + TablesUsed() []sqlparser.TableName } -func TablesUsed(op Operator) []string { - addString, collect := collectSortedUniqueStrings() +func TablesUsed(op Operator) []sqlparser.TableName { + addTableName, collect := collectSortedUniqueTableNames() _ = Visit(op, func(this Operator) error { if tbl, ok := this.(TableUser); ok { for _, u := range tbl.TablesUsed() { - addString(u) + addTableName(u) } } return nil @@ -116,53 +116,59 @@ func CostOf(op Operator) (cost int) { return } -func QualifiedIdentifier(ks *vindexes.Keyspace, i sqlparser.IdentifierCS) string { - return QualifiedString(ks, i.String()) -} - -func QualifiedString(ks *vindexes.Keyspace, s string) string { - return fmt.Sprintf("%s.%s", ks.Name, s) -} - -func QualifiedTableName(ks *vindexes.Keyspace, t sqlparser.TableName) string { - return QualifiedIdentifier(ks, t.Name) -} - -func QualifiedTableNames(ks *vindexes.Keyspace, ts []sqlparser.TableName) []string { - add, collect := collectSortedUniqueStrings() +func QualifiedTableNames(ks *vindexes.Keyspace, ts []sqlparser.TableName) []sqlparser.TableName { + add, collect := collectSortedUniqueTableNames() for _, t := range ts { - add(QualifiedTableName(ks, t)) + add(sqlparser.NewTableNameWithQualifier(t.Name.String(), ks.Name)) } return collect() } -func QualifiedTables(ks *vindexes.Keyspace, vts []*vindexes.Table) []string { - add, collect := collectSortedUniqueStrings() +func QualifiedTables(ks *vindexes.Keyspace, vts []*vindexes.Table) []sqlparser.TableName { + add, collect := collectSortedUniqueTableNames() for _, vt := range vts { - add(QualifiedIdentifier(ks, vt.Name)) + add(sqlparser.NewTableNameWithQualifier(vt.Name.String(), ks.Name)) } return collect() } -func SingleQualifiedIdentifier(ks *vindexes.Keyspace, i sqlparser.IdentifierCS) []string { - return SingleQualifiedString(ks, i.String()) +func SingleTableName(ks *vindexes.Keyspace, i sqlparser.IdentifierCS) []sqlparser.TableName { + return []sqlparser.TableName{sqlparser.NewTableNameWithQualifier(i.String(), ks.Name)} } -func SingleQualifiedString(ks *vindexes.Keyspace, s string) []string { - return []string{QualifiedString(ks, s)} +func SortTableNames(ts []sqlparser.TableName) { + slices.SortFunc[[]sqlparser.TableName, sqlparser.TableName](ts, func(a, b sqlparser.TableName) int { + if a.Qualifier.NotEmpty() && b.Qualifier.NotEmpty() { + if cq := strings.Compare(a.Qualifier.String(), b.Qualifier.String()); cq != 0 { + return cq + } + return strings.Compare(a.Name.String(), b.Name.String()) + } + if a.Qualifier.NotEmpty() { + return strings.Compare(a.Qualifier.String(), b.Name.String()) + } + if b.Qualifier.NotEmpty() { + return strings.Compare(a.Name.String(), b.Qualifier.String()) + } + return strings.Compare(a.Name.String(), b.Name.String()) + }) } -func collectSortedUniqueStrings() (add func(string), collect func() []string) { - uniq := make(map[string]any) - add = func(v string) { +func collectSortedUniqueTableNames() (add func(sqlparser.TableName), collect func() []sqlparser.TableName) { + uniq := make(map[sqlparser.TableName]any) + + add = func(v sqlparser.TableName) { uniq[v] = nil } - collect = func() []string { - sorted := make([]string, 0, len(uniq)) + + collect = func() []sqlparser.TableName { + sorted := make([]sqlparser.TableName, 0, len(uniq)) for v := range uniq { sorted = append(sorted, v) } - sort.Strings(sorted) + + SortTableNames(sorted) + return sorted } diff --git a/go/vt/vtgate/planbuilder/operators/insert.go b/go/vt/vtgate/planbuilder/operators/insert.go index 9d0048d9322..71962e322a9 100644 --- a/go/vt/vtgate/planbuilder/operators/insert.go +++ b/go/vt/vtgate/planbuilder/operators/insert.go @@ -82,7 +82,10 @@ func (i *Insert) GetOrdering(*plancontext.PlanningContext) []OrderBy { return nil } -var _ Operator = (*Insert)(nil) +var ( + _ Operator = (*Insert)(nil) + _ TableUser = (*Insert)(nil) +) func (i *Insert) Clone([]Operator) Operator { return &Insert{ @@ -96,8 +99,8 @@ func (i *Insert) Clone([]Operator) Operator { } } -func (i *Insert) TablesUsed() []string { - return SingleQualifiedIdentifier(i.VTable.Keyspace, i.VTable.Name) +func (i *Insert) TablesUsed() []sqlparser.TableName { + return SingleTableName(i.VTable.Keyspace, i.VTable.Name) } func (i *Insert) Statement() sqlparser.Statement { diff --git a/go/vt/vtgate/planbuilder/operators/route.go b/go/vt/vtgate/planbuilder/operators/route.go index 5303cac401b..ead5ac0f563 100644 --- a/go/vt/vtgate/planbuilder/operators/route.go +++ b/go/vt/vtgate/planbuilder/operators/route.go @@ -691,11 +691,11 @@ func (r *Route) GetOrdering(ctx *plancontext.PlanningContext) []OrderBy { // TablesUsed returns tables used by MergedWith routes, which are not included // in Inputs() and thus not a part of the operator tree -func (r *Route) TablesUsed() []string { - addString, collect := collectSortedUniqueStrings() +func (r *Route) TablesUsed() []sqlparser.TableName { + addTable, collect := collectSortedUniqueTableNames() for _, mw := range r.MergedWith { for _, u := range TablesUsed(mw) { - addString(u) + addTable(u) } } return collect() diff --git a/go/vt/vtgate/planbuilder/operators/table.go b/go/vt/vtgate/planbuilder/operators/table.go index 4bdf6f75c8b..58dfeb290e7 100644 --- a/go/vt/vtgate/planbuilder/operators/table.go +++ b/go/vt/vtgate/planbuilder/operators/table.go @@ -41,6 +41,11 @@ type ( } ) +var ( + _ Operator = (*Table)(nil) + _ TableUser = (*Table)(nil) +) + // Clone implements the Operator interface func (to *Table) Clone([]Operator) Operator { var columns []*sqlparser.ColName @@ -103,11 +108,11 @@ func (to *Table) AddCol(col *sqlparser.ColName) { to.Columns = append(to.Columns, col) } -func (to *Table) TablesUsed() []string { +func (to *Table) TablesUsed() []sqlparser.TableName { if sqlparser.SystemSchema(to.QTable.Table.Qualifier.String()) { return nil } - return SingleQualifiedIdentifier(to.VTable.Keyspace, to.VTable.Name) + return SingleTableName(to.VTable.Keyspace, to.VTable.Name) } func addColumn(ctx *plancontext.PlanningContext, op ColNameColumns, e sqlparser.Expr) int { diff --git a/go/vt/vtgate/planbuilder/operators/update.go b/go/vt/vtgate/planbuilder/operators/update.go index 727db448d30..e55273512ed 100644 --- a/go/vt/vtgate/planbuilder/operators/update.go +++ b/go/vt/vtgate/planbuilder/operators/update.go @@ -60,6 +60,11 @@ type ( } ) +var ( + _ Operator = (*Update)(nil) + _ TableUser = (*Update)(nil) +) + func (se SetExpr) String() string { return fmt.Sprintf("%s = %s", sqlparser.String(se.Name), sqlparser.String(se.Expr.EvalExpr)) } @@ -81,9 +86,9 @@ func (u *Update) GetOrdering(*plancontext.PlanningContext) []OrderBy { return nil } -func (u *Update) TablesUsed() []string { +func (u *Update) TablesUsed() []sqlparser.TableName { if u.VTable != nil { - return SingleQualifiedIdentifier(u.VTable.Keyspace, u.VTable.Name) + return SingleTableName(u.VTable.Keyspace, u.VTable.Name) } return nil } diff --git a/go/vt/vtgate/planbuilder/operators/vindex.go b/go/vt/vtgate/planbuilder/operators/vindex.go index c16944e7c49..f4029b91fdd 100644 --- a/go/vt/vtgate/planbuilder/operators/vindex.go +++ b/go/vt/vtgate/planbuilder/operators/vindex.go @@ -50,6 +50,11 @@ type ( const wrongWhereCond = "WHERE clause for vindex function must be of the form id = or id in(,...)" +var ( + _ Operator = (*Vindex)(nil) + _ TableUser = (*Vindex)(nil) +) + // Introduces implements the Operator interface func (v *Vindex) introducesTableID() semantics.TableSet { return v.Solved @@ -160,8 +165,8 @@ func (v *Vindex) AddPredicate(ctx *plancontext.PlanningContext, expr sqlparser.E // TablesUsed implements the Operator interface. // It is not keyspace-qualified. -func (v *Vindex) TablesUsed() []string { - return []string{v.Table.Table.Name.String()} +func (v *Vindex) TablesUsed() []sqlparser.TableName { + return []sqlparser.TableName{sqlparser.NewTableName(v.Table.Table.Name.String())} } func (v *Vindex) ShortDescription() string { diff --git a/go/vt/vtgate/planbuilder/plan_test.go b/go/vt/vtgate/planbuilder/plan_test.go index 1a09aa555ec..b7c6aec3471 100644 --- a/go/vt/vtgate/planbuilder/plan_test.go +++ b/go/vt/vtgate/planbuilder/plan_test.go @@ -559,6 +559,20 @@ func TestOtherPlanningFromFile(t *testing.T) { testFile(t, "other_admin_cases.json", testOutputTempDir, vschema, false) } +func TestMirrorPlanning(t *testing.T) { + defer utils.EnsureNoLeaks(t) + vschemaWrapper := &vschemawrapper.VSchemaWrapper{ + V: loadSchema(t, "vschemas/mirror_schema.json", true), + TabletType_: topodatapb.TabletType_PRIMARY, + SysVarEnabled: true, + TestBuilder: TestBuilder, + Env: vtenv.NewTestEnv(), + } + testOutputTempDir := makeTestOutput(t) + + testFile(t, "mirror_cases.json", testOutputTempDir, vschemaWrapper, false) +} + func loadSchema(t testing.TB, filename string, setCollation bool) *vindexes.VSchema { formal, err := vindexes.LoadFormal(locateFile(filename)) if err != nil { diff --git a/go/vt/vtgate/planbuilder/plancontext/vschema.go b/go/vt/vtgate/planbuilder/plancontext/vschema.go index 1bca80cbc94..9ea28482332 100644 --- a/go/vt/vtgate/planbuilder/plancontext/vschema.go +++ b/go/vt/vtgate/planbuilder/plancontext/vschema.go @@ -93,6 +93,250 @@ type VSchema interface { // StorePrepareData stores the prepared data in the session. StorePrepareData(name string, v *vtgatepb.PrepareData) + + // FindMirrorRule returns the mirror rule associated with the requested + // keyspace. + FindMirrorRule(keyspace string) (*vindexes.MirrorRule, error) + + // HasMirroRules returns true if the vschema has any mirror rules. + HasMirrorRules() bool +} + +// mirrorVSchema is a wrapper which returns mirrored versions of values +// return by the wrapped vschema. +// +// For example, if the wrapped VSchema defines any mirror rules from ks1 to +// ks2, calls to FindTable for which the wrapped VSchema returns tables in +// ks1 will return tables in ks2. +// +// The returned VSchema cannot be reflected back again by passing it to +// ForMirroring. This restriction allows the returned VSchema to be used in +// recursive planning calls without creating an infinite loop. +type mirrorVSchema struct { + vschema VSchema +} + +// FindTable finds and returns the table with the requested name. +// +// mirrorVSchema returns a mirrored version of the value returned by the underlying VSchema. +// If the underlying VSchema returns a table t1 in ks1, and there is exists a +// routing rule from ks1 to ks2, and ks2 has a table t1, then mirrorVSchema +// returns ks2.t1. +// +// If no table with the requested name can be found, or not mirror rule is +// defined on the keyspace of the found table, or no table is found in the +// target keyspace defined by the mirror rule, then nil is returned. +func (m *mirrorVSchema) FindTable(tablename sqlparser.TableName) (*vindexes.Table, string, topodatapb.TabletType, key.Destination, error) { + fromTable, destKeyspace, destTabletType, dest, err := m.vschema.FindTable(tablename) + if err != nil { + return nil, "", destTabletType, nil, err + } + mirrorRule, err := m.vschema.FindMirrorRule(fromTable.Keyspace.Name) + if err != nil { + return nil, "", destTabletType, nil, err + } + if mirrorRule == nil { + return nil, "", destTabletType, nil, nil + } + toTable, err := m.GetVSchema().FindTable(mirrorRule.ToKeyspace, tablename.Name.String()) + return toTable, destKeyspace, destTabletType, dest, err +} + +func (m *mirrorVSchema) FindView(name sqlparser.TableName) sqlparser.SelectStatement { + // TODO(maxeng): we don't have all the information we need here to mirror + // views. May need to expose a new method on VSchema interface, such as + // ParseDestinationTarget + return nil +} + +// FindTableOrVindex returns a routed table or vindex. +// +// mirrorVSchema returns a mirrored version of the value returned by the underlying VSchema. +// If the underlying VSchema returns a table t1 in ks1, and there is exists a +// routing rule from ks1 to ks2, and ks2 has a table t1, then mirrorVSchema +// returns ks2.t1. +// +// If no table with the requested name can be found, or not mirror rule is +// defined on the keyspace of the found table, or no table is found in the +// target keyspace defined by the mirror rule, then nil is returned. +func (m *mirrorVSchema) FindTableOrVindex(tablename sqlparser.TableName) (*vindexes.Table, vindexes.Vindex, string, topodatapb.TabletType, key.Destination, error) { + fromTable, _, destKeyspace, destTabletType, dest, err := m.vschema.FindTableOrVindex(tablename) + if err != nil { + return nil, nil, "", destTabletType, nil, err + } + mirrorRule, err := m.vschema.FindMirrorRule(fromTable.Keyspace.Name) + if err != nil { + return nil, nil, "", destTabletType, nil, err + } + if mirrorRule == nil { + return nil, nil, "", destTabletType, nil, nil + } + toTable, toVindex, err := m.GetVSchema().FindTableOrVindex(mirrorRule.ToKeyspace, tablename.Name.String(), m.TabletType()) + return toTable, toVindex, destKeyspace, destTabletType, dest, err +} + +func (m *mirrorVSchema) DefaultKeyspace() (*vindexes.Keyspace, error) { + return m.vschema.DefaultKeyspace() +} + +func (m *mirrorVSchema) TargetString() string { + return m.vschema.TargetString() +} + +func (m *mirrorVSchema) Destination() key.Destination { + return m.vschema.Destination() +} + +func (m *mirrorVSchema) TabletType() topodatapb.TabletType { + return m.vschema.TabletType() +} + +func (m *mirrorVSchema) TargetDestination(qualifier string) (key.Destination, *vindexes.Keyspace, topodatapb.TabletType, error) { + return m.vschema.TargetDestination(qualifier) +} + +func (m *mirrorVSchema) AnyKeyspace() (*vindexes.Keyspace, error) { + return m.vschema.AnyKeyspace() +} + +func (m *mirrorVSchema) FirstSortedKeyspace() (*vindexes.Keyspace, error) { + return m.vschema.FirstSortedKeyspace() +} + +func (m *mirrorVSchema) SysVarSetEnabled() bool { + return m.vschema.SysVarSetEnabled() +} + +func (m *mirrorVSchema) KeyspaceExists(keyspace string) bool { + return m.vschema.KeyspaceExists(keyspace) +} + +func (m *mirrorVSchema) AllKeyspace() ([]*vindexes.Keyspace, error) { + return m.vschema.AllKeyspace() +} + +func (m *mirrorVSchema) FindKeyspace(keyspace string) (*vindexes.Keyspace, error) { + return m.vschema.FindKeyspace(keyspace) +} + +func (m *mirrorVSchema) GetSemTable() *semantics.SemTable { + return m.vschema.GetSemTable() +} + +func (m *mirrorVSchema) Planner() PlannerVersion { + return m.vschema.Planner() +} + +func (m *mirrorVSchema) SetPlannerVersion(pv PlannerVersion) { + m.vschema.SetPlannerVersion(pv) +} + +func (m *mirrorVSchema) ConnCollation() collations.ID { + return m.vschema.ConnCollation() +} + +func (m *mirrorVSchema) Environment() *vtenv.Environment { + return m.vschema.Environment() +} + +// ErrorIfShardedF will return an error if the keyspace is sharded, +// and produce a warning if the vtgate if configured to do so +func (m *mirrorVSchema) ErrorIfShardedF(keyspace *vindexes.Keyspace, warn string, errFmt string, params ...any) error { + return m.vschema.ErrorIfShardedF(keyspace, warn, errFmt, params...) +} + +// WarnUnshardedOnly is used when a feature is only supported in unsharded mode. +// This will let the user know that they are using something +// that could become a problem if they move to a sharded keyspace +func (m *mirrorVSchema) WarnUnshardedOnly(format string, params ...any) { + m.vschema.WarnUnshardedOnly(format, params...) +} + +// PlannerWarning records warning created during planning. +func (m *mirrorVSchema) PlannerWarning(message string) { + m.vschema.PlannerWarning(message) +} + +// ForeignKeyMode returns the foreign_key flag value +func (m *mirrorVSchema) ForeignKeyMode(keyspace string) (vschemapb.Keyspace_ForeignKeyMode, error) { + return m.vschema.ForeignKeyMode(keyspace) +} + +// KeyspaceError returns any error in the keyspace vschema. +func (m *mirrorVSchema) KeyspaceError(keyspace string) error { + return m.vschema.KeyspaceError(keyspace) +} + +func (m *mirrorVSchema) GetForeignKeyChecksState() *bool { + return m.vschema.GetForeignKeyChecksState() +} + +// GetVSchema returns the latest cached vindexes.VSchema +func (m *mirrorVSchema) GetVSchema() *vindexes.VSchema { + return m.vschema.GetVSchema() +} + +func (m *mirrorVSchema) GetSrvVschema() *vschemapb.SrvVSchema { + return m.vschema.GetSrvVschema() +} + +// FindRoutedShard looks up shard routing rules for a shard +func (m *mirrorVSchema) FindRoutedShard(keyspace string, shard string) (string, error) { + return m.vschema.FindRoutedShard(keyspace, shard) +} + +// IsShardRoutingEnabled returns true if partial shard routing is enabled +func (m *mirrorVSchema) IsShardRoutingEnabled() bool { + return m.vschema.IsShardRoutingEnabled() +} + +// IsViewsEnabled returns true if Vitess manages the views. +func (m *mirrorVSchema) IsViewsEnabled() bool { + return m.vschema.IsViewsEnabled() +} + +// GetUDV returns user defined value from the variable passed. +func (m *mirrorVSchema) GetUDV(name string) *querypb.BindVariable { + return m.vschema.GetUDV(name) +} + +// PlanPrepareStatement plans the prepared statement. +func (m *mirrorVSchema) PlanPrepareStatement(ctx context.Context, query string) (*engine.Plan, sqlparser.Statement, error) { + return m.vschema.PlanPrepareStatement(ctx, query) +} + +// ClearPrepareData clears the prepared data from the session. +func (m *mirrorVSchema) ClearPrepareData(stmtName string) { + m.vschema.ClearPrepareData(stmtName) +} + +// GetPrepareData returns the prepared data for the statement from the session. +func (m *mirrorVSchema) GetPrepareData(stmtName string) *vtgatepb.PrepareData { + return m.vschema.GetPrepareData(stmtName) +} + +// StorePrepareData stores the prepared data in the session. +func (m *mirrorVSchema) StorePrepareData(name string, v *vtgatepb.PrepareData) { + m.vschema.StorePrepareData(name, v) +} + +// FindMirrorRule returns the mirror rule associated with the requested +// keyspace. +// +// The returned VSchema cannot be reflected back again by passing it to +// ForMirroring. This restriction allows the returned VSchema to be passed to a +// recursive planning calls without creating an infinite loop. +func (m *mirrorVSchema) FindMirrorRule(keyspace string) (*vindexes.MirrorRule, error) { + return nil, nil +} + +// HasMirrorRules returns true if the vschema has any mirror rules. +// +// The returned VSchema cannot be reflected back again by passing it to +// ForMirroring. This restriction allows the returned VSchema to be passed to a +// recursive planning calls without creating an infinite loop. +func (m *mirrorVSchema) HasMirrorRules() bool { + return false } // PlannerNameToVersion returns the numerical representation of the planner @@ -107,3 +351,17 @@ func PlannerNameToVersion(s string) (PlannerVersion, bool) { } return 0, false } + +// ForMirroring returns a wrapper which returns mirrored versions of values +// return by the wrapped vschema. +// +// For example, if the underlying VSchema defines any mirror rules from ks1 to +// ks2, calls to FindTable for which the wrapped VSchema returns tables in +// ks1 will return tables in ks2. +// +// The returned VSchema cannot be reflected back again by passing it to +// ForMirroring. This restriction allows the returned VSchema to be passed in +// recursive planning calls without creating an infinite loop. +func ForMirroring(vschema VSchema) VSchema { + return &mirrorVSchema{vschema} +} diff --git a/go/vt/vtgate/planbuilder/select.go b/go/vt/vtgate/planbuilder/select.go index 13671e7efa0..59d17691cc7 100644 --- a/go/vt/vtgate/planbuilder/select.go +++ b/go/vt/vtgate/planbuilder/select.go @@ -28,6 +28,7 @@ import ( "vitess.io/vitess/go/vt/vtgate/planbuilder/operators" "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" "vitess.io/vitess/go/vt/vtgate/semantics" + "vitess.io/vitess/go/vt/vtgate/vindexes" ) func gen4SelectStmtPlanner( @@ -45,12 +46,12 @@ func gen4SelectStmtPlanner( return nil, err } if p != nil { - used := "dual" + used := sqlparser.NewTableName("dual") keyspace, ksErr := vschema.DefaultKeyspace() if ksErr == nil { // we are just getting the ks to log the correct table use. // no need to fail this if we can't find the default keyspace - used = keyspace.Name + ".dual" + used = sqlparser.NewTableNameWithQualifier("dual", keyspace.Name) } return newPlanResult(p, used), nil } @@ -62,7 +63,7 @@ func gen4SelectStmtPlanner( sel.SQLCalcFoundRows = false } - getPlan := func(selStatement sqlparser.SelectStatement) (logicalPlan, []string, error) { + getPlan := func(selStatement sqlparser.SelectStatement) (logicalPlan, []sqlparser.TableName, error) { return newBuildSelectPlan(selStatement, reservedVars, vschema, plannerVersion) } @@ -124,7 +125,7 @@ func buildSQLCalcFoundRowsPlan( sel *sqlparser.Select, reservedVars *sqlparser.ReservedVars, vschema plancontext.VSchema, -) (logicalPlan, []string, error) { +) (logicalPlan, []sqlparser.TableName, error) { limitPlan, _, err := newBuildSelectPlan(sel, reservedVars, vschema, Gen4) if err != nil { return nil, nil, err @@ -172,7 +173,7 @@ func buildSQLCalcFoundRowsPlan( return &sqlCalcFoundRows{LimitQuery: limitPlan, CountQuery: countPlan}, tablesUsed, nil } -func gen4PredicateRewrite(stmt sqlparser.Statement, getPlan func(selStatement sqlparser.SelectStatement) (logicalPlan, []string, error)) (logicalPlan, []string) { +func gen4PredicateRewrite(stmt sqlparser.Statement, getPlan func(selStatement sqlparser.SelectStatement) (logicalPlan, []sqlparser.TableName, error)) (logicalPlan, []sqlparser.TableName) { rewritten, isSel := sqlparser.RewritePredicate(stmt).(sqlparser.SelectStatement) if !isSel { // Fail-safe code, should never happen @@ -191,13 +192,17 @@ func newBuildSelectPlan( reservedVars *sqlparser.ReservedVars, vschema plancontext.VSchema, version querypb.ExecuteOptions_PlannerVersion, -) (plan logicalPlan, tablesUsed []string, err error) { +) (plan logicalPlan, tablesUsed []sqlparser.TableName, err error) { ctx, err := plancontext.CreatePlanningContext(selStmt, reservedVars, vschema, version) if err != nil { return nil, nil, err } - if ks, _ := ctx.SemTable.SingleUnshardedKeyspace(); ks != nil { + // Only use shortcut if all tables are in the same, unsharded keyspace. + var ks *vindexes.Keyspace + ks, _ = ctx.SemTable.SingleUnshardedKeyspace() + + if ks != nil { plan, tablesUsed, err = selectUnshardedShortcut(ctx, selStmt, ks) if err != nil { return nil, nil, err diff --git a/go/vt/vtgate/planbuilder/single_sharded_shortcut.go b/go/vt/vtgate/planbuilder/single_sharded_shortcut.go index dea4e7bb595..4b7fdee5ad0 100644 --- a/go/vt/vtgate/planbuilder/single_sharded_shortcut.go +++ b/go/vt/vtgate/planbuilder/single_sharded_shortcut.go @@ -28,7 +28,7 @@ import ( "vitess.io/vitess/go/vt/vtgate/vindexes" ) -func selectUnshardedShortcut(ctx *plancontext.PlanningContext, stmt sqlparser.SelectStatement, ks *vindexes.Keyspace) (logicalPlan, []string, error) { +func selectUnshardedShortcut(ctx *plancontext.PlanningContext, stmt sqlparser.SelectStatement, ks *vindexes.Keyspace) (logicalPlan, []sqlparser.TableName, error) { // this method is used when the query we are handling has all tables in the same unsharded keyspace sqlparser.SafeRewrite(stmt, nil, func(cursor *sqlparser.Cursor) bool { switch node := cursor.Node().(type) { diff --git a/go/vt/vtgate/planbuilder/testdata/mirror_cases.json b/go/vt/vtgate/planbuilder/testdata/mirror_cases.json new file mode 100644 index 00000000000..f509cd9abe2 --- /dev/null +++ b/go/vt/vtgate/planbuilder/testdata/mirror_cases.json @@ -0,0 +1,162 @@ +[ + { + "comment": "select column from one unsharded, qualified, unmirrored table", + "query": "select t1.id from main.t1 where t1.id = 1", + "plan": { + "QueryType": "SELECT", + "Original": "select t1.id from main.t1 where t1.id = 1", + "Instructions": { + "OperatorType": "Route", + "Variant": "Unsharded", + "Keyspace": { + "Name": "main", + "Sharded": false + }, + "FieldQuery": "select t1.id from t1 where 1 != 1", + "Query": "select t1.id from t1 where t1.id = 1", + "Table": "t1" + }, + "TablesUsed": [ + "main.t1" + ] + } + }, + { + "comment": "select column from one unsharded, qualified, table mirrored to unsharded keyspace", + "query": "select t1.id from unsharded_src1.t1 where t1.id = 1", + "plan": { + "QueryType": "SELECT", + "Original": "select t1.id from unsharded_src1.t1 where t1.id = 1", + "Instructions": { + "OperatorType": "Mirror", + "Inputs": [ + { + "OperatorType": "Route", + "Variant": "Unsharded", + "Keyspace": { + "Name": "unsharded_src1", + "Sharded": false + }, + "FieldQuery": "select t1.id from t1 where 1 != 1", + "Query": "select t1.id from t1 where t1.id = 1", + "Table": "t1" + }, + { + "OperatorType": "MirrorTarget", + "Variant": "Percent", + "Percent": 50, + "Inputs": [ + { + "OperatorType": "Route", + "Variant": "Unsharded", + "Keyspace": { + "Name": "unsharded_dst1", + "Sharded": false + }, + "FieldQuery": "select t1.id from t1 where 1 != 1", + "Query": "select t1.id from t1 where t1.id = 1", + "Table": "t1" + } + ] + } + ] + }, + "TablesUsed": [ + "unsharded_dst1.t1", + "unsharded_src1.t1" + ] + } + }, + { + "comment": "select column from one unsharded, qualified, table mirrored to sharded keyspace", + "query": "select t1.id from unsharded_src2.t1 where t1.id = 1", + "plan": { + "QueryType": "SELECT", + "Original": "select t1.id from unsharded_src2.t1 where t1.id = 1", + "Instructions": { + "OperatorType": "Mirror", + "Inputs": [ + { + "OperatorType": "Route", + "Variant": "Unsharded", + "Keyspace": { + "Name": "unsharded_src2", + "Sharded": false + }, + "FieldQuery": "select t1.id from t1 where 1 != 1", + "Query": "select t1.id from t1 where t1.id = 1", + "Table": "t1" + }, + { + "OperatorType": "MirrorTarget", + "Variant": "Percent", + "Percent": 50, + "Inputs": [ + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "sharded_dst2", + "Sharded": true + }, + "FieldQuery": "select t1.id from t1 where 1 != 1", + "Query": "select t1.id from t1 where t1.id = 1", + "Table": "t1", + "Values": [ + "1" + ], + "Vindex": "xxhash" + } + ] + } + ] + }, + "TablesUsed": [ + "sharded_dst2.t1", + "unsharded_src2.t1" + ] + } + }, + { + "comment": "select from two tables, one mirrored and one unmirrored", + "query": "select m1.id, t1.id from main.m1, unsharded_src2.t1 where m1.id = 1 and t1.id = 1", + "plan": { + "QueryType": "SELECT", + "Original": "select m1.id, t1.id from main.m1, unsharded_src2.t1 where m1.id = 1 and t1.id = 1", + "Instructions": { + "OperatorType": "Join", + "Variant": "Join", + "JoinColumnIndexes": "L:0,R:0", + "TableName": "m1_t1", + "Inputs": [ + { + "OperatorType": "Route", + "Variant": "Unsharded", + "Keyspace": { + "Name": "main", + "Sharded": false + }, + "FieldQuery": "select m1.id from m1 where 1 != 1", + "Query": "select m1.id from m1 where m1.id = 1", + "Table": "m1" + }, + { + "OperatorType": "Route", + "Variant": "Unsharded", + "Keyspace": { + "Name": "unsharded_src2", + "Sharded": false + }, + "FieldQuery": "select t1.id from t1 where 1 != 1", + "Query": "select t1.id from t1 where t1.id = 1", + "Table": "t1" + } + ] + }, + "TablesUsed": [ + "main.m1", + "unsharded_src2.t1" + ] + } + } +] diff --git a/go/vt/vtgate/planbuilder/testdata/vschemas/mirror_schema.json b/go/vt/vtgate/planbuilder/testdata/vschemas/mirror_schema.json new file mode 100644 index 00000000000..56855cd0903 --- /dev/null +++ b/go/vt/vtgate/planbuilder/testdata/vschemas/mirror_schema.json @@ -0,0 +1,52 @@ +{ + "mirror_rules": { + "rules": [ + { + "from_keyspace": "unsharded_src1", + "to_keyspace": "unsharded_dst1", + "percent": 50.0 + }, + { + "from_keyspace": "unsharded_src2", + "to_keyspace": "sharded_dst2", + "percent": 50.0 + } + ] + }, + "keyspaces": { + "main": { + "sharded": false, + "tables": {} + }, + "unsharded_src1": { + "sharded": false, + "tables": {} + }, + "unsharded_src2": { + "sharded": false, + "tables": {} + }, + "unsharded_dst1": { + "sharded": false, + "tables": {} + }, + "sharded_dst2": { + "sharded": true, + "vindexes": { + "xxhash": { + "type": "xxhash" + } + }, + "tables": { + "t1": { + "columnVindexes": [ + { + "column": "id", + "name": "xxhash" + } + ] + } + } + } + } +} diff --git a/go/vt/vtgate/planbuilder/vexplain.go b/go/vt/vtgate/planbuilder/vexplain.go index 7b200fb2e09..00026b43792 100644 --- a/go/vt/vtgate/planbuilder/vexplain.go +++ b/go/vt/vtgate/planbuilder/vexplain.go @@ -27,7 +27,6 @@ import ( "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/vterrors" "vitess.io/vitess/go/vt/vtgate/engine" - "vitess.io/vitess/go/vt/vtgate/planbuilder/operators" "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" ) @@ -60,12 +59,15 @@ func explainTabPlan(explain *sqlparser.ExplainTab, vschema plancontext.VSchema) return nil, vterrors.VT14004(ks) } - return newPlanResult(&engine.Send{ - Keyspace: keyspace, - TargetDestination: destination, - Query: sqlparser.String(explain), - SingleShardOnly: true, - }, singleTable(keyspace.Name, explain.Table.Name.String())), nil + return newPlanResult( + &engine.Send{ + Keyspace: keyspace, + TargetDestination: destination, + Query: sqlparser.String(explain), + SingleShardOnly: true, + }, + sqlparser.NewTableNameWithQualifier(explain.Table.Name.String(), keyspace.Name), + ), nil } func buildVExplainVtgatePlan(ctx context.Context, explainStatement sqlparser.Statement, reservedVars *sqlparser.ReservedVars, vschema plancontext.VSchema, enableOnlineDDL, enableDirectDDL bool) (*planResult, error) { @@ -135,7 +137,7 @@ func explainPlan(explain *sqlparser.ExplainStmt, reservedVars *sqlparser.Reserve // Remove keyspace qualifier from columns and tables. sqlparser.RemoveKeyspace(explain.Statement) - var tables []string + var tables []sqlparser.TableName for _, table := range ctx.SemTable.Tables { name, err := table.Name() if err != nil { @@ -143,7 +145,7 @@ func explainPlan(explain *sqlparser.ExplainStmt, reservedVars *sqlparser.Reserve // it's OK to ignore errors here continue } - tables = append(tables, operators.QualifiedString(ks, name.Name.String())) + tables = append(tables, sqlparser.NewTableNameWithQualifier(name.Name.String(), ks.Name)) } return newPlanResult(&engine.Send{ diff --git a/go/vt/vtgate/vcursor_impl.go b/go/vt/vtgate/vcursor_impl.go index 67093046ded..28ccfc18f9a 100644 --- a/go/vt/vtgate/vcursor_impl.go +++ b/go/vt/vtgate/vcursor_impl.go @@ -214,6 +214,16 @@ func (vc *vcursorImpl) Environment() *vtenv.Environment { return vc.executor.environment() } +// FindMirrorRule returns the mirror rule for the requested keyspace. +func (vc *vcursorImpl) FindMirrorRule(keyspace string) (*vindexes.MirrorRule, error) { + return vc.vschema.FindMirrorRule(keyspace) +} + +// HasMirrorRules returns true if the vschema has any mirror rules. +func (vc *vcursorImpl) HasMirrorRules() bool { + return vc.vschema.HasMirrorRules() +} + func (vc *vcursorImpl) TimeZone() *time.Location { return vc.safeSession.TimeZone() } @@ -250,7 +260,7 @@ func (vc *vcursorImpl) IsShardRoutingEnabled() bool { return enableShardRouting } -// FindTable finds the specified table. If the keyspace what specified in the input, it gets used as qualifier. +// FindTable finds the specified table. If the keyspace was specified in the input, it gets used as qualifier. // Otherwise, the keyspace from the request is used, if one was provided. func (vc *vcursorImpl) FindTable(name sqlparser.TableName) (*vindexes.Table, string, topodatapb.TabletType, key.Destination, error) { destKeyspace, destTabletType, dest, err := vc.executor.ParseDestinationTarget(name.Qualifier.String()) @@ -1351,6 +1361,37 @@ func (vc *vcursorImpl) CloneForReplicaWarming(ctx context.Context) engine.VCurso return v } +func (vc *vcursorImpl) CloneForMirroring(ctx context.Context) engine.VCursor { + callerId := callerid.EffectiveCallerIDFromContext(ctx) + immediateCallerId := callerid.ImmediateCallerIDFromContext(ctx) + + clonedCtx := callerid.NewContext(ctx, callerId, immediateCallerId) + + v := &vcursorImpl{ + safeSession: NewAutocommitSession(vc.safeSession.Session), + keyspace: vc.keyspace, + tabletType: vc.tabletType, + destination: vc.destination, + marginComments: vc.marginComments, + executor: vc.executor, + resolver: vc.resolver, + topoServer: vc.topoServer, + logStats: &logstats.LogStats{Ctx: clonedCtx}, + collation: vc.collation, + ignoreMaxMemoryRows: vc.ignoreMaxMemoryRows, + vschema: vc.vschema, + vm: vc.vm, + semTable: vc.semTable, + warnShardedOnly: vc.warnShardedOnly, + warnings: vc.warnings, + pv: vc.pv, + } + + v.marginComments.Trailing += "/* mirror query */" + + return v +} + // UpdateForeignKeyChecksState updates the foreign key checks state of the vcursor. func (vc *vcursorImpl) UpdateForeignKeyChecksState(fkStateFromQuery *bool) { // Initialize the state to unspecified. diff --git a/go/vt/vtgate/vindexes/vschema.go b/go/vt/vtgate/vindexes/vschema.go index e1044d0136d..9bacedbbbc6 100644 --- a/go/vt/vtgate/vindexes/vschema.go +++ b/go/vt/vtgate/vindexes/vschema.go @@ -63,6 +63,7 @@ const ( // VSchema represents the denormalized version of SrvVSchema, // used for building routing plans. type VSchema struct { + MirrorRules map[string]*MirrorRule `json:"mirror_rules"` RoutingRules map[string]*RoutingRule `json:"routing_rules"` // globalTables contains the name of all tables in all keyspaces. If the @@ -78,6 +79,13 @@ type VSchema struct { created time.Time } +// MirrorRule represents one mirror rule. +type MirrorRule struct { + Error error + Percent float32 + ToKeyspace string +} + // RoutingRule represents one routing rule. type RoutingRule struct { Tables []*Table @@ -312,6 +320,7 @@ func (source *Source) String() string { // BuildVSchema builds a VSchema from a SrvVSchema. func BuildVSchema(source *vschemapb.SrvVSchema, parser *sqlparser.Parser) (vschema *VSchema) { vschema = &VSchema{ + MirrorRules: make(map[string]*MirrorRule), RoutingRules: make(map[string]*RoutingRule), globalTables: make(map[string]*Table), uniqueVindexes: make(map[string]Vindex), @@ -325,6 +334,7 @@ func BuildVSchema(source *vschemapb.SrvVSchema, parser *sqlparser.Parser) (vsche buildReferences(source, vschema) buildRoutingRule(source, vschema, parser) buildShardRoutingRule(source, vschema) + buildMirrorRule(source, vschema, parser) // Resolve auto-increments after routing rules are built since sequence tables also obey routing rules. resolveAutoIncrement(source, vschema, parser) return vschema @@ -984,6 +994,19 @@ func buildShardRoutingRule(source *vschemapb.SrvVSchema, vschema *VSchema) { } } +func buildMirrorRule(source *vschemapb.SrvVSchema, vschema *VSchema, parser *sqlparser.Parser) { + if source.MirrorRules == nil { + return + } + for _, rule := range source.MirrorRules.Rules { + mr := &MirrorRule{ + Percent: rule.Percent, + ToKeyspace: rule.ToKeyspace, + } + vschema.MirrorRules[rule.FromKeyspace] = mr + } +} + // FindTable returns a pointer to the Table. If a keyspace is specified, only tables // from that keyspace are searched. If the specified keyspace is unsharded // and no tables matched, it's considered valid: FindTable will construct a table @@ -1245,6 +1268,23 @@ func (vschema *VSchema) ResetCreated() { vschema.created = time.Time{} } +// FindMirrorRule finds the mirror rule for the requested keyspace. +func (vschema *VSchema) FindMirrorRule(keyspace string) (*MirrorRule, error) { + mr, ok := vschema.MirrorRules[keyspace] + if ok { + if mr.Error != nil { + return nil, mr.Error + } + return mr, nil + } + return nil, nil +} + +// HasMirrorRules returns true if the keyspace has any mirror rules. +func (vschema *VSchema) HasMirrorRules() bool { + return len(vschema.MirrorRules) > 0 +} + // ByCost provides the interface needed for ColumnVindexes to // be sorted by cost order. type ByCost []*ColumnVindex diff --git a/go/vt/vtgate/vindexes/vschema_test.go b/go/vt/vtgate/vindexes/vschema_test.go index ad892a66ccb..89fe73805fc 100644 --- a/go/vt/vtgate/vindexes/vschema_test.go +++ b/go/vt/vtgate/vindexes/vschema_test.go @@ -741,6 +741,7 @@ func TestVSchemaRoutingRules(t *testing.T) { Keyspace: ks2, } want := &VSchema{ + MirrorRules: map[string]*MirrorRule{}, RoutingRules: map[string]*RoutingRule{ "rt1": { Error: errors.New("table rt1 has more than one target: [ks1.t1 ks2.t2]"), @@ -1150,6 +1151,7 @@ func TestShardedVSchemaMultiColumnVindex(t *testing.T) { t1.ColumnVindexes[0], } want := &VSchema{ + MirrorRules: map[string]*MirrorRule{}, RoutingRules: map[string]*RoutingRule{}, globalTables: map[string]*Table{ "t1": t1, @@ -1226,6 +1228,7 @@ func TestShardedVSchemaNotOwned(t *testing.T) { t1.ColumnVindexes[1], t1.ColumnVindexes[0]} want := &VSchema{ + MirrorRules: map[string]*MirrorRule{}, RoutingRules: map[string]*RoutingRule{}, globalTables: map[string]*Table{ "t1": t1, @@ -1333,6 +1336,7 @@ func TestBuildVSchemaDupSeq(t *testing.T) { Keyspace: ksb, Type: "sequence"} want := &VSchema{ + MirrorRules: map[string]*MirrorRule{}, RoutingRules: map[string]*RoutingRule{}, globalTables: map[string]*Table{ "t1": nil, @@ -1394,6 +1398,7 @@ func TestBuildVSchemaDupTable(t *testing.T) { Keyspace: ksb, } want := &VSchema{ + MirrorRules: map[string]*MirrorRule{}, RoutingRules: map[string]*RoutingRule{}, globalTables: map[string]*Table{ "t1": nil, @@ -1523,6 +1528,7 @@ func TestBuildVSchemaDupVindex(t *testing.T) { t2.ColumnVindexes[0], } want := &VSchema{ + MirrorRules: map[string]*MirrorRule{}, RoutingRules: map[string]*RoutingRule{}, globalTables: map[string]*Table{ "t1": nil, @@ -2109,6 +2115,7 @@ func TestSequence(t *testing.T) { t2.ColumnVindexes[0], } want := &VSchema{ + MirrorRules: map[string]*MirrorRule{}, RoutingRules: map[string]*RoutingRule{}, globalTables: map[string]*Table{ "seq": seq, diff --git a/go/vt/vtgate/vschema_manager_test.go b/go/vt/vtgate/vschema_manager_test.go index 53cbc323720..a1057ac0f3a 100644 --- a/go/vt/vtgate/vschema_manager_test.go +++ b/go/vt/vtgate/vschema_manager_test.go @@ -234,6 +234,7 @@ func TestVSchemaUpdate(t *testing.T) { }, }, expected: &vindexes.VSchema{ + MirrorRules: map[string]*vindexes.MirrorRule{}, RoutingRules: map[string]*vindexes.RoutingRule{}, Keyspaces: map[string]*vindexes.KeyspaceSchema{ "ks": { @@ -457,6 +458,7 @@ func makeTestVSchema(ks string, sharded bool, tbls map[string]*vindexes.Table) * func makeTestEmptyVSchema() *vindexes.VSchema { return &vindexes.VSchema{ + MirrorRules: map[string]*vindexes.MirrorRule{}, RoutingRules: map[string]*vindexes.RoutingRule{}, Keyspaces: map[string]*vindexes.KeyspaceSchema{}, } diff --git a/proto/vschema.proto b/proto/vschema.proto index 45c1b7a3aa9..1449e3f615f 100644 --- a/proto/vschema.proto +++ b/proto/vschema.proto @@ -142,6 +142,7 @@ message SrvVSchema { map keyspaces = 1; RoutingRules routing_rules = 2; // table routing rules ShardRoutingRules shard_routing_rules = 3; + MirrorRules mirror_rules = 4; // mirror rules } // ShardRoutingRules specify the shard routing rules for the VSchema. @@ -155,3 +156,18 @@ message ShardRoutingRule { string to_keyspace = 2; string shard = 3; } + +// MirrorRules specify the high level mirror rules for the VSchema. +message MirrorRules { + // rules should ideally be a map. However protos dont't allow + // repeated fields as elements of a map. So, we use a list + // instead. + repeated MirrorRule rules = 1; +} + +// MirrorRule specifies a mirror rule. +message MirrorRule { + string from_keyspace = 1; + string to_keyspace = 2; + float percent = 3; +} diff --git a/proto/vtctldata.proto b/proto/vtctldata.proto index fd80b7ea69d..7e11ae0b15c 100644 --- a/proto/vtctldata.proto +++ b/proto/vtctldata.proto @@ -1882,3 +1882,37 @@ message WorkflowUpdateResponse { string summary = 1; repeated TabletInfo details = 2; } + +message ApplyMirrorRulesRequest { + vschema.MirrorRules mirror_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 ApplyMirrorRulesResponse { +} + +message GetMirrorRulesRequest { +} + +message GetMirrorRulesResponse { + vschema.MirrorRules mirror_rules = 1; +} + +message WorkflowMirrorTrafficRequest { + string keyspace = 1; + string workflow = 2; + float percent = 3; +} + +message WorkflowMirrorTrafficResponse { + string summary = 1; + string start_state = 2; + string current_state = 3; +} diff --git a/proto/vtctlservice.proto b/proto/vtctlservice.proto index 56bd30e540e..10c2bbdf6fb 100644 --- a/proto/vtctlservice.proto +++ b/proto/vtctlservice.proto @@ -352,4 +352,9 @@ service Vtctld { // WorkflowUpdate updates the configuration of a vreplication workflow // using the provided updated parameters. rpc WorkflowUpdate(vtctldata.WorkflowUpdateRequest) returns (vtctldata.WorkflowUpdateResponse) {}; + // ApplyMirrorRules applies the VSchema routing rules. + rpc ApplyMirrorRules(vtctldata.ApplyMirrorRulesRequest) returns (vtctldata.ApplyMirrorRulesResponse) {}; + // GetMirrorRules returns the VSchema routing rules. + rpc GetMirrorRules(vtctldata.GetMirrorRulesRequest) returns (vtctldata.GetMirrorRulesResponse) {}; + rpc WorkflowMirrorTraffic(vtctldata.WorkflowMirrorTrafficRequest) returns (vtctldata.WorkflowMirrorTrafficResponse) {}; } diff --git a/web/vtadmin/src/proto/vtadmin.d.ts b/web/vtadmin/src/proto/vtadmin.d.ts index cf7c5a0d184..85dbe4eadcd 100644 --- a/web/vtadmin/src/proto/vtadmin.d.ts +++ b/web/vtadmin/src/proto/vtadmin.d.ts @@ -41543,6 +41543,9 @@ export namespace vschema { /** SrvVSchema shard_routing_rules */ shard_routing_rules?: (vschema.IShardRoutingRules|null); + + /** SrvVSchema mirror_rules */ + mirror_rules?: (vschema.IMirrorRules|null); } /** Represents a SrvVSchema. */ @@ -41563,6 +41566,9 @@ export namespace vschema { /** SrvVSchema shard_routing_rules. */ public shard_routing_rules?: (vschema.IShardRoutingRules|null); + /** SrvVSchema mirror_rules. */ + public mirror_rules?: (vschema.IMirrorRules|null); + /** * Creates a new SrvVSchema instance using the specified properties. * @param [properties] Properties to set @@ -41846,6 +41852,212 @@ export namespace vschema { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a MirrorRules. */ + interface IMirrorRules { + + /** MirrorRules rules */ + rules?: (vschema.IMirrorRule[]|null); + } + + /** Represents a MirrorRules. */ + class MirrorRules implements IMirrorRules { + + /** + * Constructs a new MirrorRules. + * @param [properties] Properties to set + */ + constructor(properties?: vschema.IMirrorRules); + + /** MirrorRules rules. */ + public rules: vschema.IMirrorRule[]; + + /** + * Creates a new MirrorRules instance using the specified properties. + * @param [properties] Properties to set + * @returns MirrorRules instance + */ + public static create(properties?: vschema.IMirrorRules): vschema.MirrorRules; + + /** + * Encodes the specified MirrorRules message. Does not implicitly {@link vschema.MirrorRules.verify|verify} messages. + * @param message MirrorRules message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: vschema.IMirrorRules, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MirrorRules message, length delimited. Does not implicitly {@link vschema.MirrorRules.verify|verify} messages. + * @param message MirrorRules message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: vschema.IMirrorRules, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MirrorRules message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MirrorRules + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): vschema.MirrorRules; + + /** + * Decodes a MirrorRules message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MirrorRules + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): vschema.MirrorRules; + + /** + * Verifies a MirrorRules message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MirrorRules message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MirrorRules + */ + public static fromObject(object: { [k: string]: any }): vschema.MirrorRules; + + /** + * Creates a plain object from a MirrorRules message. Also converts values to other types if specified. + * @param message MirrorRules + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: vschema.MirrorRules, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MirrorRules to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MirrorRules + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MirrorRule. */ + interface IMirrorRule { + + /** MirrorRule from_keyspace */ + from_keyspace?: (string|null); + + /** MirrorRule to_keyspace */ + to_keyspace?: (string|null); + + /** MirrorRule percent */ + percent?: (number|null); + } + + /** Represents a MirrorRule. */ + class MirrorRule implements IMirrorRule { + + /** + * Constructs a new MirrorRule. + * @param [properties] Properties to set + */ + constructor(properties?: vschema.IMirrorRule); + + /** MirrorRule from_keyspace. */ + public from_keyspace: string; + + /** MirrorRule to_keyspace. */ + public to_keyspace: string; + + /** MirrorRule percent. */ + public percent: number; + + /** + * Creates a new MirrorRule instance using the specified properties. + * @param [properties] Properties to set + * @returns MirrorRule instance + */ + public static create(properties?: vschema.IMirrorRule): vschema.MirrorRule; + + /** + * Encodes the specified MirrorRule message. Does not implicitly {@link vschema.MirrorRule.verify|verify} messages. + * @param message MirrorRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: vschema.IMirrorRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MirrorRule message, length delimited. Does not implicitly {@link vschema.MirrorRule.verify|verify} messages. + * @param message MirrorRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: vschema.IMirrorRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MirrorRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MirrorRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): vschema.MirrorRule; + + /** + * Decodes a MirrorRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MirrorRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): vschema.MirrorRule; + + /** + * Verifies a MirrorRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MirrorRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MirrorRule + */ + public static fromObject(object: { [k: string]: any }): vschema.MirrorRule; + + /** + * Creates a plain object from a MirrorRule message. Also converts values to other types if specified. + * @param message MirrorRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: vschema.MirrorRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MirrorRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MirrorRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Namespace vtctldata. */ @@ -68319,4 +68531,610 @@ export namespace vtctldata { public static getTypeUrl(typeUrlPrefix?: string): string; } } + + /** Properties of an ApplyMirrorRulesRequest. */ + interface IApplyMirrorRulesRequest { + + /** ApplyMirrorRulesRequest mirror_rules */ + mirror_rules?: (vschema.IMirrorRules|null); + + /** ApplyMirrorRulesRequest skip_rebuild */ + skip_rebuild?: (boolean|null); + + /** ApplyMirrorRulesRequest rebuild_cells */ + rebuild_cells?: (string[]|null); + } + + /** Represents an ApplyMirrorRulesRequest. */ + class ApplyMirrorRulesRequest implements IApplyMirrorRulesRequest { + + /** + * Constructs a new ApplyMirrorRulesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: vtctldata.IApplyMirrorRulesRequest); + + /** ApplyMirrorRulesRequest mirror_rules. */ + public mirror_rules?: (vschema.IMirrorRules|null); + + /** ApplyMirrorRulesRequest skip_rebuild. */ + public skip_rebuild: boolean; + + /** ApplyMirrorRulesRequest rebuild_cells. */ + public rebuild_cells: string[]; + + /** + * Creates a new ApplyMirrorRulesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ApplyMirrorRulesRequest instance + */ + public static create(properties?: vtctldata.IApplyMirrorRulesRequest): vtctldata.ApplyMirrorRulesRequest; + + /** + * Encodes the specified ApplyMirrorRulesRequest message. Does not implicitly {@link vtctldata.ApplyMirrorRulesRequest.verify|verify} messages. + * @param message ApplyMirrorRulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: vtctldata.IApplyMirrorRulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApplyMirrorRulesRequest message, length delimited. Does not implicitly {@link vtctldata.ApplyMirrorRulesRequest.verify|verify} messages. + * @param message ApplyMirrorRulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: vtctldata.IApplyMirrorRulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApplyMirrorRulesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApplyMirrorRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): vtctldata.ApplyMirrorRulesRequest; + + /** + * Decodes an ApplyMirrorRulesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApplyMirrorRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): vtctldata.ApplyMirrorRulesRequest; + + /** + * Verifies an ApplyMirrorRulesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApplyMirrorRulesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApplyMirrorRulesRequest + */ + public static fromObject(object: { [k: string]: any }): vtctldata.ApplyMirrorRulesRequest; + + /** + * Creates a plain object from an ApplyMirrorRulesRequest message. Also converts values to other types if specified. + * @param message ApplyMirrorRulesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: vtctldata.ApplyMirrorRulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApplyMirrorRulesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApplyMirrorRulesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApplyMirrorRulesResponse. */ + interface IApplyMirrorRulesResponse { + } + + /** Represents an ApplyMirrorRulesResponse. */ + class ApplyMirrorRulesResponse implements IApplyMirrorRulesResponse { + + /** + * Constructs a new ApplyMirrorRulesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: vtctldata.IApplyMirrorRulesResponse); + + /** + * Creates a new ApplyMirrorRulesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ApplyMirrorRulesResponse instance + */ + public static create(properties?: vtctldata.IApplyMirrorRulesResponse): vtctldata.ApplyMirrorRulesResponse; + + /** + * Encodes the specified ApplyMirrorRulesResponse message. Does not implicitly {@link vtctldata.ApplyMirrorRulesResponse.verify|verify} messages. + * @param message ApplyMirrorRulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: vtctldata.IApplyMirrorRulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApplyMirrorRulesResponse message, length delimited. Does not implicitly {@link vtctldata.ApplyMirrorRulesResponse.verify|verify} messages. + * @param message ApplyMirrorRulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: vtctldata.IApplyMirrorRulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApplyMirrorRulesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApplyMirrorRulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): vtctldata.ApplyMirrorRulesResponse; + + /** + * Decodes an ApplyMirrorRulesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApplyMirrorRulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): vtctldata.ApplyMirrorRulesResponse; + + /** + * Verifies an ApplyMirrorRulesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApplyMirrorRulesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApplyMirrorRulesResponse + */ + public static fromObject(object: { [k: string]: any }): vtctldata.ApplyMirrorRulesResponse; + + /** + * Creates a plain object from an ApplyMirrorRulesResponse message. Also converts values to other types if specified. + * @param message ApplyMirrorRulesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: vtctldata.ApplyMirrorRulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApplyMirrorRulesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApplyMirrorRulesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetMirrorRulesRequest. */ + interface IGetMirrorRulesRequest { + } + + /** Represents a GetMirrorRulesRequest. */ + class GetMirrorRulesRequest implements IGetMirrorRulesRequest { + + /** + * Constructs a new GetMirrorRulesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: vtctldata.IGetMirrorRulesRequest); + + /** + * Creates a new GetMirrorRulesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMirrorRulesRequest instance + */ + public static create(properties?: vtctldata.IGetMirrorRulesRequest): vtctldata.GetMirrorRulesRequest; + + /** + * Encodes the specified GetMirrorRulesRequest message. Does not implicitly {@link vtctldata.GetMirrorRulesRequest.verify|verify} messages. + * @param message GetMirrorRulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: vtctldata.IGetMirrorRulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMirrorRulesRequest message, length delimited. Does not implicitly {@link vtctldata.GetMirrorRulesRequest.verify|verify} messages. + * @param message GetMirrorRulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: vtctldata.IGetMirrorRulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMirrorRulesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMirrorRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): vtctldata.GetMirrorRulesRequest; + + /** + * Decodes a GetMirrorRulesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMirrorRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): vtctldata.GetMirrorRulesRequest; + + /** + * Verifies a GetMirrorRulesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetMirrorRulesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMirrorRulesRequest + */ + public static fromObject(object: { [k: string]: any }): vtctldata.GetMirrorRulesRequest; + + /** + * Creates a plain object from a GetMirrorRulesRequest message. Also converts values to other types if specified. + * @param message GetMirrorRulesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: vtctldata.GetMirrorRulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetMirrorRulesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetMirrorRulesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetMirrorRulesResponse. */ + interface IGetMirrorRulesResponse { + + /** GetMirrorRulesResponse mirror_rules */ + mirror_rules?: (vschema.IMirrorRules|null); + } + + /** Represents a GetMirrorRulesResponse. */ + class GetMirrorRulesResponse implements IGetMirrorRulesResponse { + + /** + * Constructs a new GetMirrorRulesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: vtctldata.IGetMirrorRulesResponse); + + /** GetMirrorRulesResponse mirror_rules. */ + public mirror_rules?: (vschema.IMirrorRules|null); + + /** + * Creates a new GetMirrorRulesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMirrorRulesResponse instance + */ + public static create(properties?: vtctldata.IGetMirrorRulesResponse): vtctldata.GetMirrorRulesResponse; + + /** + * Encodes the specified GetMirrorRulesResponse message. Does not implicitly {@link vtctldata.GetMirrorRulesResponse.verify|verify} messages. + * @param message GetMirrorRulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: vtctldata.IGetMirrorRulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMirrorRulesResponse message, length delimited. Does not implicitly {@link vtctldata.GetMirrorRulesResponse.verify|verify} messages. + * @param message GetMirrorRulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: vtctldata.IGetMirrorRulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMirrorRulesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMirrorRulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): vtctldata.GetMirrorRulesResponse; + + /** + * Decodes a GetMirrorRulesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMirrorRulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): vtctldata.GetMirrorRulesResponse; + + /** + * Verifies a GetMirrorRulesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetMirrorRulesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMirrorRulesResponse + */ + public static fromObject(object: { [k: string]: any }): vtctldata.GetMirrorRulesResponse; + + /** + * Creates a plain object from a GetMirrorRulesResponse message. Also converts values to other types if specified. + * @param message GetMirrorRulesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: vtctldata.GetMirrorRulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetMirrorRulesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetMirrorRulesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WorkflowMirrorTrafficRequest. */ + interface IWorkflowMirrorTrafficRequest { + + /** WorkflowMirrorTrafficRequest keyspace */ + keyspace?: (string|null); + + /** WorkflowMirrorTrafficRequest workflow */ + workflow?: (string|null); + + /** WorkflowMirrorTrafficRequest percent */ + percent?: (number|null); + } + + /** Represents a WorkflowMirrorTrafficRequest. */ + class WorkflowMirrorTrafficRequest implements IWorkflowMirrorTrafficRequest { + + /** + * Constructs a new WorkflowMirrorTrafficRequest. + * @param [properties] Properties to set + */ + constructor(properties?: vtctldata.IWorkflowMirrorTrafficRequest); + + /** WorkflowMirrorTrafficRequest keyspace. */ + public keyspace: string; + + /** WorkflowMirrorTrafficRequest workflow. */ + public workflow: string; + + /** WorkflowMirrorTrafficRequest percent. */ + public percent: number; + + /** + * Creates a new WorkflowMirrorTrafficRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkflowMirrorTrafficRequest instance + */ + public static create(properties?: vtctldata.IWorkflowMirrorTrafficRequest): vtctldata.WorkflowMirrorTrafficRequest; + + /** + * Encodes the specified WorkflowMirrorTrafficRequest message. Does not implicitly {@link vtctldata.WorkflowMirrorTrafficRequest.verify|verify} messages. + * @param message WorkflowMirrorTrafficRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: vtctldata.IWorkflowMirrorTrafficRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkflowMirrorTrafficRequest message, length delimited. Does not implicitly {@link vtctldata.WorkflowMirrorTrafficRequest.verify|verify} messages. + * @param message WorkflowMirrorTrafficRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: vtctldata.IWorkflowMirrorTrafficRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkflowMirrorTrafficRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkflowMirrorTrafficRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): vtctldata.WorkflowMirrorTrafficRequest; + + /** + * Decodes a WorkflowMirrorTrafficRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkflowMirrorTrafficRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): vtctldata.WorkflowMirrorTrafficRequest; + + /** + * Verifies a WorkflowMirrorTrafficRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkflowMirrorTrafficRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkflowMirrorTrafficRequest + */ + public static fromObject(object: { [k: string]: any }): vtctldata.WorkflowMirrorTrafficRequest; + + /** + * Creates a plain object from a WorkflowMirrorTrafficRequest message. Also converts values to other types if specified. + * @param message WorkflowMirrorTrafficRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: vtctldata.WorkflowMirrorTrafficRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkflowMirrorTrafficRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkflowMirrorTrafficRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WorkflowMirrorTrafficResponse. */ + interface IWorkflowMirrorTrafficResponse { + + /** WorkflowMirrorTrafficResponse summary */ + summary?: (string|null); + + /** WorkflowMirrorTrafficResponse start_state */ + start_state?: (string|null); + + /** WorkflowMirrorTrafficResponse current_state */ + current_state?: (string|null); + } + + /** Represents a WorkflowMirrorTrafficResponse. */ + class WorkflowMirrorTrafficResponse implements IWorkflowMirrorTrafficResponse { + + /** + * Constructs a new WorkflowMirrorTrafficResponse. + * @param [properties] Properties to set + */ + constructor(properties?: vtctldata.IWorkflowMirrorTrafficResponse); + + /** WorkflowMirrorTrafficResponse summary. */ + public summary: string; + + /** WorkflowMirrorTrafficResponse start_state. */ + public start_state: string; + + /** WorkflowMirrorTrafficResponse current_state. */ + public current_state: string; + + /** + * Creates a new WorkflowMirrorTrafficResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkflowMirrorTrafficResponse instance + */ + public static create(properties?: vtctldata.IWorkflowMirrorTrafficResponse): vtctldata.WorkflowMirrorTrafficResponse; + + /** + * Encodes the specified WorkflowMirrorTrafficResponse message. Does not implicitly {@link vtctldata.WorkflowMirrorTrafficResponse.verify|verify} messages. + * @param message WorkflowMirrorTrafficResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: vtctldata.IWorkflowMirrorTrafficResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkflowMirrorTrafficResponse message, length delimited. Does not implicitly {@link vtctldata.WorkflowMirrorTrafficResponse.verify|verify} messages. + * @param message WorkflowMirrorTrafficResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: vtctldata.IWorkflowMirrorTrafficResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkflowMirrorTrafficResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkflowMirrorTrafficResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): vtctldata.WorkflowMirrorTrafficResponse; + + /** + * Decodes a WorkflowMirrorTrafficResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkflowMirrorTrafficResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): vtctldata.WorkflowMirrorTrafficResponse; + + /** + * Verifies a WorkflowMirrorTrafficResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkflowMirrorTrafficResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkflowMirrorTrafficResponse + */ + public static fromObject(object: { [k: string]: any }): vtctldata.WorkflowMirrorTrafficResponse; + + /** + * Creates a plain object from a WorkflowMirrorTrafficResponse message. Also converts values to other types if specified. + * @param message WorkflowMirrorTrafficResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: vtctldata.WorkflowMirrorTrafficResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkflowMirrorTrafficResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkflowMirrorTrafficResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } diff --git a/web/vtadmin/src/proto/vtadmin.js b/web/vtadmin/src/proto/vtadmin.js index fb92a6b6b94..746b7d2f581 100644 --- a/web/vtadmin/src/proto/vtadmin.js +++ b/web/vtadmin/src/proto/vtadmin.js @@ -101320,6 +101320,7 @@ export const vschema = $root.vschema = (() => { * @property {Object.|null} [keyspaces] SrvVSchema keyspaces * @property {vschema.IRoutingRules|null} [routing_rules] SrvVSchema routing_rules * @property {vschema.IShardRoutingRules|null} [shard_routing_rules] SrvVSchema shard_routing_rules + * @property {vschema.IMirrorRules|null} [mirror_rules] SrvVSchema mirror_rules */ /** @@ -101362,6 +101363,14 @@ export const vschema = $root.vschema = (() => { */ SrvVSchema.prototype.shard_routing_rules = null; + /** + * SrvVSchema mirror_rules. + * @member {vschema.IMirrorRules|null|undefined} mirror_rules + * @memberof vschema.SrvVSchema + * @instance + */ + SrvVSchema.prototype.mirror_rules = null; + /** * Creates a new SrvVSchema instance using the specified properties. * @function create @@ -101395,6 +101404,8 @@ export const vschema = $root.vschema = (() => { $root.vschema.RoutingRules.encode(message.routing_rules, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.shard_routing_rules != null && Object.hasOwnProperty.call(message, "shard_routing_rules")) $root.vschema.ShardRoutingRules.encode(message.shard_routing_rules, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mirror_rules != null && Object.hasOwnProperty.call(message, "mirror_rules")) + $root.vschema.MirrorRules.encode(message.mirror_rules, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -101460,6 +101471,10 @@ export const vschema = $root.vschema = (() => { message.shard_routing_rules = $root.vschema.ShardRoutingRules.decode(reader, reader.uint32()); break; } + case 4: { + message.mirror_rules = $root.vschema.MirrorRules.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -101515,6 +101530,11 @@ export const vschema = $root.vschema = (() => { if (error) return "shard_routing_rules." + error; } + if (message.mirror_rules != null && message.hasOwnProperty("mirror_rules")) { + let error = $root.vschema.MirrorRules.verify(message.mirror_rules); + if (error) + return "mirror_rules." + error; + } return null; }; @@ -101550,6 +101570,11 @@ export const vschema = $root.vschema = (() => { throw TypeError(".vschema.SrvVSchema.shard_routing_rules: object expected"); message.shard_routing_rules = $root.vschema.ShardRoutingRules.fromObject(object.shard_routing_rules); } + if (object.mirror_rules != null) { + if (typeof object.mirror_rules !== "object") + throw TypeError(".vschema.SrvVSchema.mirror_rules: object expected"); + message.mirror_rules = $root.vschema.MirrorRules.fromObject(object.mirror_rules); + } return message; }; @@ -101571,6 +101596,7 @@ export const vschema = $root.vschema = (() => { if (options.defaults) { object.routing_rules = null; object.shard_routing_rules = null; + object.mirror_rules = null; } let keys2; if (message.keyspaces && (keys2 = Object.keys(message.keyspaces)).length) { @@ -101582,6 +101608,8 @@ export const vschema = $root.vschema = (() => { object.routing_rules = $root.vschema.RoutingRules.toObject(message.routing_rules, options); if (message.shard_routing_rules != null && message.hasOwnProperty("shard_routing_rules")) object.shard_routing_rules = $root.vschema.ShardRoutingRules.toObject(message.shard_routing_rules, options); + if (message.mirror_rules != null && message.hasOwnProperty("mirror_rules")) + object.mirror_rules = $root.vschema.MirrorRules.toObject(message.mirror_rules, options); return object; }; @@ -102088,6 +102116,480 @@ export const vschema = $root.vschema = (() => { return ShardRoutingRule; })(); + vschema.MirrorRules = (function() { + + /** + * Properties of a MirrorRules. + * @memberof vschema + * @interface IMirrorRules + * @property {Array.|null} [rules] MirrorRules rules + */ + + /** + * Constructs a new MirrorRules. + * @memberof vschema + * @classdesc Represents a MirrorRules. + * @implements IMirrorRules + * @constructor + * @param {vschema.IMirrorRules=} [properties] Properties to set + */ + function MirrorRules(properties) { + this.rules = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MirrorRules rules. + * @member {Array.} rules + * @memberof vschema.MirrorRules + * @instance + */ + MirrorRules.prototype.rules = $util.emptyArray; + + /** + * Creates a new MirrorRules instance using the specified properties. + * @function create + * @memberof vschema.MirrorRules + * @static + * @param {vschema.IMirrorRules=} [properties] Properties to set + * @returns {vschema.MirrorRules} MirrorRules instance + */ + MirrorRules.create = function create(properties) { + return new MirrorRules(properties); + }; + + /** + * Encodes the specified MirrorRules message. Does not implicitly {@link vschema.MirrorRules.verify|verify} messages. + * @function encode + * @memberof vschema.MirrorRules + * @static + * @param {vschema.IMirrorRules} message MirrorRules message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MirrorRules.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (let i = 0; i < message.rules.length; ++i) + $root.vschema.MirrorRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MirrorRules message, length delimited. Does not implicitly {@link vschema.MirrorRules.verify|verify} messages. + * @function encodeDelimited + * @memberof vschema.MirrorRules + * @static + * @param {vschema.IMirrorRules} message MirrorRules message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MirrorRules.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MirrorRules message from the specified reader or buffer. + * @function decode + * @memberof vschema.MirrorRules + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {vschema.MirrorRules} MirrorRules + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MirrorRules.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.vschema.MirrorRules(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.vschema.MirrorRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MirrorRules message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof vschema.MirrorRules + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {vschema.MirrorRules} MirrorRules + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MirrorRules.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MirrorRules message. + * @function verify + * @memberof vschema.MirrorRules + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MirrorRules.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (let i = 0; i < message.rules.length; ++i) { + let error = $root.vschema.MirrorRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + return null; + }; + + /** + * Creates a MirrorRules message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof vschema.MirrorRules + * @static + * @param {Object.} object Plain object + * @returns {vschema.MirrorRules} MirrorRules + */ + MirrorRules.fromObject = function fromObject(object) { + if (object instanceof $root.vschema.MirrorRules) + return object; + let message = new $root.vschema.MirrorRules(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".vschema.MirrorRules.rules: array expected"); + message.rules = []; + for (let i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".vschema.MirrorRules.rules: object expected"); + message.rules[i] = $root.vschema.MirrorRule.fromObject(object.rules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MirrorRules message. Also converts values to other types if specified. + * @function toObject + * @memberof vschema.MirrorRules + * @static + * @param {vschema.MirrorRules} message MirrorRules + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MirrorRules.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (message.rules && message.rules.length) { + object.rules = []; + for (let j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.vschema.MirrorRule.toObject(message.rules[j], options); + } + return object; + }; + + /** + * Converts this MirrorRules to JSON. + * @function toJSON + * @memberof vschema.MirrorRules + * @instance + * @returns {Object.} JSON object + */ + MirrorRules.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MirrorRules + * @function getTypeUrl + * @memberof vschema.MirrorRules + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MirrorRules.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/vschema.MirrorRules"; + }; + + return MirrorRules; + })(); + + vschema.MirrorRule = (function() { + + /** + * Properties of a MirrorRule. + * @memberof vschema + * @interface IMirrorRule + * @property {string|null} [from_keyspace] MirrorRule from_keyspace + * @property {string|null} [to_keyspace] MirrorRule to_keyspace + * @property {number|null} [percent] MirrorRule percent + */ + + /** + * Constructs a new MirrorRule. + * @memberof vschema + * @classdesc Represents a MirrorRule. + * @implements IMirrorRule + * @constructor + * @param {vschema.IMirrorRule=} [properties] Properties to set + */ + function MirrorRule(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MirrorRule from_keyspace. + * @member {string} from_keyspace + * @memberof vschema.MirrorRule + * @instance + */ + MirrorRule.prototype.from_keyspace = ""; + + /** + * MirrorRule to_keyspace. + * @member {string} to_keyspace + * @memberof vschema.MirrorRule + * @instance + */ + MirrorRule.prototype.to_keyspace = ""; + + /** + * MirrorRule percent. + * @member {number} percent + * @memberof vschema.MirrorRule + * @instance + */ + MirrorRule.prototype.percent = 0; + + /** + * Creates a new MirrorRule instance using the specified properties. + * @function create + * @memberof vschema.MirrorRule + * @static + * @param {vschema.IMirrorRule=} [properties] Properties to set + * @returns {vschema.MirrorRule} MirrorRule instance + */ + MirrorRule.create = function create(properties) { + return new MirrorRule(properties); + }; + + /** + * Encodes the specified MirrorRule message. Does not implicitly {@link vschema.MirrorRule.verify|verify} messages. + * @function encode + * @memberof vschema.MirrorRule + * @static + * @param {vschema.IMirrorRule} message MirrorRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MirrorRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.from_keyspace != null && Object.hasOwnProperty.call(message, "from_keyspace")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.from_keyspace); + if (message.to_keyspace != null && Object.hasOwnProperty.call(message, "to_keyspace")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.to_keyspace); + if (message.percent != null && Object.hasOwnProperty.call(message, "percent")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.percent); + return writer; + }; + + /** + * Encodes the specified MirrorRule message, length delimited. Does not implicitly {@link vschema.MirrorRule.verify|verify} messages. + * @function encodeDelimited + * @memberof vschema.MirrorRule + * @static + * @param {vschema.IMirrorRule} message MirrorRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MirrorRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MirrorRule message from the specified reader or buffer. + * @function decode + * @memberof vschema.MirrorRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {vschema.MirrorRule} MirrorRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MirrorRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.vschema.MirrorRule(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.from_keyspace = reader.string(); + break; + } + case 2: { + message.to_keyspace = reader.string(); + break; + } + case 3: { + message.percent = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MirrorRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof vschema.MirrorRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {vschema.MirrorRule} MirrorRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MirrorRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MirrorRule message. + * @function verify + * @memberof vschema.MirrorRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MirrorRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.from_keyspace != null && message.hasOwnProperty("from_keyspace")) + if (!$util.isString(message.from_keyspace)) + return "from_keyspace: string expected"; + if (message.to_keyspace != null && message.hasOwnProperty("to_keyspace")) + if (!$util.isString(message.to_keyspace)) + return "to_keyspace: string expected"; + if (message.percent != null && message.hasOwnProperty("percent")) + if (typeof message.percent !== "number") + return "percent: number expected"; + return null; + }; + + /** + * Creates a MirrorRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof vschema.MirrorRule + * @static + * @param {Object.} object Plain object + * @returns {vschema.MirrorRule} MirrorRule + */ + MirrorRule.fromObject = function fromObject(object) { + if (object instanceof $root.vschema.MirrorRule) + return object; + let message = new $root.vschema.MirrorRule(); + if (object.from_keyspace != null) + message.from_keyspace = String(object.from_keyspace); + if (object.to_keyspace != null) + message.to_keyspace = String(object.to_keyspace); + if (object.percent != null) + message.percent = Number(object.percent); + return message; + }; + + /** + * Creates a plain object from a MirrorRule message. Also converts values to other types if specified. + * @function toObject + * @memberof vschema.MirrorRule + * @static + * @param {vschema.MirrorRule} message MirrorRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MirrorRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.from_keyspace = ""; + object.to_keyspace = ""; + object.percent = 0; + } + if (message.from_keyspace != null && message.hasOwnProperty("from_keyspace")) + object.from_keyspace = message.from_keyspace; + if (message.to_keyspace != null && message.hasOwnProperty("to_keyspace")) + object.to_keyspace = message.to_keyspace; + if (message.percent != null && message.hasOwnProperty("percent")) + object.percent = options.json && !isFinite(message.percent) ? String(message.percent) : message.percent; + return object; + }; + + /** + * Converts this MirrorRule to JSON. + * @function toJSON + * @memberof vschema.MirrorRule + * @instance + * @returns {Object.} JSON object + */ + MirrorRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MirrorRule + * @function getTypeUrl + * @memberof vschema.MirrorRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MirrorRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/vschema.MirrorRule"; + }; + + return MirrorRule; + })(); + return vschema; })(); @@ -166512,6 +167014,1336 @@ export const vtctldata = $root.vtctldata = (() => { return WorkflowUpdateResponse; })(); + vtctldata.ApplyMirrorRulesRequest = (function() { + + /** + * Properties of an ApplyMirrorRulesRequest. + * @memberof vtctldata + * @interface IApplyMirrorRulesRequest + * @property {vschema.IMirrorRules|null} [mirror_rules] ApplyMirrorRulesRequest mirror_rules + * @property {boolean|null} [skip_rebuild] ApplyMirrorRulesRequest skip_rebuild + * @property {Array.|null} [rebuild_cells] ApplyMirrorRulesRequest rebuild_cells + */ + + /** + * Constructs a new ApplyMirrorRulesRequest. + * @memberof vtctldata + * @classdesc Represents an ApplyMirrorRulesRequest. + * @implements IApplyMirrorRulesRequest + * @constructor + * @param {vtctldata.IApplyMirrorRulesRequest=} [properties] Properties to set + */ + function ApplyMirrorRulesRequest(properties) { + this.rebuild_cells = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApplyMirrorRulesRequest mirror_rules. + * @member {vschema.IMirrorRules|null|undefined} mirror_rules + * @memberof vtctldata.ApplyMirrorRulesRequest + * @instance + */ + ApplyMirrorRulesRequest.prototype.mirror_rules = null; + + /** + * ApplyMirrorRulesRequest skip_rebuild. + * @member {boolean} skip_rebuild + * @memberof vtctldata.ApplyMirrorRulesRequest + * @instance + */ + ApplyMirrorRulesRequest.prototype.skip_rebuild = false; + + /** + * ApplyMirrorRulesRequest rebuild_cells. + * @member {Array.} rebuild_cells + * @memberof vtctldata.ApplyMirrorRulesRequest + * @instance + */ + ApplyMirrorRulesRequest.prototype.rebuild_cells = $util.emptyArray; + + /** + * Creates a new ApplyMirrorRulesRequest instance using the specified properties. + * @function create + * @memberof vtctldata.ApplyMirrorRulesRequest + * @static + * @param {vtctldata.IApplyMirrorRulesRequest=} [properties] Properties to set + * @returns {vtctldata.ApplyMirrorRulesRequest} ApplyMirrorRulesRequest instance + */ + ApplyMirrorRulesRequest.create = function create(properties) { + return new ApplyMirrorRulesRequest(properties); + }; + + /** + * Encodes the specified ApplyMirrorRulesRequest message. Does not implicitly {@link vtctldata.ApplyMirrorRulesRequest.verify|verify} messages. + * @function encode + * @memberof vtctldata.ApplyMirrorRulesRequest + * @static + * @param {vtctldata.IApplyMirrorRulesRequest} message ApplyMirrorRulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplyMirrorRulesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mirror_rules != null && Object.hasOwnProperty.call(message, "mirror_rules")) + $root.vschema.MirrorRules.encode(message.mirror_rules, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.skip_rebuild != null && Object.hasOwnProperty.call(message, "skip_rebuild")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.skip_rebuild); + if (message.rebuild_cells != null && message.rebuild_cells.length) + for (let i = 0; i < message.rebuild_cells.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.rebuild_cells[i]); + return writer; + }; + + /** + * Encodes the specified ApplyMirrorRulesRequest message, length delimited. Does not implicitly {@link vtctldata.ApplyMirrorRulesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof vtctldata.ApplyMirrorRulesRequest + * @static + * @param {vtctldata.IApplyMirrorRulesRequest} message ApplyMirrorRulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplyMirrorRulesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApplyMirrorRulesRequest message from the specified reader or buffer. + * @function decode + * @memberof vtctldata.ApplyMirrorRulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {vtctldata.ApplyMirrorRulesRequest} ApplyMirrorRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplyMirrorRulesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.vtctldata.ApplyMirrorRulesRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mirror_rules = $root.vschema.MirrorRules.decode(reader, reader.uint32()); + break; + } + case 2: { + message.skip_rebuild = reader.bool(); + break; + } + case 3: { + if (!(message.rebuild_cells && message.rebuild_cells.length)) + message.rebuild_cells = []; + message.rebuild_cells.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApplyMirrorRulesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof vtctldata.ApplyMirrorRulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {vtctldata.ApplyMirrorRulesRequest} ApplyMirrorRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplyMirrorRulesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApplyMirrorRulesRequest message. + * @function verify + * @memberof vtctldata.ApplyMirrorRulesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApplyMirrorRulesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mirror_rules != null && message.hasOwnProperty("mirror_rules")) { + let error = $root.vschema.MirrorRules.verify(message.mirror_rules); + if (error) + return "mirror_rules." + error; + } + if (message.skip_rebuild != null && message.hasOwnProperty("skip_rebuild")) + if (typeof message.skip_rebuild !== "boolean") + return "skip_rebuild: boolean expected"; + if (message.rebuild_cells != null && message.hasOwnProperty("rebuild_cells")) { + if (!Array.isArray(message.rebuild_cells)) + return "rebuild_cells: array expected"; + for (let i = 0; i < message.rebuild_cells.length; ++i) + if (!$util.isString(message.rebuild_cells[i])) + return "rebuild_cells: string[] expected"; + } + return null; + }; + + /** + * Creates an ApplyMirrorRulesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof vtctldata.ApplyMirrorRulesRequest + * @static + * @param {Object.} object Plain object + * @returns {vtctldata.ApplyMirrorRulesRequest} ApplyMirrorRulesRequest + */ + ApplyMirrorRulesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.vtctldata.ApplyMirrorRulesRequest) + return object; + let message = new $root.vtctldata.ApplyMirrorRulesRequest(); + if (object.mirror_rules != null) { + if (typeof object.mirror_rules !== "object") + throw TypeError(".vtctldata.ApplyMirrorRulesRequest.mirror_rules: object expected"); + message.mirror_rules = $root.vschema.MirrorRules.fromObject(object.mirror_rules); + } + if (object.skip_rebuild != null) + message.skip_rebuild = Boolean(object.skip_rebuild); + if (object.rebuild_cells) { + if (!Array.isArray(object.rebuild_cells)) + throw TypeError(".vtctldata.ApplyMirrorRulesRequest.rebuild_cells: array expected"); + message.rebuild_cells = []; + for (let i = 0; i < object.rebuild_cells.length; ++i) + message.rebuild_cells[i] = String(object.rebuild_cells[i]); + } + return message; + }; + + /** + * Creates a plain object from an ApplyMirrorRulesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof vtctldata.ApplyMirrorRulesRequest + * @static + * @param {vtctldata.ApplyMirrorRulesRequest} message ApplyMirrorRulesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApplyMirrorRulesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.rebuild_cells = []; + if (options.defaults) { + object.mirror_rules = null; + object.skip_rebuild = false; + } + if (message.mirror_rules != null && message.hasOwnProperty("mirror_rules")) + object.mirror_rules = $root.vschema.MirrorRules.toObject(message.mirror_rules, options); + if (message.skip_rebuild != null && message.hasOwnProperty("skip_rebuild")) + object.skip_rebuild = message.skip_rebuild; + if (message.rebuild_cells && message.rebuild_cells.length) { + object.rebuild_cells = []; + for (let j = 0; j < message.rebuild_cells.length; ++j) + object.rebuild_cells[j] = message.rebuild_cells[j]; + } + return object; + }; + + /** + * Converts this ApplyMirrorRulesRequest to JSON. + * @function toJSON + * @memberof vtctldata.ApplyMirrorRulesRequest + * @instance + * @returns {Object.} JSON object + */ + ApplyMirrorRulesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApplyMirrorRulesRequest + * @function getTypeUrl + * @memberof vtctldata.ApplyMirrorRulesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApplyMirrorRulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/vtctldata.ApplyMirrorRulesRequest"; + }; + + return ApplyMirrorRulesRequest; + })(); + + vtctldata.ApplyMirrorRulesResponse = (function() { + + /** + * Properties of an ApplyMirrorRulesResponse. + * @memberof vtctldata + * @interface IApplyMirrorRulesResponse + */ + + /** + * Constructs a new ApplyMirrorRulesResponse. + * @memberof vtctldata + * @classdesc Represents an ApplyMirrorRulesResponse. + * @implements IApplyMirrorRulesResponse + * @constructor + * @param {vtctldata.IApplyMirrorRulesResponse=} [properties] Properties to set + */ + function ApplyMirrorRulesResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ApplyMirrorRulesResponse instance using the specified properties. + * @function create + * @memberof vtctldata.ApplyMirrorRulesResponse + * @static + * @param {vtctldata.IApplyMirrorRulesResponse=} [properties] Properties to set + * @returns {vtctldata.ApplyMirrorRulesResponse} ApplyMirrorRulesResponse instance + */ + ApplyMirrorRulesResponse.create = function create(properties) { + return new ApplyMirrorRulesResponse(properties); + }; + + /** + * Encodes the specified ApplyMirrorRulesResponse message. Does not implicitly {@link vtctldata.ApplyMirrorRulesResponse.verify|verify} messages. + * @function encode + * @memberof vtctldata.ApplyMirrorRulesResponse + * @static + * @param {vtctldata.IApplyMirrorRulesResponse} message ApplyMirrorRulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplyMirrorRulesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ApplyMirrorRulesResponse message, length delimited. Does not implicitly {@link vtctldata.ApplyMirrorRulesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof vtctldata.ApplyMirrorRulesResponse + * @static + * @param {vtctldata.IApplyMirrorRulesResponse} message ApplyMirrorRulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplyMirrorRulesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApplyMirrorRulesResponse message from the specified reader or buffer. + * @function decode + * @memberof vtctldata.ApplyMirrorRulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {vtctldata.ApplyMirrorRulesResponse} ApplyMirrorRulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplyMirrorRulesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.vtctldata.ApplyMirrorRulesResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApplyMirrorRulesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof vtctldata.ApplyMirrorRulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {vtctldata.ApplyMirrorRulesResponse} ApplyMirrorRulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplyMirrorRulesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApplyMirrorRulesResponse message. + * @function verify + * @memberof vtctldata.ApplyMirrorRulesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApplyMirrorRulesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an ApplyMirrorRulesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof vtctldata.ApplyMirrorRulesResponse + * @static + * @param {Object.} object Plain object + * @returns {vtctldata.ApplyMirrorRulesResponse} ApplyMirrorRulesResponse + */ + ApplyMirrorRulesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.vtctldata.ApplyMirrorRulesResponse) + return object; + return new $root.vtctldata.ApplyMirrorRulesResponse(); + }; + + /** + * Creates a plain object from an ApplyMirrorRulesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof vtctldata.ApplyMirrorRulesResponse + * @static + * @param {vtctldata.ApplyMirrorRulesResponse} message ApplyMirrorRulesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApplyMirrorRulesResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ApplyMirrorRulesResponse to JSON. + * @function toJSON + * @memberof vtctldata.ApplyMirrorRulesResponse + * @instance + * @returns {Object.} JSON object + */ + ApplyMirrorRulesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApplyMirrorRulesResponse + * @function getTypeUrl + * @memberof vtctldata.ApplyMirrorRulesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApplyMirrorRulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/vtctldata.ApplyMirrorRulesResponse"; + }; + + return ApplyMirrorRulesResponse; + })(); + + vtctldata.GetMirrorRulesRequest = (function() { + + /** + * Properties of a GetMirrorRulesRequest. + * @memberof vtctldata + * @interface IGetMirrorRulesRequest + */ + + /** + * Constructs a new GetMirrorRulesRequest. + * @memberof vtctldata + * @classdesc Represents a GetMirrorRulesRequest. + * @implements IGetMirrorRulesRequest + * @constructor + * @param {vtctldata.IGetMirrorRulesRequest=} [properties] Properties to set + */ + function GetMirrorRulesRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new GetMirrorRulesRequest instance using the specified properties. + * @function create + * @memberof vtctldata.GetMirrorRulesRequest + * @static + * @param {vtctldata.IGetMirrorRulesRequest=} [properties] Properties to set + * @returns {vtctldata.GetMirrorRulesRequest} GetMirrorRulesRequest instance + */ + GetMirrorRulesRequest.create = function create(properties) { + return new GetMirrorRulesRequest(properties); + }; + + /** + * Encodes the specified GetMirrorRulesRequest message. Does not implicitly {@link vtctldata.GetMirrorRulesRequest.verify|verify} messages. + * @function encode + * @memberof vtctldata.GetMirrorRulesRequest + * @static + * @param {vtctldata.IGetMirrorRulesRequest} message GetMirrorRulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMirrorRulesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GetMirrorRulesRequest message, length delimited. Does not implicitly {@link vtctldata.GetMirrorRulesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof vtctldata.GetMirrorRulesRequest + * @static + * @param {vtctldata.IGetMirrorRulesRequest} message GetMirrorRulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMirrorRulesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMirrorRulesRequest message from the specified reader or buffer. + * @function decode + * @memberof vtctldata.GetMirrorRulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {vtctldata.GetMirrorRulesRequest} GetMirrorRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMirrorRulesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.vtctldata.GetMirrorRulesRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetMirrorRulesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof vtctldata.GetMirrorRulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {vtctldata.GetMirrorRulesRequest} GetMirrorRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMirrorRulesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMirrorRulesRequest message. + * @function verify + * @memberof vtctldata.GetMirrorRulesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMirrorRulesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GetMirrorRulesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof vtctldata.GetMirrorRulesRequest + * @static + * @param {Object.} object Plain object + * @returns {vtctldata.GetMirrorRulesRequest} GetMirrorRulesRequest + */ + GetMirrorRulesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.vtctldata.GetMirrorRulesRequest) + return object; + return new $root.vtctldata.GetMirrorRulesRequest(); + }; + + /** + * Creates a plain object from a GetMirrorRulesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof vtctldata.GetMirrorRulesRequest + * @static + * @param {vtctldata.GetMirrorRulesRequest} message GetMirrorRulesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMirrorRulesRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GetMirrorRulesRequest to JSON. + * @function toJSON + * @memberof vtctldata.GetMirrorRulesRequest + * @instance + * @returns {Object.} JSON object + */ + GetMirrorRulesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetMirrorRulesRequest + * @function getTypeUrl + * @memberof vtctldata.GetMirrorRulesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMirrorRulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/vtctldata.GetMirrorRulesRequest"; + }; + + return GetMirrorRulesRequest; + })(); + + vtctldata.GetMirrorRulesResponse = (function() { + + /** + * Properties of a GetMirrorRulesResponse. + * @memberof vtctldata + * @interface IGetMirrorRulesResponse + * @property {vschema.IMirrorRules|null} [mirror_rules] GetMirrorRulesResponse mirror_rules + */ + + /** + * Constructs a new GetMirrorRulesResponse. + * @memberof vtctldata + * @classdesc Represents a GetMirrorRulesResponse. + * @implements IGetMirrorRulesResponse + * @constructor + * @param {vtctldata.IGetMirrorRulesResponse=} [properties] Properties to set + */ + function GetMirrorRulesResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetMirrorRulesResponse mirror_rules. + * @member {vschema.IMirrorRules|null|undefined} mirror_rules + * @memberof vtctldata.GetMirrorRulesResponse + * @instance + */ + GetMirrorRulesResponse.prototype.mirror_rules = null; + + /** + * Creates a new GetMirrorRulesResponse instance using the specified properties. + * @function create + * @memberof vtctldata.GetMirrorRulesResponse + * @static + * @param {vtctldata.IGetMirrorRulesResponse=} [properties] Properties to set + * @returns {vtctldata.GetMirrorRulesResponse} GetMirrorRulesResponse instance + */ + GetMirrorRulesResponse.create = function create(properties) { + return new GetMirrorRulesResponse(properties); + }; + + /** + * Encodes the specified GetMirrorRulesResponse message. Does not implicitly {@link vtctldata.GetMirrorRulesResponse.verify|verify} messages. + * @function encode + * @memberof vtctldata.GetMirrorRulesResponse + * @static + * @param {vtctldata.IGetMirrorRulesResponse} message GetMirrorRulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMirrorRulesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mirror_rules != null && Object.hasOwnProperty.call(message, "mirror_rules")) + $root.vschema.MirrorRules.encode(message.mirror_rules, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetMirrorRulesResponse message, length delimited. Does not implicitly {@link vtctldata.GetMirrorRulesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof vtctldata.GetMirrorRulesResponse + * @static + * @param {vtctldata.IGetMirrorRulesResponse} message GetMirrorRulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMirrorRulesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMirrorRulesResponse message from the specified reader or buffer. + * @function decode + * @memberof vtctldata.GetMirrorRulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {vtctldata.GetMirrorRulesResponse} GetMirrorRulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMirrorRulesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.vtctldata.GetMirrorRulesResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mirror_rules = $root.vschema.MirrorRules.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetMirrorRulesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof vtctldata.GetMirrorRulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {vtctldata.GetMirrorRulesResponse} GetMirrorRulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMirrorRulesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMirrorRulesResponse message. + * @function verify + * @memberof vtctldata.GetMirrorRulesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMirrorRulesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mirror_rules != null && message.hasOwnProperty("mirror_rules")) { + let error = $root.vschema.MirrorRules.verify(message.mirror_rules); + if (error) + return "mirror_rules." + error; + } + return null; + }; + + /** + * Creates a GetMirrorRulesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof vtctldata.GetMirrorRulesResponse + * @static + * @param {Object.} object Plain object + * @returns {vtctldata.GetMirrorRulesResponse} GetMirrorRulesResponse + */ + GetMirrorRulesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.vtctldata.GetMirrorRulesResponse) + return object; + let message = new $root.vtctldata.GetMirrorRulesResponse(); + if (object.mirror_rules != null) { + if (typeof object.mirror_rules !== "object") + throw TypeError(".vtctldata.GetMirrorRulesResponse.mirror_rules: object expected"); + message.mirror_rules = $root.vschema.MirrorRules.fromObject(object.mirror_rules); + } + return message; + }; + + /** + * Creates a plain object from a GetMirrorRulesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof vtctldata.GetMirrorRulesResponse + * @static + * @param {vtctldata.GetMirrorRulesResponse} message GetMirrorRulesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMirrorRulesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.mirror_rules = null; + if (message.mirror_rules != null && message.hasOwnProperty("mirror_rules")) + object.mirror_rules = $root.vschema.MirrorRules.toObject(message.mirror_rules, options); + return object; + }; + + /** + * Converts this GetMirrorRulesResponse to JSON. + * @function toJSON + * @memberof vtctldata.GetMirrorRulesResponse + * @instance + * @returns {Object.} JSON object + */ + GetMirrorRulesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetMirrorRulesResponse + * @function getTypeUrl + * @memberof vtctldata.GetMirrorRulesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMirrorRulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/vtctldata.GetMirrorRulesResponse"; + }; + + return GetMirrorRulesResponse; + })(); + + vtctldata.WorkflowMirrorTrafficRequest = (function() { + + /** + * Properties of a WorkflowMirrorTrafficRequest. + * @memberof vtctldata + * @interface IWorkflowMirrorTrafficRequest + * @property {string|null} [keyspace] WorkflowMirrorTrafficRequest keyspace + * @property {string|null} [workflow] WorkflowMirrorTrafficRequest workflow + * @property {number|null} [percent] WorkflowMirrorTrafficRequest percent + */ + + /** + * Constructs a new WorkflowMirrorTrafficRequest. + * @memberof vtctldata + * @classdesc Represents a WorkflowMirrorTrafficRequest. + * @implements IWorkflowMirrorTrafficRequest + * @constructor + * @param {vtctldata.IWorkflowMirrorTrafficRequest=} [properties] Properties to set + */ + function WorkflowMirrorTrafficRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkflowMirrorTrafficRequest keyspace. + * @member {string} keyspace + * @memberof vtctldata.WorkflowMirrorTrafficRequest + * @instance + */ + WorkflowMirrorTrafficRequest.prototype.keyspace = ""; + + /** + * WorkflowMirrorTrafficRequest workflow. + * @member {string} workflow + * @memberof vtctldata.WorkflowMirrorTrafficRequest + * @instance + */ + WorkflowMirrorTrafficRequest.prototype.workflow = ""; + + /** + * WorkflowMirrorTrafficRequest percent. + * @member {number} percent + * @memberof vtctldata.WorkflowMirrorTrafficRequest + * @instance + */ + WorkflowMirrorTrafficRequest.prototype.percent = 0; + + /** + * Creates a new WorkflowMirrorTrafficRequest instance using the specified properties. + * @function create + * @memberof vtctldata.WorkflowMirrorTrafficRequest + * @static + * @param {vtctldata.IWorkflowMirrorTrafficRequest=} [properties] Properties to set + * @returns {vtctldata.WorkflowMirrorTrafficRequest} WorkflowMirrorTrafficRequest instance + */ + WorkflowMirrorTrafficRequest.create = function create(properties) { + return new WorkflowMirrorTrafficRequest(properties); + }; + + /** + * Encodes the specified WorkflowMirrorTrafficRequest message. Does not implicitly {@link vtctldata.WorkflowMirrorTrafficRequest.verify|verify} messages. + * @function encode + * @memberof vtctldata.WorkflowMirrorTrafficRequest + * @static + * @param {vtctldata.IWorkflowMirrorTrafficRequest} message WorkflowMirrorTrafficRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkflowMirrorTrafficRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyspace != null && Object.hasOwnProperty.call(message, "keyspace")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyspace); + if (message.workflow != null && Object.hasOwnProperty.call(message, "workflow")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.workflow); + if (message.percent != null && Object.hasOwnProperty.call(message, "percent")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.percent); + return writer; + }; + + /** + * Encodes the specified WorkflowMirrorTrafficRequest message, length delimited. Does not implicitly {@link vtctldata.WorkflowMirrorTrafficRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof vtctldata.WorkflowMirrorTrafficRequest + * @static + * @param {vtctldata.IWorkflowMirrorTrafficRequest} message WorkflowMirrorTrafficRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkflowMirrorTrafficRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkflowMirrorTrafficRequest message from the specified reader or buffer. + * @function decode + * @memberof vtctldata.WorkflowMirrorTrafficRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {vtctldata.WorkflowMirrorTrafficRequest} WorkflowMirrorTrafficRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkflowMirrorTrafficRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.vtctldata.WorkflowMirrorTrafficRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.keyspace = reader.string(); + break; + } + case 2: { + message.workflow = reader.string(); + break; + } + case 3: { + message.percent = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkflowMirrorTrafficRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof vtctldata.WorkflowMirrorTrafficRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {vtctldata.WorkflowMirrorTrafficRequest} WorkflowMirrorTrafficRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkflowMirrorTrafficRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkflowMirrorTrafficRequest message. + * @function verify + * @memberof vtctldata.WorkflowMirrorTrafficRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkflowMirrorTrafficRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyspace != null && message.hasOwnProperty("keyspace")) + if (!$util.isString(message.keyspace)) + return "keyspace: string expected"; + if (message.workflow != null && message.hasOwnProperty("workflow")) + if (!$util.isString(message.workflow)) + return "workflow: string expected"; + if (message.percent != null && message.hasOwnProperty("percent")) + if (typeof message.percent !== "number") + return "percent: number expected"; + return null; + }; + + /** + * Creates a WorkflowMirrorTrafficRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof vtctldata.WorkflowMirrorTrafficRequest + * @static + * @param {Object.} object Plain object + * @returns {vtctldata.WorkflowMirrorTrafficRequest} WorkflowMirrorTrafficRequest + */ + WorkflowMirrorTrafficRequest.fromObject = function fromObject(object) { + if (object instanceof $root.vtctldata.WorkflowMirrorTrafficRequest) + return object; + let message = new $root.vtctldata.WorkflowMirrorTrafficRequest(); + if (object.keyspace != null) + message.keyspace = String(object.keyspace); + if (object.workflow != null) + message.workflow = String(object.workflow); + if (object.percent != null) + message.percent = Number(object.percent); + return message; + }; + + /** + * Creates a plain object from a WorkflowMirrorTrafficRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof vtctldata.WorkflowMirrorTrafficRequest + * @static + * @param {vtctldata.WorkflowMirrorTrafficRequest} message WorkflowMirrorTrafficRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkflowMirrorTrafficRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.keyspace = ""; + object.workflow = ""; + object.percent = 0; + } + if (message.keyspace != null && message.hasOwnProperty("keyspace")) + object.keyspace = message.keyspace; + if (message.workflow != null && message.hasOwnProperty("workflow")) + object.workflow = message.workflow; + if (message.percent != null && message.hasOwnProperty("percent")) + object.percent = options.json && !isFinite(message.percent) ? String(message.percent) : message.percent; + return object; + }; + + /** + * Converts this WorkflowMirrorTrafficRequest to JSON. + * @function toJSON + * @memberof vtctldata.WorkflowMirrorTrafficRequest + * @instance + * @returns {Object.} JSON object + */ + WorkflowMirrorTrafficRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkflowMirrorTrafficRequest + * @function getTypeUrl + * @memberof vtctldata.WorkflowMirrorTrafficRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkflowMirrorTrafficRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/vtctldata.WorkflowMirrorTrafficRequest"; + }; + + return WorkflowMirrorTrafficRequest; + })(); + + vtctldata.WorkflowMirrorTrafficResponse = (function() { + + /** + * Properties of a WorkflowMirrorTrafficResponse. + * @memberof vtctldata + * @interface IWorkflowMirrorTrafficResponse + * @property {string|null} [summary] WorkflowMirrorTrafficResponse summary + * @property {string|null} [start_state] WorkflowMirrorTrafficResponse start_state + * @property {string|null} [current_state] WorkflowMirrorTrafficResponse current_state + */ + + /** + * Constructs a new WorkflowMirrorTrafficResponse. + * @memberof vtctldata + * @classdesc Represents a WorkflowMirrorTrafficResponse. + * @implements IWorkflowMirrorTrafficResponse + * @constructor + * @param {vtctldata.IWorkflowMirrorTrafficResponse=} [properties] Properties to set + */ + function WorkflowMirrorTrafficResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkflowMirrorTrafficResponse summary. + * @member {string} summary + * @memberof vtctldata.WorkflowMirrorTrafficResponse + * @instance + */ + WorkflowMirrorTrafficResponse.prototype.summary = ""; + + /** + * WorkflowMirrorTrafficResponse start_state. + * @member {string} start_state + * @memberof vtctldata.WorkflowMirrorTrafficResponse + * @instance + */ + WorkflowMirrorTrafficResponse.prototype.start_state = ""; + + /** + * WorkflowMirrorTrafficResponse current_state. + * @member {string} current_state + * @memberof vtctldata.WorkflowMirrorTrafficResponse + * @instance + */ + WorkflowMirrorTrafficResponse.prototype.current_state = ""; + + /** + * Creates a new WorkflowMirrorTrafficResponse instance using the specified properties. + * @function create + * @memberof vtctldata.WorkflowMirrorTrafficResponse + * @static + * @param {vtctldata.IWorkflowMirrorTrafficResponse=} [properties] Properties to set + * @returns {vtctldata.WorkflowMirrorTrafficResponse} WorkflowMirrorTrafficResponse instance + */ + WorkflowMirrorTrafficResponse.create = function create(properties) { + return new WorkflowMirrorTrafficResponse(properties); + }; + + /** + * Encodes the specified WorkflowMirrorTrafficResponse message. Does not implicitly {@link vtctldata.WorkflowMirrorTrafficResponse.verify|verify} messages. + * @function encode + * @memberof vtctldata.WorkflowMirrorTrafficResponse + * @static + * @param {vtctldata.IWorkflowMirrorTrafficResponse} message WorkflowMirrorTrafficResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkflowMirrorTrafficResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.summary); + if (message.start_state != null && Object.hasOwnProperty.call(message, "start_state")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.start_state); + if (message.current_state != null && Object.hasOwnProperty.call(message, "current_state")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.current_state); + return writer; + }; + + /** + * Encodes the specified WorkflowMirrorTrafficResponse message, length delimited. Does not implicitly {@link vtctldata.WorkflowMirrorTrafficResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof vtctldata.WorkflowMirrorTrafficResponse + * @static + * @param {vtctldata.IWorkflowMirrorTrafficResponse} message WorkflowMirrorTrafficResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkflowMirrorTrafficResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkflowMirrorTrafficResponse message from the specified reader or buffer. + * @function decode + * @memberof vtctldata.WorkflowMirrorTrafficResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {vtctldata.WorkflowMirrorTrafficResponse} WorkflowMirrorTrafficResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkflowMirrorTrafficResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.vtctldata.WorkflowMirrorTrafficResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.summary = reader.string(); + break; + } + case 2: { + message.start_state = reader.string(); + break; + } + case 3: { + message.current_state = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkflowMirrorTrafficResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof vtctldata.WorkflowMirrorTrafficResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {vtctldata.WorkflowMirrorTrafficResponse} WorkflowMirrorTrafficResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkflowMirrorTrafficResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkflowMirrorTrafficResponse message. + * @function verify + * @memberof vtctldata.WorkflowMirrorTrafficResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkflowMirrorTrafficResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.summary != null && message.hasOwnProperty("summary")) + if (!$util.isString(message.summary)) + return "summary: string expected"; + if (message.start_state != null && message.hasOwnProperty("start_state")) + if (!$util.isString(message.start_state)) + return "start_state: string expected"; + if (message.current_state != null && message.hasOwnProperty("current_state")) + if (!$util.isString(message.current_state)) + return "current_state: string expected"; + return null; + }; + + /** + * Creates a WorkflowMirrorTrafficResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof vtctldata.WorkflowMirrorTrafficResponse + * @static + * @param {Object.} object Plain object + * @returns {vtctldata.WorkflowMirrorTrafficResponse} WorkflowMirrorTrafficResponse + */ + WorkflowMirrorTrafficResponse.fromObject = function fromObject(object) { + if (object instanceof $root.vtctldata.WorkflowMirrorTrafficResponse) + return object; + let message = new $root.vtctldata.WorkflowMirrorTrafficResponse(); + if (object.summary != null) + message.summary = String(object.summary); + if (object.start_state != null) + message.start_state = String(object.start_state); + if (object.current_state != null) + message.current_state = String(object.current_state); + return message; + }; + + /** + * Creates a plain object from a WorkflowMirrorTrafficResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof vtctldata.WorkflowMirrorTrafficResponse + * @static + * @param {vtctldata.WorkflowMirrorTrafficResponse} message WorkflowMirrorTrafficResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkflowMirrorTrafficResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.summary = ""; + object.start_state = ""; + object.current_state = ""; + } + if (message.summary != null && message.hasOwnProperty("summary")) + object.summary = message.summary; + if (message.start_state != null && message.hasOwnProperty("start_state")) + object.start_state = message.start_state; + if (message.current_state != null && message.hasOwnProperty("current_state")) + object.current_state = message.current_state; + return object; + }; + + /** + * Converts this WorkflowMirrorTrafficResponse to JSON. + * @function toJSON + * @memberof vtctldata.WorkflowMirrorTrafficResponse + * @instance + * @returns {Object.} JSON object + */ + WorkflowMirrorTrafficResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkflowMirrorTrafficResponse + * @function getTypeUrl + * @memberof vtctldata.WorkflowMirrorTrafficResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkflowMirrorTrafficResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/vtctldata.WorkflowMirrorTrafficResponse"; + }; + + return WorkflowMirrorTrafficResponse; + })(); + return vtctldata; })();