diff --git a/go/cmd/vtctldclient/command/vreplication/materialize/create.go b/go/cmd/vtctldclient/command/vreplication/materialize/create.go index 88aed1c664c..3eccd20df2a 100644 --- a/go/cmd/vtctldclient/command/vreplication/materialize/create.go +++ b/go/cmd/vtctldclient/command/vreplication/materialize/create.go @@ -93,6 +93,7 @@ func commandCreate(cmd *cobra.Command, args []string) error { ms := &vtctldatapb.MaterializeSettings{ Workflow: common.BaseOptions.Workflow, + MaterializationIntent: vtctldatapb.MaterializationIntent_CUSTOM, TargetKeyspace: common.BaseOptions.TargetKeyspace, SourceKeyspace: createOptions.SourceKeyspace, TableSettings: createOptions.TableSettings.val, diff --git a/go/test/endtoend/vreplication/helper_test.go b/go/test/endtoend/vreplication/helper_test.go index 54d057fe6e9..022262d4b15 100644 --- a/go/test/endtoend/vreplication/helper_test.go +++ b/go/test/endtoend/vreplication/helper_test.go @@ -568,11 +568,27 @@ func isTableInDenyList(t *testing.T, vc *VitessCluster, ksShard string, table st return found, nil } -func expectNumberOfStreams(t *testing.T, vtgateConn *mysql.Conn, name string, workflow string, database string, want int) { - query := sqlparser.BuildParsedQuery("select count(*) from %s.vreplication where workflow='%s'", sidecarDBIdentifier, workflow).Query +// expectNumberOfStreams waits for the given number of streams to be present and +// by default RUNNING. If you want to wait for different states, then you can +// pass in the state(s) you want to wait for. +func expectNumberOfStreams(t *testing.T, vtgateConn *mysql.Conn, name string, workflow string, database string, want int, states ...string) { + var query string + if len(states) == 0 { + states = append(states, binlogdatapb.VReplicationWorkflowState_Running.String()) + } + query = sqlparser.BuildParsedQuery("select count(*) from %s.vreplication where workflow='%s' and state in ('%s')", + sidecarDBIdentifier, workflow, strings.Join(states, "','")).Query waitForQueryResult(t, vtgateConn, database, query, fmt.Sprintf(`[[INT64(%d)]]`, want)) } +// confirmAllStreamsRunning confirms that all of the migrated streams are running +// after a Reshard. +func confirmAllStreamsRunning(t *testing.T, vtgateConn *mysql.Conn, database string) { + query := sqlparser.BuildParsedQuery("select count(*) from %s.vreplication where state != '%s'", + sidecarDBIdentifier, binlogdatapb.VReplicationWorkflowState_Running.String()).Query + waitForQueryResult(t, vtgateConn, database, query, `[[INT64(0)]]`) +} + func printShardPositions(vc *VitessCluster, ksShards []string) { for _, ksShard := range ksShards { output, err := vc.VtctlClient.ExecuteCommandWithOutput("ShardReplicationPositions", ksShard) diff --git a/go/test/endtoend/vreplication/migrate_test.go b/go/test/endtoend/vreplication/migrate_test.go index 5d927054000..1f365c47600 100644 --- a/go/test/endtoend/vreplication/migrate_test.go +++ b/go/test/endtoend/vreplication/migrate_test.go @@ -128,7 +128,7 @@ func TestVtctlMigrate(t *testing.T) { "--source=ext1.rating", "create", ksWorkflow); err != nil { t.Fatalf("Migrate command failed with %+v : %s\n", err, output) } - expectNumberOfStreams(t, vtgateConn, "migrate", "e1", "product:0", 1) + expectNumberOfStreams(t, vtgateConn, "migrate", "e1", "product:0", 1, binlogdatapb.VReplicationWorkflowState_Stopped.String()) waitForRowCount(t, vtgateConn, "product:0", "rating", 0) waitForRowCount(t, vtgateConn, "product:0", "review", 0) if output, err = vc.VtctlClient.ExecuteCommandWithOutput("Migrate", "cancel", ksWorkflow); err != nil { @@ -267,7 +267,7 @@ func TestVtctldMigrate(t *testing.T) { "--mount-name", "ext1", "--all-tables", "--auto-start=false", "--cells=extcell1") require.NoError(t, err, "Migrate command failed with %s", output) - expectNumberOfStreams(t, vtgateConn, "migrate", "e1", "product:0", 1) + expectNumberOfStreams(t, vtgateConn, "migrate", "e1", "product:0", 1, binlogdatapb.VReplicationWorkflowState_Stopped.String()) waitForRowCount(t, vtgateConn, "product:0", "rating", 0) waitForRowCount(t, vtgateConn, "product:0", "review", 0) output, err = vc.VtctldClient.ExecuteCommandWithOutput("Migrate", diff --git a/go/test/endtoend/vreplication/vreplication_test.go b/go/test/endtoend/vreplication/vreplication_test.go index c28118a97cc..d0d36cbbc28 100644 --- a/go/test/endtoend/vreplication/vreplication_test.go +++ b/go/test/endtoend/vreplication/vreplication_test.go @@ -338,10 +338,13 @@ func testVreplicationWorkflows(t *testing.T, limited bool, binlogRowImage string insertMoreCustomers(t, 16) reshardCustomer2to4Split(t, nil, "") + confirmAllStreamsRunning(t, vtgateConn, "customer:-40") expectNumberOfStreams(t, vtgateConn, "Customer2to4", "sales", "product:0", 4) reshardCustomer3to2SplitMerge(t) + confirmAllStreamsRunning(t, vtgateConn, "customer:-60") expectNumberOfStreams(t, vtgateConn, "Customer3to2", "sales", "product:0", 3) reshardCustomer3to1Merge(t) + confirmAllStreamsRunning(t, vtgateConn, "customer:0") expectNumberOfStreams(t, vtgateConn, "Customer3to1", "sales", "product:0", 1) t.Run("Verify CopyState Is Optimized Afterwards", func(t *testing.T) { diff --git a/go/vt/binlog/binlogplayer/binlog_player.go b/go/vt/binlog/binlogplayer/binlog_player.go index 9a3b3f9c59f..0fa61d21d2c 100644 --- a/go/vt/binlog/binlogplayer/binlog_player.go +++ b/go/vt/binlog/binlogplayer/binlog_player.go @@ -558,8 +558,7 @@ type VRSettings struct { DeferSecondaryKeys bool } -// ReadVRSettings retrieves the throttler settings for -// vreplication from the checkpoint table. +// ReadVRSettings retrieves the settings for a vreplication stream. func ReadVRSettings(dbClient DBClient, uid int32) (VRSettings, error) { query := fmt.Sprintf("select pos, stop_pos, max_tps, max_replication_lag, state, workflow_type, workflow, workflow_sub_type, defer_secondary_keys from _vt.vreplication where id=%v", uid) qr, err := dbClient.ExecuteFetch(query, 1) diff --git a/go/vt/binlog/binlogplayer/mock_dbclient.go b/go/vt/binlog/binlogplayer/mock_dbclient.go index e89c630b4d8..02e7ea28d7b 100644 --- a/go/vt/binlog/binlogplayer/mock_dbclient.go +++ b/go/vt/binlog/binlogplayer/mock_dbclient.go @@ -182,6 +182,10 @@ func (dc *MockDBClient) Close() { // ExecuteFetch is part of the DBClient interface func (dc *MockDBClient) ExecuteFetch(query string, maxrows int) (qr *sqltypes.Result, err error) { + // Serialize ExecuteFetch to enforce a strict order on shared dbClients. + dc.expectMu.Lock() + defer dc.expectMu.Unlock() + dc.t.Helper() msg := "DBClient query: %v" if dc.Tag != "" { @@ -195,8 +199,6 @@ func (dc *MockDBClient) ExecuteFetch(query string, maxrows int) (qr *sqltypes.Re } } - dc.expectMu.Lock() - defer dc.expectMu.Unlock() if dc.currentResult >= len(dc.expect) { msg := "DBClientMock: query: %s, no more requests are expected" if dc.Tag != "" { diff --git a/go/vt/discovery/tablet_picker.go b/go/vt/discovery/tablet_picker.go index 7525ab82dfc..d81dcf01354 100644 --- a/go/vt/discovery/tablet_picker.go +++ b/go/vt/discovery/tablet_picker.go @@ -35,6 +35,7 @@ import ( "vitess.io/vitess/go/vt/vttablet/tabletconn" querypb "vitess.io/vitess/go/vt/proto/query" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" topodatapb "vitess.io/vitess/go/vt/proto/topodata" vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" ) @@ -75,6 +76,16 @@ var ( } ) +// BuildTabletTypesString is a helper to build a serialized string representation of +// the tablet type(s) and optional in order clause for later use with the TabletPicker. +func BuildTabletTypesString(tabletTypes []topodatapb.TabletType, tabletSelectionPreference tabletmanagerdatapb.TabletSelectionPreference) string { + tabletTypesStr := topoproto.MakeStringTypeCSV(tabletTypes) + if tabletSelectionPreference == tabletmanagerdatapb.TabletSelectionPreference_INORDER { + tabletTypesStr = InOrderHint + tabletTypesStr + } + return tabletTypesStr +} + // GetTabletPickerRetryDelay synchronizes changes to tabletPickerRetryDelay. Used in tests only at the moment func GetTabletPickerRetryDelay() time.Duration { muTabletPickerRetryDelay.Lock() diff --git a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go index 3de3681a896..44dca53e805 100644 --- a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go +++ b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go @@ -5061,6 +5061,225 @@ func (x *DeleteVReplicationWorkflowResponse) GetResult() *query.QueryResult { return nil } +type HasVReplicationWorkflowsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *HasVReplicationWorkflowsRequest) Reset() { + *x = HasVReplicationWorkflowsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_tabletmanagerdata_proto_msgTypes[100] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HasVReplicationWorkflowsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HasVReplicationWorkflowsRequest) ProtoMessage() {} + +func (x *HasVReplicationWorkflowsRequest) ProtoReflect() protoreflect.Message { + mi := &file_tabletmanagerdata_proto_msgTypes[100] + 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 HasVReplicationWorkflowsRequest.ProtoReflect.Descriptor instead. +func (*HasVReplicationWorkflowsRequest) Descriptor() ([]byte, []int) { + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{100} +} + +type HasVReplicationWorkflowsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Has bool `protobuf:"varint,1,opt,name=has,proto3" json:"has,omitempty"` +} + +func (x *HasVReplicationWorkflowsResponse) Reset() { + *x = HasVReplicationWorkflowsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_tabletmanagerdata_proto_msgTypes[101] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HasVReplicationWorkflowsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HasVReplicationWorkflowsResponse) ProtoMessage() {} + +func (x *HasVReplicationWorkflowsResponse) ProtoReflect() protoreflect.Message { + mi := &file_tabletmanagerdata_proto_msgTypes[101] + 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 HasVReplicationWorkflowsResponse.ProtoReflect.Descriptor instead. +func (*HasVReplicationWorkflowsResponse) Descriptor() ([]byte, []int) { + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{101} +} + +func (x *HasVReplicationWorkflowsResponse) GetHas() bool { + if x != nil { + return x.Has + } + return false +} + +type ReadVReplicationWorkflowsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IncludeIds []int32 `protobuf:"varint,1,rep,packed,name=include_ids,json=includeIds,proto3" json:"include_ids,omitempty"` + IncludeWorkflows []string `protobuf:"bytes,2,rep,name=include_workflows,json=includeWorkflows,proto3" json:"include_workflows,omitempty"` + IncludeStates []binlogdata.VReplicationWorkflowState `protobuf:"varint,3,rep,packed,name=include_states,json=includeStates,proto3,enum=binlogdata.VReplicationWorkflowState" json:"include_states,omitempty"` + ExcludeWorkflows []string `protobuf:"bytes,4,rep,name=exclude_workflows,json=excludeWorkflows,proto3" json:"exclude_workflows,omitempty"` + ExcludeStates []binlogdata.VReplicationWorkflowState `protobuf:"varint,5,rep,packed,name=exclude_states,json=excludeStates,proto3,enum=binlogdata.VReplicationWorkflowState" json:"exclude_states,omitempty"` + ExcludeFrozen bool `protobuf:"varint,6,opt,name=exclude_frozen,json=excludeFrozen,proto3" json:"exclude_frozen,omitempty"` +} + +func (x *ReadVReplicationWorkflowsRequest) Reset() { + *x = ReadVReplicationWorkflowsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_tabletmanagerdata_proto_msgTypes[102] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadVReplicationWorkflowsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadVReplicationWorkflowsRequest) ProtoMessage() {} + +func (x *ReadVReplicationWorkflowsRequest) ProtoReflect() protoreflect.Message { + mi := &file_tabletmanagerdata_proto_msgTypes[102] + 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 ReadVReplicationWorkflowsRequest.ProtoReflect.Descriptor instead. +func (*ReadVReplicationWorkflowsRequest) Descriptor() ([]byte, []int) { + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{102} +} + +func (x *ReadVReplicationWorkflowsRequest) GetIncludeIds() []int32 { + if x != nil { + return x.IncludeIds + } + return nil +} + +func (x *ReadVReplicationWorkflowsRequest) GetIncludeWorkflows() []string { + if x != nil { + return x.IncludeWorkflows + } + return nil +} + +func (x *ReadVReplicationWorkflowsRequest) GetIncludeStates() []binlogdata.VReplicationWorkflowState { + if x != nil { + return x.IncludeStates + } + return nil +} + +func (x *ReadVReplicationWorkflowsRequest) GetExcludeWorkflows() []string { + if x != nil { + return x.ExcludeWorkflows + } + return nil +} + +func (x *ReadVReplicationWorkflowsRequest) GetExcludeStates() []binlogdata.VReplicationWorkflowState { + if x != nil { + return x.ExcludeStates + } + return nil +} + +func (x *ReadVReplicationWorkflowsRequest) GetExcludeFrozen() bool { + if x != nil { + return x.ExcludeFrozen + } + return false +} + +type ReadVReplicationWorkflowsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Workflows []*ReadVReplicationWorkflowResponse `protobuf:"bytes,1,rep,name=workflows,proto3" json:"workflows,omitempty"` +} + +func (x *ReadVReplicationWorkflowsResponse) Reset() { + *x = ReadVReplicationWorkflowsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_tabletmanagerdata_proto_msgTypes[103] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadVReplicationWorkflowsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadVReplicationWorkflowsResponse) ProtoMessage() {} + +func (x *ReadVReplicationWorkflowsResponse) ProtoReflect() protoreflect.Message { + mi := &file_tabletmanagerdata_proto_msgTypes[103] + 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 ReadVReplicationWorkflowsResponse.ProtoReflect.Descriptor instead. +func (*ReadVReplicationWorkflowsResponse) Descriptor() ([]byte, []int) { + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{103} +} + +func (x *ReadVReplicationWorkflowsResponse) GetWorkflows() []*ReadVReplicationWorkflowResponse { + if x != nil { + return x.Workflows + } + return nil +} + type ReadVReplicationWorkflowRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -5072,7 +5291,7 @@ type ReadVReplicationWorkflowRequest struct { func (x *ReadVReplicationWorkflowRequest) Reset() { *x = ReadVReplicationWorkflowRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[100] + mi := &file_tabletmanagerdata_proto_msgTypes[104] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5085,7 +5304,7 @@ func (x *ReadVReplicationWorkflowRequest) String() string { func (*ReadVReplicationWorkflowRequest) ProtoMessage() {} func (x *ReadVReplicationWorkflowRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[100] + mi := &file_tabletmanagerdata_proto_msgTypes[104] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5098,7 +5317,7 @@ func (x *ReadVReplicationWorkflowRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadVReplicationWorkflowRequest.ProtoReflect.Descriptor instead. func (*ReadVReplicationWorkflowRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{100} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{104} } func (x *ReadVReplicationWorkflowRequest) GetWorkflow() string { @@ -5128,7 +5347,7 @@ type ReadVReplicationWorkflowResponse struct { func (x *ReadVReplicationWorkflowResponse) Reset() { *x = ReadVReplicationWorkflowResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[101] + mi := &file_tabletmanagerdata_proto_msgTypes[105] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5141,7 +5360,7 @@ func (x *ReadVReplicationWorkflowResponse) String() string { func (*ReadVReplicationWorkflowResponse) ProtoMessage() {} func (x *ReadVReplicationWorkflowResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[101] + mi := &file_tabletmanagerdata_proto_msgTypes[105] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5154,7 +5373,7 @@ func (x *ReadVReplicationWorkflowResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadVReplicationWorkflowResponse.ProtoReflect.Descriptor instead. func (*ReadVReplicationWorkflowResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{101} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{105} } func (x *ReadVReplicationWorkflowResponse) GetWorkflow() string { @@ -5243,7 +5462,7 @@ type VDiffRequest struct { func (x *VDiffRequest) Reset() { *x = VDiffRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[102] + mi := &file_tabletmanagerdata_proto_msgTypes[106] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5256,7 +5475,7 @@ func (x *VDiffRequest) String() string { func (*VDiffRequest) ProtoMessage() {} func (x *VDiffRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[102] + mi := &file_tabletmanagerdata_proto_msgTypes[106] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5269,7 +5488,7 @@ func (x *VDiffRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VDiffRequest.ProtoReflect.Descriptor instead. func (*VDiffRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{102} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{106} } func (x *VDiffRequest) GetKeyspace() string { @@ -5327,7 +5546,7 @@ type VDiffResponse struct { func (x *VDiffResponse) Reset() { *x = VDiffResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[103] + mi := &file_tabletmanagerdata_proto_msgTypes[107] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5340,7 +5559,7 @@ func (x *VDiffResponse) String() string { func (*VDiffResponse) ProtoMessage() {} func (x *VDiffResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[103] + mi := &file_tabletmanagerdata_proto_msgTypes[107] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5353,7 +5572,7 @@ func (x *VDiffResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VDiffResponse.ProtoReflect.Descriptor instead. func (*VDiffResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{103} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{107} } func (x *VDiffResponse) GetId() int64 { @@ -5391,7 +5610,7 @@ type VDiffPickerOptions struct { func (x *VDiffPickerOptions) Reset() { *x = VDiffPickerOptions{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[104] + mi := &file_tabletmanagerdata_proto_msgTypes[108] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5404,7 +5623,7 @@ func (x *VDiffPickerOptions) String() string { func (*VDiffPickerOptions) ProtoMessage() {} func (x *VDiffPickerOptions) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[104] + mi := &file_tabletmanagerdata_proto_msgTypes[108] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5417,7 +5636,7 @@ func (x *VDiffPickerOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use VDiffPickerOptions.ProtoReflect.Descriptor instead. func (*VDiffPickerOptions) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{104} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{108} } func (x *VDiffPickerOptions) GetTabletTypes() string { @@ -5456,7 +5675,7 @@ type VDiffReportOptions struct { func (x *VDiffReportOptions) Reset() { *x = VDiffReportOptions{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[105] + mi := &file_tabletmanagerdata_proto_msgTypes[109] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5469,7 +5688,7 @@ func (x *VDiffReportOptions) String() string { func (*VDiffReportOptions) ProtoMessage() {} func (x *VDiffReportOptions) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[105] + mi := &file_tabletmanagerdata_proto_msgTypes[109] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5482,7 +5701,7 @@ func (x *VDiffReportOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use VDiffReportOptions.ProtoReflect.Descriptor instead. func (*VDiffReportOptions) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{105} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{109} } func (x *VDiffReportOptions) GetOnlyPks() bool { @@ -5532,7 +5751,7 @@ type VDiffCoreOptions struct { func (x *VDiffCoreOptions) Reset() { *x = VDiffCoreOptions{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[106] + mi := &file_tabletmanagerdata_proto_msgTypes[110] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5545,7 +5764,7 @@ func (x *VDiffCoreOptions) String() string { func (*VDiffCoreOptions) ProtoMessage() {} func (x *VDiffCoreOptions) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[106] + mi := &file_tabletmanagerdata_proto_msgTypes[110] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5558,7 +5777,7 @@ func (x *VDiffCoreOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use VDiffCoreOptions.ProtoReflect.Descriptor instead. func (*VDiffCoreOptions) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{106} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{110} } func (x *VDiffCoreOptions) GetTables() string { @@ -5637,7 +5856,7 @@ type VDiffOptions struct { func (x *VDiffOptions) Reset() { *x = VDiffOptions{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[107] + mi := &file_tabletmanagerdata_proto_msgTypes[111] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5650,7 +5869,7 @@ func (x *VDiffOptions) String() string { func (*VDiffOptions) ProtoMessage() {} func (x *VDiffOptions) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[107] + mi := &file_tabletmanagerdata_proto_msgTypes[111] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5663,7 +5882,7 @@ func (x *VDiffOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use VDiffOptions.ProtoReflect.Descriptor instead. func (*VDiffOptions) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{107} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{111} } func (x *VDiffOptions) GetPickerOptions() *VDiffPickerOptions { @@ -5704,7 +5923,7 @@ type UpdateVReplicationWorkflowRequest struct { func (x *UpdateVReplicationWorkflowRequest) Reset() { *x = UpdateVReplicationWorkflowRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[108] + mi := &file_tabletmanagerdata_proto_msgTypes[112] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5717,7 +5936,7 @@ func (x *UpdateVReplicationWorkflowRequest) String() string { func (*UpdateVReplicationWorkflowRequest) ProtoMessage() {} func (x *UpdateVReplicationWorkflowRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[108] + mi := &file_tabletmanagerdata_proto_msgTypes[112] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5730,7 +5949,7 @@ func (x *UpdateVReplicationWorkflowRequest) ProtoReflect() protoreflect.Message // Deprecated: Use UpdateVReplicationWorkflowRequest.ProtoReflect.Descriptor instead. func (*UpdateVReplicationWorkflowRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{108} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{112} } func (x *UpdateVReplicationWorkflowRequest) GetWorkflow() string { @@ -5793,7 +6012,7 @@ type UpdateVReplicationWorkflowResponse struct { func (x *UpdateVReplicationWorkflowResponse) Reset() { *x = UpdateVReplicationWorkflowResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[109] + mi := &file_tabletmanagerdata_proto_msgTypes[113] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5806,7 +6025,7 @@ func (x *UpdateVReplicationWorkflowResponse) String() string { func (*UpdateVReplicationWorkflowResponse) ProtoMessage() {} func (x *UpdateVReplicationWorkflowResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[109] + mi := &file_tabletmanagerdata_proto_msgTypes[113] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5819,7 +6038,7 @@ func (x *UpdateVReplicationWorkflowResponse) ProtoReflect() protoreflect.Message // Deprecated: Use UpdateVReplicationWorkflowResponse.ProtoReflect.Descriptor instead. func (*UpdateVReplicationWorkflowResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{109} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{113} } func (x *UpdateVReplicationWorkflowResponse) GetResult() *query.QueryResult { @@ -5829,6 +6048,140 @@ func (x *UpdateVReplicationWorkflowResponse) GetResult() *query.QueryResult { return nil } +type UpdateVReplicationWorkflowsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AllWorkflows bool `protobuf:"varint,1,opt,name=all_workflows,json=allWorkflows,proto3" json:"all_workflows,omitempty"` + IncludeWorkflows []string `protobuf:"bytes,2,rep,name=include_workflows,json=includeWorkflows,proto3" json:"include_workflows,omitempty"` + ExcludeWorkflows []string `protobuf:"bytes,3,rep,name=exclude_workflows,json=excludeWorkflows,proto3" json:"exclude_workflows,omitempty"` + State binlogdata.VReplicationWorkflowState `protobuf:"varint,4,opt,name=state,proto3,enum=binlogdata.VReplicationWorkflowState" json:"state,omitempty"` + Message string `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` + StopPosition string `protobuf:"bytes,6,opt,name=stop_position,json=stopPosition,proto3" json:"stop_position,omitempty"` +} + +func (x *UpdateVReplicationWorkflowsRequest) Reset() { + *x = UpdateVReplicationWorkflowsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_tabletmanagerdata_proto_msgTypes[114] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateVReplicationWorkflowsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateVReplicationWorkflowsRequest) ProtoMessage() {} + +func (x *UpdateVReplicationWorkflowsRequest) ProtoReflect() protoreflect.Message { + mi := &file_tabletmanagerdata_proto_msgTypes[114] + 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 UpdateVReplicationWorkflowsRequest.ProtoReflect.Descriptor instead. +func (*UpdateVReplicationWorkflowsRequest) Descriptor() ([]byte, []int) { + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{114} +} + +func (x *UpdateVReplicationWorkflowsRequest) GetAllWorkflows() bool { + if x != nil { + return x.AllWorkflows + } + return false +} + +func (x *UpdateVReplicationWorkflowsRequest) GetIncludeWorkflows() []string { + if x != nil { + return x.IncludeWorkflows + } + return nil +} + +func (x *UpdateVReplicationWorkflowsRequest) GetExcludeWorkflows() []string { + if x != nil { + return x.ExcludeWorkflows + } + return nil +} + +func (x *UpdateVReplicationWorkflowsRequest) GetState() binlogdata.VReplicationWorkflowState { + if x != nil { + return x.State + } + return binlogdata.VReplicationWorkflowState(0) +} + +func (x *UpdateVReplicationWorkflowsRequest) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *UpdateVReplicationWorkflowsRequest) GetStopPosition() string { + if x != nil { + return x.StopPosition + } + return "" +} + +type UpdateVReplicationWorkflowsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Result *query.QueryResult `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` +} + +func (x *UpdateVReplicationWorkflowsResponse) Reset() { + *x = UpdateVReplicationWorkflowsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_tabletmanagerdata_proto_msgTypes[115] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateVReplicationWorkflowsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateVReplicationWorkflowsResponse) ProtoMessage() {} + +func (x *UpdateVReplicationWorkflowsResponse) ProtoReflect() protoreflect.Message { + mi := &file_tabletmanagerdata_proto_msgTypes[115] + 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 UpdateVReplicationWorkflowsResponse.ProtoReflect.Descriptor instead. +func (*UpdateVReplicationWorkflowsResponse) Descriptor() ([]byte, []int) { + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{115} +} + +func (x *UpdateVReplicationWorkflowsResponse) GetResult() *query.QueryResult { + if x != nil { + return x.Result + } + return nil +} + type ResetSequencesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -5840,7 +6193,7 @@ type ResetSequencesRequest struct { func (x *ResetSequencesRequest) Reset() { *x = ResetSequencesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[110] + mi := &file_tabletmanagerdata_proto_msgTypes[116] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5853,7 +6206,7 @@ func (x *ResetSequencesRequest) String() string { func (*ResetSequencesRequest) ProtoMessage() {} func (x *ResetSequencesRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[110] + mi := &file_tabletmanagerdata_proto_msgTypes[116] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5866,7 +6219,7 @@ func (x *ResetSequencesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ResetSequencesRequest.ProtoReflect.Descriptor instead. func (*ResetSequencesRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{110} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{116} } func (x *ResetSequencesRequest) GetTables() []string { @@ -5885,7 +6238,7 @@ type ResetSequencesResponse struct { func (x *ResetSequencesResponse) Reset() { *x = ResetSequencesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[111] + mi := &file_tabletmanagerdata_proto_msgTypes[117] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5898,7 +6251,7 @@ func (x *ResetSequencesResponse) String() string { func (*ResetSequencesResponse) ProtoMessage() {} func (x *ResetSequencesResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[111] + mi := &file_tabletmanagerdata_proto_msgTypes[117] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5911,7 +6264,7 @@ func (x *ResetSequencesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ResetSequencesResponse.ProtoReflect.Descriptor instead. func (*ResetSequencesResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{111} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{117} } type CheckThrottlerRequest struct { @@ -5925,7 +6278,7 @@ type CheckThrottlerRequest struct { func (x *CheckThrottlerRequest) Reset() { *x = CheckThrottlerRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[112] + mi := &file_tabletmanagerdata_proto_msgTypes[118] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5938,7 +6291,7 @@ func (x *CheckThrottlerRequest) String() string { func (*CheckThrottlerRequest) ProtoMessage() {} func (x *CheckThrottlerRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[112] + mi := &file_tabletmanagerdata_proto_msgTypes[118] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5951,7 +6304,7 @@ func (x *CheckThrottlerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckThrottlerRequest.ProtoReflect.Descriptor instead. func (*CheckThrottlerRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{112} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{118} } func (x *CheckThrottlerRequest) GetAppName() string { @@ -5984,7 +6337,7 @@ type CheckThrottlerResponse struct { func (x *CheckThrottlerResponse) Reset() { *x = CheckThrottlerResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[113] + mi := &file_tabletmanagerdata_proto_msgTypes[119] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5997,7 +6350,7 @@ func (x *CheckThrottlerResponse) String() string { func (*CheckThrottlerResponse) ProtoMessage() {} func (x *CheckThrottlerResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[113] + mi := &file_tabletmanagerdata_proto_msgTypes[119] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6010,7 +6363,7 @@ func (x *CheckThrottlerResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckThrottlerResponse.ProtoReflect.Descriptor instead. func (*CheckThrottlerResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{113} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{119} } func (x *CheckThrottlerResponse) GetStatusCode() int32 { @@ -6079,7 +6432,7 @@ type ReadVReplicationWorkflowResponse_Stream struct { func (x *ReadVReplicationWorkflowResponse_Stream) Reset() { *x = ReadVReplicationWorkflowResponse_Stream{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[117] + mi := &file_tabletmanagerdata_proto_msgTypes[123] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6092,7 +6445,7 @@ func (x *ReadVReplicationWorkflowResponse_Stream) String() string { func (*ReadVReplicationWorkflowResponse_Stream) ProtoMessage() {} func (x *ReadVReplicationWorkflowResponse_Stream) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[117] + mi := &file_tabletmanagerdata_proto_msgTypes[123] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6105,7 +6458,7 @@ func (x *ReadVReplicationWorkflowResponse_Stream) ProtoReflect() protoreflect.Me // Deprecated: Use ReadVReplicationWorkflowResponse_Stream.ProtoReflect.Descriptor instead. func (*ReadVReplicationWorkflowResponse_Stream) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{101, 0} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{105, 0} } func (x *ReadVReplicationWorkflowResponse_Stream) GetId() int32 { @@ -6738,216 +7091,274 @@ var file_tabletmanagerdata_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x22, 0x3d, 0x0a, 0x1f, 0x52, 0x65, 0x61, 0x64, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x22, - 0x94, 0x09, 0x0a, 0x20, 0x52, 0x65, 0x61, 0x64, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 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, 0x14, 0x0a, 0x05, 0x63, 0x65, 0x6c, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x63, 0x65, 0x6c, 0x6c, 0x73, 0x12, 0x37, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x74, - 0x6f, 0x70, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, - 0x6c, 0x0a, 0x1b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x53, - 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x52, 0x19, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x17, 0x0a, - 0x07, 0x64, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x64, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x49, 0x0a, 0x0d, 0x77, 0x6f, - 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x24, 0x2e, 0x62, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, - 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, - 0x6c, 0x6f, 0x77, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, - 0x77, 0x54, 0x79, 0x70, 0x65, 0x12, 0x53, 0x0a, 0x11, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, - 0x77, 0x5f, 0x73, 0x75, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x27, 0x2e, 0x62, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, 0x52, - 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, - 0x6f, 0x77, 0x53, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0f, 0x77, 0x6f, 0x72, 0x6b, 0x66, - 0x6c, 0x6f, 0x77, 0x53, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x64, 0x65, - 0x66, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x5f, 0x6b, 0x65, - 0x79, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x64, 0x65, 0x66, 0x65, 0x72, 0x53, - 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x54, 0x0a, 0x07, - 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, - 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, - 0x61, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x07, 0x73, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x73, 0x1a, 0xc1, 0x04, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2a, 0x0a, - 0x03, 0x62, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x62, 0x69, 0x6e, - 0x6c, 0x6f, 0x67, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x42, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x53, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x52, 0x03, 0x62, 0x6c, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x6f, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x73, - 0x74, 0x6f, 0x70, 0x5f, 0x70, 0x6f, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, - 0x74, 0x6f, 0x70, 0x50, 0x6f, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x70, - 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x54, 0x70, 0x73, 0x12, - 0x2e, 0x0a, 0x13, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6c, 0x61, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x6d, 0x61, - 0x78, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x61, 0x67, 0x12, - 0x2f, 0x0a, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x76, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x12, 0x41, 0x0a, 0x15, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0c, 0x2e, 0x76, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x14, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x12, 0x3b, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x62, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x64, 0x61, 0x74, 0x61, 0x2e, - 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, - 0x66, 0x6c, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x6f, - 0x77, 0x73, 0x5f, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0a, 0x72, 0x6f, 0x77, 0x73, 0x43, 0x6f, 0x70, 0x69, 0x65, 0x64, 0x12, 0x33, 0x0a, 0x0e, 0x74, - 0x69, 0x6d, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x76, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, - 0x12, 0x33, 0x0a, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, - 0x65, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x76, 0x74, 0x74, 0x69, 0x6d, - 0x65, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x54, 0x68, 0x72, 0x6f, - 0x74, 0x74, 0x6c, 0x65, 0x64, 0x12, 0x2f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, - 0x6e, 0x74, 0x5f, 0x74, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x18, 0x0e, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x54, 0x68, 0x72, - 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x22, 0xd7, 0x01, 0x0a, 0x0c, 0x56, 0x44, 0x69, 0x66, 0x66, - 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, - 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x61, 0x72, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x41, 0x72, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x64, 0x69, 0x66, 0x66, 0x5f, - 0x75, 0x75, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x64, 0x69, 0x66, - 0x66, 0x55, 0x75, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, 0x44, 0x69, 0x66, 0x66, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x22, 0x6a, 0x0a, 0x0d, 0x56, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x2a, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x12, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x1d, 0x0a, - 0x0a, 0x76, 0x64, 0x69, 0x66, 0x66, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x76, 0x64, 0x69, 0x66, 0x66, 0x55, 0x75, 0x69, 0x64, 0x22, 0x79, 0x0a, 0x12, - 0x56, 0x44, 0x69, 0x66, 0x66, 0x50, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, - 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, - 0x63, 0x65, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x43, 0x65, 0x6c, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x5f, 0x63, 0x65, 0x6c, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x43, 0x65, 0x6c, 0x6c, 0x22, 0x90, 0x01, 0x0a, 0x12, 0x56, 0x44, 0x69, 0x66, - 0x66, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x19, - 0x0a, 0x08, 0x6f, 0x6e, 0x6c, 0x79, 0x5f, 0x70, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x07, 0x6f, 0x6e, 0x6c, 0x79, 0x50, 0x6b, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x65, 0x62, - 0x75, 0x67, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, - 0x64, 0x65, 0x62, 0x75, 0x67, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, - 0x72, 0x6d, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, - 0x61, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6d, 0x61, 0x78, - 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x6f, 0x77, 0x73, 0x22, 0xda, 0x02, 0x0a, 0x10, 0x56, - 0x44, 0x69, 0x66, 0x66, 0x43, 0x6f, 0x72, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x16, 0x0a, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x75, 0x74, 0x6f, 0x5f, - 0x72, 0x65, 0x74, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x61, 0x75, 0x74, - 0x6f, 0x52, 0x65, 0x74, 0x72, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x6f, - 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x52, 0x6f, 0x77, - 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x12, 0x1d, 0x0a, - 0x0a, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x70, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x09, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x50, 0x63, 0x74, 0x12, 0x27, 0x0a, 0x0f, - 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x53, 0x65, - 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x38, 0x0a, 0x19, 0x6d, 0x61, 0x78, 0x5f, 0x65, 0x78, 0x74, - 0x72, 0x61, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61, - 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x15, 0x6d, 0x61, 0x78, 0x45, 0x78, 0x74, - 0x72, 0x61, 0x52, 0x6f, 0x77, 0x73, 0x54, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x12, - 0x2c, 0x0a, 0x12, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, - 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x28, 0x0a, - 0x10, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, - 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x44, 0x69, 0x66, 0x66, - 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x22, 0xf2, 0x01, 0x0a, 0x0c, 0x56, 0x44, 0x69, 0x66, - 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4c, 0x0a, 0x0e, 0x70, 0x69, 0x63, 0x6b, - 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x25, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, - 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, 0x44, 0x69, 0x66, 0x66, 0x50, 0x69, 0x63, 0x6b, 0x65, 0x72, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0d, 0x70, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x46, 0x0a, 0x0c, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x74, - 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, - 0x2e, 0x56, 0x44, 0x69, 0x66, 0x66, 0x43, 0x6f, 0x72, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x0b, 0x63, 0x6f, 0x72, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4c, - 0x0a, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, 0x44, 0x69, 0x66, 0x66, - 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0d, 0x72, - 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x81, 0x03, 0x0a, - 0x21, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x14, - 0x0a, 0x05, 0x63, 0x65, 0x6c, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x63, - 0x65, 0x6c, 0x6c, 0x73, 0x12, 0x37, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x74, 0x6f, 0x70, - 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x6c, 0x0a, - 0x1b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x53, 0x65, 0x6c, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x52, 0x19, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x6f, - 0x6e, 0x5f, 0x64, 0x64, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x62, 0x69, - 0x6e, 0x6c, 0x6f, 0x67, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4f, 0x6e, 0x44, 0x44, 0x4c, 0x41, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x6f, 0x6e, 0x44, 0x64, 0x6c, 0x12, 0x3b, 0x0a, 0x05, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x62, 0x69, 0x6e, - 0x6c, 0x6f, 0x67, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x68, 0x61, 0x72, - 0x64, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x73, 0x68, 0x61, 0x72, 0x64, 0x73, - 0x22, 0x50, 0x0a, 0x22, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, + 0x22, 0x21, 0x0a, 0x1f, 0x48, 0x61, 0x73, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0x34, 0x0a, 0x20, 0x48, 0x61, 0x73, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x61, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x68, 0x61, 0x73, 0x22, 0xe0, 0x02, 0x0a, 0x20, 0x52, 0x65, + 0x61, 0x64, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, + 0x0a, 0x0b, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x49, 0x64, 0x73, 0x12, + 0x2b, 0x0a, 0x11, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x66, + 0x6c, 0x6f, 0x77, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x69, 0x6e, 0x63, 0x6c, + 0x75, 0x64, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x12, 0x4c, 0x0a, 0x0e, + 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x62, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x69, 0x6e, 0x63, + 0x6c, 0x75, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, + 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x57, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x12, 0x4c, 0x0a, 0x0e, 0x65, 0x78, 0x63, 0x6c, 0x75, + 0x64, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0e, 0x32, + 0x25, 0x2e, 0x62, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, 0x52, 0x65, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, + 0x77, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, + 0x5f, 0x66, 0x72, 0x6f, 0x7a, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x65, + 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x46, 0x72, 0x6f, 0x7a, 0x65, 0x6e, 0x22, 0x76, 0x0a, 0x21, + 0x52, 0x65, 0x61, 0x64, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x51, 0x0a, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x56, 0x52, 0x65, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, + 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x66, + 0x6c, 0x6f, 0x77, 0x73, 0x22, 0x3d, 0x0a, 0x1f, 0x52, 0x65, 0x61, 0x64, 0x56, 0x52, 0x65, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, + 0x6c, 0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, + 0x6c, 0x6f, 0x77, 0x22, 0x94, 0x09, 0x0a, 0x20, 0x52, 0x65, 0x61, 0x64, 0x56, 0x52, 0x65, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 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, 0x14, 0x0a, 0x05, 0x63, 0x65, 0x6c, 0x6c, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x65, 0x6c, 0x6c, 0x73, 0x12, 0x37, 0x0a, 0x0c, 0x74, 0x61, + 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0e, + 0x32, 0x14, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x54, 0x79, + 0x70, 0x65, 0x73, 0x12, 0x6c, 0x0a, 0x1b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x73, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, + 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x65, 0x66, + 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x19, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x53, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, + 0x65, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x64, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, + 0x67, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x49, + 0x0a, 0x0d, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x62, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, + 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0c, 0x77, 0x6f, 0x72, + 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x79, 0x70, 0x65, 0x12, 0x53, 0x0a, 0x11, 0x77, 0x6f, 0x72, + 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x73, 0x75, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x62, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x53, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0f, 0x77, + 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x53, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x30, + 0x0a, 0x14, 0x64, 0x65, 0x66, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x61, 0x72, + 0x79, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x64, 0x65, + 0x66, 0x65, 0x72, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x73, + 0x12, 0x54, 0x0a, 0x07, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x3a, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x22, 0x2f, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x65, 0x74, 0x53, 0x65, 0x71, 0x75, 0x65, - 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, - 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x62, - 0x6c, 0x65, 0x73, 0x22, 0x18, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x65, 0x74, 0x53, 0x65, 0x71, 0x75, - 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x0a, - 0x15, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, - 0x65, 0x22, 0xc8, 0x01, 0x0a, 0x16, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x68, 0x72, 0x6f, 0x74, - 0x74, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, - 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x5f, 0x63, 0x68, - 0x65, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x72, 0x65, 0x63, - 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x2a, 0x3e, 0x0a, 0x19, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, - 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x59, - 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x10, 0x01, 0x12, - 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x03, 0x42, 0x30, 0x5a, 0x2e, - 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, 0x74, 0x61, 0x62, - 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x07, 0x73, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x1a, 0xc1, 0x04, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x2a, 0x0a, 0x03, 0x62, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x62, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x42, 0x69, 0x6e, 0x6c, + 0x6f, 0x67, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x03, 0x62, 0x6c, 0x73, 0x12, 0x10, 0x0a, + 0x03, 0x70, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x12, + 0x19, 0x0a, 0x08, 0x73, 0x74, 0x6f, 0x70, 0x5f, 0x70, 0x6f, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x73, 0x74, 0x6f, 0x70, 0x50, 0x6f, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, + 0x78, 0x5f, 0x74, 0x70, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6d, 0x61, 0x78, + 0x54, 0x70, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x61, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x11, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4c, 0x61, 0x67, 0x12, 0x2f, 0x0a, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x76, 0x74, 0x74, 0x69, + 0x6d, 0x65, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x64, 0x12, 0x41, 0x0a, 0x15, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x76, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x52, 0x14, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3b, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x62, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, + 0x0a, 0x0b, 0x72, 0x6f, 0x77, 0x73, 0x5f, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x64, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x6f, 0x77, 0x73, 0x43, 0x6f, 0x70, 0x69, 0x65, 0x64, 0x12, + 0x33, 0x0a, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, + 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x76, 0x74, 0x74, 0x69, 0x6d, 0x65, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x48, 0x65, 0x61, 0x72, 0x74, + 0x62, 0x65, 0x61, 0x74, 0x12, 0x33, 0x0a, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x68, 0x72, + 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x76, + 0x74, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, + 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x12, 0x2f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, + 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x64, + 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, + 0x74, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x22, 0xd7, 0x01, 0x0a, 0x0c, 0x56, + 0x44, 0x69, 0x66, 0x66, 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, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x72, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x72, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x64, + 0x69, 0x66, 0x66, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x76, 0x64, 0x69, 0x66, 0x66, 0x55, 0x75, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x07, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, + 0x44, 0x69, 0x66, 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x6a, 0x0a, 0x0d, 0x56, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2a, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, + 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x64, 0x69, 0x66, 0x66, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x64, 0x69, 0x66, 0x66, 0x55, 0x75, 0x69, 0x64, + 0x22, 0x79, 0x0a, 0x12, 0x56, 0x44, 0x69, 0x66, 0x66, 0x50, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x74, 0x61, + 0x62, 0x6c, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x5f, 0x63, 0x65, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x65, 0x6c, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x5f, 0x63, 0x65, 0x6c, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x43, 0x65, 0x6c, 0x6c, 0x22, 0x90, 0x01, 0x0a, 0x12, + 0x56, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x6e, 0x6c, 0x79, 0x5f, 0x70, 0x6b, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6f, 0x6e, 0x6c, 0x79, 0x50, 0x6b, 0x73, 0x12, 0x1f, 0x0a, + 0x0b, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x62, 0x75, 0x67, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x16, + 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0d, 0x6d, 0x61, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x6f, 0x77, 0x73, 0x22, 0xda, + 0x02, 0x0a, 0x10, 0x56, 0x44, 0x69, 0x66, 0x66, 0x43, 0x6f, 0x72, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x61, + 0x75, 0x74, 0x6f, 0x5f, 0x72, 0x65, 0x74, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x09, 0x61, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x74, 0x72, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, + 0x78, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, + 0x78, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, + 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, + 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x70, 0x63, 0x74, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x50, 0x63, 0x74, + 0x12, 0x27, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x6f, + 0x6e, 0x64, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x6f, + 0x75, 0x74, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x38, 0x0a, 0x19, 0x6d, 0x61, 0x78, + 0x5f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x15, 0x6d, 0x61, + 0x78, 0x45, 0x78, 0x74, 0x72, 0x61, 0x52, 0x6f, 0x77, 0x73, 0x54, 0x6f, 0x43, 0x6f, 0x6d, 0x70, + 0x61, 0x72, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x61, + 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x73, 0x12, 0x28, 0x0a, 0x10, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x5f, 0x73, 0x65, + 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x6d, 0x61, 0x78, + 0x44, 0x69, 0x66, 0x66, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x22, 0xf2, 0x01, 0x0a, 0x0c, + 0x56, 0x44, 0x69, 0x66, 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4c, 0x0a, 0x0e, + 0x70, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, 0x44, 0x69, 0x66, 0x66, 0x50, 0x69, + 0x63, 0x6b, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0d, 0x70, 0x69, 0x63, + 0x6b, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x46, 0x0a, 0x0c, 0x63, 0x6f, + 0x72, 0x65, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x23, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, 0x44, 0x69, 0x66, 0x66, 0x43, 0x6f, 0x72, 0x65, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0b, 0x63, 0x6f, 0x72, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x4c, 0x0a, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, + 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x22, 0x81, 0x03, 0x0a, 0x21, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x52, 0x65, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, + 0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, + 0x6f, 0x77, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x65, 0x6c, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x05, 0x63, 0x65, 0x6c, 0x6c, 0x73, 0x12, 0x37, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x14, + 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x73, 0x12, 0x6c, 0x0a, 0x1b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x73, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, + 0x65, 0x6e, 0x63, 0x65, 0x52, 0x19, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x53, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, + 0x2e, 0x0a, 0x06, 0x6f, 0x6e, 0x5f, 0x64, 0x64, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x17, 0x2e, 0x62, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4f, 0x6e, 0x44, + 0x44, 0x4c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x6f, 0x6e, 0x44, 0x64, 0x6c, 0x12, + 0x3b, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, + 0x2e, 0x62, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, 0x52, 0x65, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x68, 0x61, 0x72, 0x64, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x73, 0x68, + 0x61, 0x72, 0x64, 0x73, 0x22, 0x50, 0x0a, 0x22, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x52, + 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, + 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x9f, 0x02, 0x0a, 0x22, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, + 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, + 0x0d, 0x61, 0x6c, 0x6c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x61, 0x6c, 0x6c, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, + 0x77, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x77, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x69, + 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x12, + 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x66, + 0x6c, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, + 0x75, 0x64, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x12, 0x3b, 0x0a, 0x05, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x62, 0x69, + 0x6e, 0x6c, 0x6f, 0x67, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x6f, 0x70, 0x5f, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x70, + 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x51, 0x0a, 0x23, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x12, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x2f, 0x0a, 0x15, 0x52, + 0x65, 0x73, 0x65, 0x74, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x22, 0x18, 0x0a, 0x16, + 0x52, 0x65, 0x73, 0x65, 0x74, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x0a, 0x15, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, + 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xc8, 0x01, 0x0a, 0x16, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, + 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, + 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, + 0x63, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x72, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x65, 0x64, 0x2a, 0x3e, 0x0a, 0x19, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x53, + 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, + 0x63, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x59, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x49, + 0x4e, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, + 0x4f, 0x57, 0x4e, 0x10, 0x03, 0x42, 0x30, 0x5a, 0x2e, 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, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -6963,7 +7374,7 @@ func file_tabletmanagerdata_proto_rawDescGZIP() []byte { } var file_tabletmanagerdata_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_tabletmanagerdata_proto_msgTypes = make([]protoimpl.MessageInfo, 118) +var file_tabletmanagerdata_proto_msgTypes = make([]protoimpl.MessageInfo, 124) var file_tabletmanagerdata_proto_goTypes = []interface{}{ (TabletSelectionPreference)(0), // 0: tabletmanagerdata.TabletSelectionPreference (*TableDefinition)(nil), // 1: tabletmanagerdata.TableDefinition @@ -7066,113 +7477,124 @@ var file_tabletmanagerdata_proto_goTypes = []interface{}{ (*CreateVReplicationWorkflowResponse)(nil), // 98: tabletmanagerdata.CreateVReplicationWorkflowResponse (*DeleteVReplicationWorkflowRequest)(nil), // 99: tabletmanagerdata.DeleteVReplicationWorkflowRequest (*DeleteVReplicationWorkflowResponse)(nil), // 100: tabletmanagerdata.DeleteVReplicationWorkflowResponse - (*ReadVReplicationWorkflowRequest)(nil), // 101: tabletmanagerdata.ReadVReplicationWorkflowRequest - (*ReadVReplicationWorkflowResponse)(nil), // 102: tabletmanagerdata.ReadVReplicationWorkflowResponse - (*VDiffRequest)(nil), // 103: tabletmanagerdata.VDiffRequest - (*VDiffResponse)(nil), // 104: tabletmanagerdata.VDiffResponse - (*VDiffPickerOptions)(nil), // 105: tabletmanagerdata.VDiffPickerOptions - (*VDiffReportOptions)(nil), // 106: tabletmanagerdata.VDiffReportOptions - (*VDiffCoreOptions)(nil), // 107: tabletmanagerdata.VDiffCoreOptions - (*VDiffOptions)(nil), // 108: tabletmanagerdata.VDiffOptions - (*UpdateVReplicationWorkflowRequest)(nil), // 109: tabletmanagerdata.UpdateVReplicationWorkflowRequest - (*UpdateVReplicationWorkflowResponse)(nil), // 110: tabletmanagerdata.UpdateVReplicationWorkflowResponse - (*ResetSequencesRequest)(nil), // 111: tabletmanagerdata.ResetSequencesRequest - (*ResetSequencesResponse)(nil), // 112: tabletmanagerdata.ResetSequencesResponse - (*CheckThrottlerRequest)(nil), // 113: tabletmanagerdata.CheckThrottlerRequest - (*CheckThrottlerResponse)(nil), // 114: tabletmanagerdata.CheckThrottlerResponse - nil, // 115: tabletmanagerdata.UserPermission.PrivilegesEntry - nil, // 116: tabletmanagerdata.DbPermission.PrivilegesEntry - nil, // 117: tabletmanagerdata.ExecuteHookRequest.ExtraEnvEntry - (*ReadVReplicationWorkflowResponse_Stream)(nil), // 118: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - (*query.Field)(nil), // 119: query.Field - (topodata.TabletType)(0), // 120: topodata.TabletType - (*vtrpc.CallerID)(nil), // 121: vtrpc.CallerID - (*query.QueryResult)(nil), // 122: query.QueryResult - (*replicationdata.Status)(nil), // 123: replicationdata.Status - (*replicationdata.PrimaryStatus)(nil), // 124: replicationdata.PrimaryStatus - (*topodata.TabletAlias)(nil), // 125: topodata.TabletAlias - (*replicationdata.FullStatus)(nil), // 126: replicationdata.FullStatus - (replicationdata.StopReplicationMode)(0), // 127: replicationdata.StopReplicationMode - (*replicationdata.StopReplicationStatus)(nil), // 128: replicationdata.StopReplicationStatus - (*logutil.Event)(nil), // 129: logutil.Event - (*vttime.Time)(nil), // 130: vttime.Time - (*binlogdata.BinlogSource)(nil), // 131: binlogdata.BinlogSource - (binlogdata.VReplicationWorkflowType)(0), // 132: binlogdata.VReplicationWorkflowType - (binlogdata.VReplicationWorkflowSubType)(0), // 133: binlogdata.VReplicationWorkflowSubType - (binlogdata.OnDDLAction)(0), // 134: binlogdata.OnDDLAction - (binlogdata.VReplicationWorkflowState)(0), // 135: binlogdata.VReplicationWorkflowState + (*HasVReplicationWorkflowsRequest)(nil), // 101: tabletmanagerdata.HasVReplicationWorkflowsRequest + (*HasVReplicationWorkflowsResponse)(nil), // 102: tabletmanagerdata.HasVReplicationWorkflowsResponse + (*ReadVReplicationWorkflowsRequest)(nil), // 103: tabletmanagerdata.ReadVReplicationWorkflowsRequest + (*ReadVReplicationWorkflowsResponse)(nil), // 104: tabletmanagerdata.ReadVReplicationWorkflowsResponse + (*ReadVReplicationWorkflowRequest)(nil), // 105: tabletmanagerdata.ReadVReplicationWorkflowRequest + (*ReadVReplicationWorkflowResponse)(nil), // 106: tabletmanagerdata.ReadVReplicationWorkflowResponse + (*VDiffRequest)(nil), // 107: tabletmanagerdata.VDiffRequest + (*VDiffResponse)(nil), // 108: tabletmanagerdata.VDiffResponse + (*VDiffPickerOptions)(nil), // 109: tabletmanagerdata.VDiffPickerOptions + (*VDiffReportOptions)(nil), // 110: tabletmanagerdata.VDiffReportOptions + (*VDiffCoreOptions)(nil), // 111: tabletmanagerdata.VDiffCoreOptions + (*VDiffOptions)(nil), // 112: tabletmanagerdata.VDiffOptions + (*UpdateVReplicationWorkflowRequest)(nil), // 113: tabletmanagerdata.UpdateVReplicationWorkflowRequest + (*UpdateVReplicationWorkflowResponse)(nil), // 114: tabletmanagerdata.UpdateVReplicationWorkflowResponse + (*UpdateVReplicationWorkflowsRequest)(nil), // 115: tabletmanagerdata.UpdateVReplicationWorkflowsRequest + (*UpdateVReplicationWorkflowsResponse)(nil), // 116: tabletmanagerdata.UpdateVReplicationWorkflowsResponse + (*ResetSequencesRequest)(nil), // 117: tabletmanagerdata.ResetSequencesRequest + (*ResetSequencesResponse)(nil), // 118: tabletmanagerdata.ResetSequencesResponse + (*CheckThrottlerRequest)(nil), // 119: tabletmanagerdata.CheckThrottlerRequest + (*CheckThrottlerResponse)(nil), // 120: tabletmanagerdata.CheckThrottlerResponse + nil, // 121: tabletmanagerdata.UserPermission.PrivilegesEntry + nil, // 122: tabletmanagerdata.DbPermission.PrivilegesEntry + nil, // 123: tabletmanagerdata.ExecuteHookRequest.ExtraEnvEntry + (*ReadVReplicationWorkflowResponse_Stream)(nil), // 124: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + (*query.Field)(nil), // 125: query.Field + (topodata.TabletType)(0), // 126: topodata.TabletType + (*vtrpc.CallerID)(nil), // 127: vtrpc.CallerID + (*query.QueryResult)(nil), // 128: query.QueryResult + (*replicationdata.Status)(nil), // 129: replicationdata.Status + (*replicationdata.PrimaryStatus)(nil), // 130: replicationdata.PrimaryStatus + (*topodata.TabletAlias)(nil), // 131: topodata.TabletAlias + (*replicationdata.FullStatus)(nil), // 132: replicationdata.FullStatus + (replicationdata.StopReplicationMode)(0), // 133: replicationdata.StopReplicationMode + (*replicationdata.StopReplicationStatus)(nil), // 134: replicationdata.StopReplicationStatus + (*logutil.Event)(nil), // 135: logutil.Event + (*vttime.Time)(nil), // 136: vttime.Time + (*binlogdata.BinlogSource)(nil), // 137: binlogdata.BinlogSource + (binlogdata.VReplicationWorkflowType)(0), // 138: binlogdata.VReplicationWorkflowType + (binlogdata.VReplicationWorkflowSubType)(0), // 139: binlogdata.VReplicationWorkflowSubType + (binlogdata.VReplicationWorkflowState)(0), // 140: binlogdata.VReplicationWorkflowState + (binlogdata.OnDDLAction)(0), // 141: binlogdata.OnDDLAction } var file_tabletmanagerdata_proto_depIdxs = []int32{ - 119, // 0: tabletmanagerdata.TableDefinition.fields:type_name -> query.Field + 125, // 0: tabletmanagerdata.TableDefinition.fields:type_name -> query.Field 1, // 1: tabletmanagerdata.SchemaDefinition.table_definitions:type_name -> tabletmanagerdata.TableDefinition 2, // 2: tabletmanagerdata.SchemaChangeResult.before_schema:type_name -> tabletmanagerdata.SchemaDefinition 2, // 3: tabletmanagerdata.SchemaChangeResult.after_schema:type_name -> tabletmanagerdata.SchemaDefinition - 115, // 4: tabletmanagerdata.UserPermission.privileges:type_name -> tabletmanagerdata.UserPermission.PrivilegesEntry - 116, // 5: tabletmanagerdata.DbPermission.privileges:type_name -> tabletmanagerdata.DbPermission.PrivilegesEntry + 121, // 4: tabletmanagerdata.UserPermission.privileges:type_name -> tabletmanagerdata.UserPermission.PrivilegesEntry + 122, // 5: tabletmanagerdata.DbPermission.privileges:type_name -> tabletmanagerdata.DbPermission.PrivilegesEntry 4, // 6: tabletmanagerdata.Permissions.user_permissions:type_name -> tabletmanagerdata.UserPermission 5, // 7: tabletmanagerdata.Permissions.db_permissions:type_name -> tabletmanagerdata.DbPermission - 117, // 8: tabletmanagerdata.ExecuteHookRequest.extra_env:type_name -> tabletmanagerdata.ExecuteHookRequest.ExtraEnvEntry + 123, // 8: tabletmanagerdata.ExecuteHookRequest.extra_env:type_name -> tabletmanagerdata.ExecuteHookRequest.ExtraEnvEntry 2, // 9: tabletmanagerdata.GetSchemaResponse.schema_definition:type_name -> tabletmanagerdata.SchemaDefinition 6, // 10: tabletmanagerdata.GetPermissionsResponse.permissions:type_name -> tabletmanagerdata.Permissions - 120, // 11: tabletmanagerdata.ChangeTypeRequest.tablet_type:type_name -> topodata.TabletType + 126, // 11: tabletmanagerdata.ChangeTypeRequest.tablet_type:type_name -> topodata.TabletType 3, // 12: tabletmanagerdata.PreflightSchemaResponse.change_results:type_name -> tabletmanagerdata.SchemaChangeResult 2, // 13: tabletmanagerdata.ApplySchemaRequest.before_schema:type_name -> tabletmanagerdata.SchemaDefinition 2, // 14: tabletmanagerdata.ApplySchemaRequest.after_schema:type_name -> tabletmanagerdata.SchemaDefinition 2, // 15: tabletmanagerdata.ApplySchemaResponse.before_schema:type_name -> tabletmanagerdata.SchemaDefinition 2, // 16: tabletmanagerdata.ApplySchemaResponse.after_schema:type_name -> tabletmanagerdata.SchemaDefinition - 121, // 17: tabletmanagerdata.ExecuteQueryRequest.caller_id:type_name -> vtrpc.CallerID - 122, // 18: tabletmanagerdata.ExecuteQueryResponse.result:type_name -> query.QueryResult - 122, // 19: tabletmanagerdata.ExecuteFetchAsDbaResponse.result:type_name -> query.QueryResult - 122, // 20: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse.result:type_name -> query.QueryResult - 122, // 21: tabletmanagerdata.ExecuteFetchAsAppResponse.result:type_name -> query.QueryResult - 123, // 22: tabletmanagerdata.ReplicationStatusResponse.status:type_name -> replicationdata.Status - 124, // 23: tabletmanagerdata.PrimaryStatusResponse.status:type_name -> replicationdata.PrimaryStatus - 122, // 24: tabletmanagerdata.VReplicationExecResponse.result:type_name -> query.QueryResult - 125, // 25: tabletmanagerdata.PopulateReparentJournalRequest.primary_alias:type_name -> topodata.TabletAlias - 125, // 26: tabletmanagerdata.InitReplicaRequest.parent:type_name -> topodata.TabletAlias - 124, // 27: tabletmanagerdata.DemotePrimaryResponse.primary_status:type_name -> replicationdata.PrimaryStatus - 126, // 28: tabletmanagerdata.FullStatusResponse.status:type_name -> replicationdata.FullStatus - 125, // 29: tabletmanagerdata.SetReplicationSourceRequest.parent:type_name -> topodata.TabletAlias - 125, // 30: tabletmanagerdata.ReplicaWasRestartedRequest.parent:type_name -> topodata.TabletAlias - 127, // 31: tabletmanagerdata.StopReplicationAndGetStatusRequest.stop_replication_mode:type_name -> replicationdata.StopReplicationMode - 128, // 32: tabletmanagerdata.StopReplicationAndGetStatusResponse.status:type_name -> replicationdata.StopReplicationStatus - 129, // 33: tabletmanagerdata.BackupResponse.event:type_name -> logutil.Event - 130, // 34: tabletmanagerdata.RestoreFromBackupRequest.backup_time:type_name -> vttime.Time - 130, // 35: tabletmanagerdata.RestoreFromBackupRequest.restore_to_timestamp:type_name -> vttime.Time - 129, // 36: tabletmanagerdata.RestoreFromBackupResponse.event:type_name -> logutil.Event - 131, // 37: tabletmanagerdata.CreateVReplicationWorkflowRequest.binlog_source:type_name -> binlogdata.BinlogSource - 120, // 38: tabletmanagerdata.CreateVReplicationWorkflowRequest.tablet_types:type_name -> topodata.TabletType + 127, // 17: tabletmanagerdata.ExecuteQueryRequest.caller_id:type_name -> vtrpc.CallerID + 128, // 18: tabletmanagerdata.ExecuteQueryResponse.result:type_name -> query.QueryResult + 128, // 19: tabletmanagerdata.ExecuteFetchAsDbaResponse.result:type_name -> query.QueryResult + 128, // 20: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse.result:type_name -> query.QueryResult + 128, // 21: tabletmanagerdata.ExecuteFetchAsAppResponse.result:type_name -> query.QueryResult + 129, // 22: tabletmanagerdata.ReplicationStatusResponse.status:type_name -> replicationdata.Status + 130, // 23: tabletmanagerdata.PrimaryStatusResponse.status:type_name -> replicationdata.PrimaryStatus + 128, // 24: tabletmanagerdata.VReplicationExecResponse.result:type_name -> query.QueryResult + 131, // 25: tabletmanagerdata.PopulateReparentJournalRequest.primary_alias:type_name -> topodata.TabletAlias + 131, // 26: tabletmanagerdata.InitReplicaRequest.parent:type_name -> topodata.TabletAlias + 130, // 27: tabletmanagerdata.DemotePrimaryResponse.primary_status:type_name -> replicationdata.PrimaryStatus + 132, // 28: tabletmanagerdata.FullStatusResponse.status:type_name -> replicationdata.FullStatus + 131, // 29: tabletmanagerdata.SetReplicationSourceRequest.parent:type_name -> topodata.TabletAlias + 131, // 30: tabletmanagerdata.ReplicaWasRestartedRequest.parent:type_name -> topodata.TabletAlias + 133, // 31: tabletmanagerdata.StopReplicationAndGetStatusRequest.stop_replication_mode:type_name -> replicationdata.StopReplicationMode + 134, // 32: tabletmanagerdata.StopReplicationAndGetStatusResponse.status:type_name -> replicationdata.StopReplicationStatus + 135, // 33: tabletmanagerdata.BackupResponse.event:type_name -> logutil.Event + 136, // 34: tabletmanagerdata.RestoreFromBackupRequest.backup_time:type_name -> vttime.Time + 136, // 35: tabletmanagerdata.RestoreFromBackupRequest.restore_to_timestamp:type_name -> vttime.Time + 135, // 36: tabletmanagerdata.RestoreFromBackupResponse.event:type_name -> logutil.Event + 137, // 37: tabletmanagerdata.CreateVReplicationWorkflowRequest.binlog_source:type_name -> binlogdata.BinlogSource + 126, // 38: tabletmanagerdata.CreateVReplicationWorkflowRequest.tablet_types:type_name -> topodata.TabletType 0, // 39: tabletmanagerdata.CreateVReplicationWorkflowRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 132, // 40: tabletmanagerdata.CreateVReplicationWorkflowRequest.workflow_type:type_name -> binlogdata.VReplicationWorkflowType - 133, // 41: tabletmanagerdata.CreateVReplicationWorkflowRequest.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType - 122, // 42: tabletmanagerdata.CreateVReplicationWorkflowResponse.result:type_name -> query.QueryResult - 122, // 43: tabletmanagerdata.DeleteVReplicationWorkflowResponse.result:type_name -> query.QueryResult - 120, // 44: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_types:type_name -> topodata.TabletType - 0, // 45: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 132, // 46: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_type:type_name -> binlogdata.VReplicationWorkflowType - 133, // 47: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType - 118, // 48: tabletmanagerdata.ReadVReplicationWorkflowResponse.streams:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - 108, // 49: tabletmanagerdata.VDiffRequest.options:type_name -> tabletmanagerdata.VDiffOptions - 122, // 50: tabletmanagerdata.VDiffResponse.output:type_name -> query.QueryResult - 105, // 51: tabletmanagerdata.VDiffOptions.picker_options:type_name -> tabletmanagerdata.VDiffPickerOptions - 107, // 52: tabletmanagerdata.VDiffOptions.core_options:type_name -> tabletmanagerdata.VDiffCoreOptions - 106, // 53: tabletmanagerdata.VDiffOptions.report_options:type_name -> tabletmanagerdata.VDiffReportOptions - 120, // 54: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_types:type_name -> topodata.TabletType - 0, // 55: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 134, // 56: tabletmanagerdata.UpdateVReplicationWorkflowRequest.on_ddl:type_name -> binlogdata.OnDDLAction - 135, // 57: tabletmanagerdata.UpdateVReplicationWorkflowRequest.state:type_name -> binlogdata.VReplicationWorkflowState - 122, // 58: tabletmanagerdata.UpdateVReplicationWorkflowResponse.result:type_name -> query.QueryResult - 131, // 59: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.bls:type_name -> binlogdata.BinlogSource - 130, // 60: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_updated:type_name -> vttime.Time - 130, // 61: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.transaction_timestamp:type_name -> vttime.Time - 135, // 62: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.state:type_name -> binlogdata.VReplicationWorkflowState - 130, // 63: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_heartbeat:type_name -> vttime.Time - 130, // 64: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_throttled:type_name -> vttime.Time - 65, // [65:65] is the sub-list for method output_type - 65, // [65:65] is the sub-list for method input_type - 65, // [65:65] is the sub-list for extension type_name - 65, // [65:65] is the sub-list for extension extendee - 0, // [0:65] is the sub-list for field type_name + 138, // 40: tabletmanagerdata.CreateVReplicationWorkflowRequest.workflow_type:type_name -> binlogdata.VReplicationWorkflowType + 139, // 41: tabletmanagerdata.CreateVReplicationWorkflowRequest.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType + 128, // 42: tabletmanagerdata.CreateVReplicationWorkflowResponse.result:type_name -> query.QueryResult + 128, // 43: tabletmanagerdata.DeleteVReplicationWorkflowResponse.result:type_name -> query.QueryResult + 140, // 44: tabletmanagerdata.ReadVReplicationWorkflowsRequest.include_states:type_name -> binlogdata.VReplicationWorkflowState + 140, // 45: tabletmanagerdata.ReadVReplicationWorkflowsRequest.exclude_states:type_name -> binlogdata.VReplicationWorkflowState + 106, // 46: tabletmanagerdata.ReadVReplicationWorkflowsResponse.workflows:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse + 126, // 47: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_types:type_name -> topodata.TabletType + 0, // 48: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference + 138, // 49: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_type:type_name -> binlogdata.VReplicationWorkflowType + 139, // 50: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType + 124, // 51: tabletmanagerdata.ReadVReplicationWorkflowResponse.streams:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + 112, // 52: tabletmanagerdata.VDiffRequest.options:type_name -> tabletmanagerdata.VDiffOptions + 128, // 53: tabletmanagerdata.VDiffResponse.output:type_name -> query.QueryResult + 109, // 54: tabletmanagerdata.VDiffOptions.picker_options:type_name -> tabletmanagerdata.VDiffPickerOptions + 111, // 55: tabletmanagerdata.VDiffOptions.core_options:type_name -> tabletmanagerdata.VDiffCoreOptions + 110, // 56: tabletmanagerdata.VDiffOptions.report_options:type_name -> tabletmanagerdata.VDiffReportOptions + 126, // 57: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_types:type_name -> topodata.TabletType + 0, // 58: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference + 141, // 59: tabletmanagerdata.UpdateVReplicationWorkflowRequest.on_ddl:type_name -> binlogdata.OnDDLAction + 140, // 60: tabletmanagerdata.UpdateVReplicationWorkflowRequest.state:type_name -> binlogdata.VReplicationWorkflowState + 128, // 61: tabletmanagerdata.UpdateVReplicationWorkflowResponse.result:type_name -> query.QueryResult + 140, // 62: tabletmanagerdata.UpdateVReplicationWorkflowsRequest.state:type_name -> binlogdata.VReplicationWorkflowState + 128, // 63: tabletmanagerdata.UpdateVReplicationWorkflowsResponse.result:type_name -> query.QueryResult + 137, // 64: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.bls:type_name -> binlogdata.BinlogSource + 136, // 65: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_updated:type_name -> vttime.Time + 136, // 66: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.transaction_timestamp:type_name -> vttime.Time + 140, // 67: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.state:type_name -> binlogdata.VReplicationWorkflowState + 136, // 68: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_heartbeat:type_name -> vttime.Time + 136, // 69: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_throttled:type_name -> vttime.Time + 70, // [70:70] is the sub-list for method output_type + 70, // [70:70] is the sub-list for method input_type + 70, // [70:70] is the sub-list for extension type_name + 70, // [70:70] is the sub-list for extension extendee + 0, // [0:70] is the sub-list for field type_name } func init() { file_tabletmanagerdata_proto_init() } @@ -8382,7 +8804,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[100].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReadVReplicationWorkflowRequest); i { + switch v := v.(*HasVReplicationWorkflowsRequest); i { case 0: return &v.state case 1: @@ -8394,7 +8816,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[101].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReadVReplicationWorkflowResponse); i { + switch v := v.(*HasVReplicationWorkflowsResponse); i { case 0: return &v.state case 1: @@ -8406,7 +8828,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[102].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VDiffRequest); i { + switch v := v.(*ReadVReplicationWorkflowsRequest); i { case 0: return &v.state case 1: @@ -8418,7 +8840,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[103].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VDiffResponse); i { + switch v := v.(*ReadVReplicationWorkflowsResponse); i { case 0: return &v.state case 1: @@ -8430,7 +8852,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[104].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VDiffPickerOptions); i { + switch v := v.(*ReadVReplicationWorkflowRequest); i { case 0: return &v.state case 1: @@ -8442,7 +8864,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[105].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VDiffReportOptions); i { + switch v := v.(*ReadVReplicationWorkflowResponse); i { case 0: return &v.state case 1: @@ -8454,7 +8876,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[106].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VDiffCoreOptions); i { + switch v := v.(*VDiffRequest); i { case 0: return &v.state case 1: @@ -8466,7 +8888,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[107].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VDiffOptions); i { + switch v := v.(*VDiffResponse); i { case 0: return &v.state case 1: @@ -8478,7 +8900,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[108].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateVReplicationWorkflowRequest); i { + switch v := v.(*VDiffPickerOptions); i { case 0: return &v.state case 1: @@ -8490,7 +8912,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[109].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateVReplicationWorkflowResponse); i { + switch v := v.(*VDiffReportOptions); i { case 0: return &v.state case 1: @@ -8502,7 +8924,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[110].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResetSequencesRequest); i { + switch v := v.(*VDiffCoreOptions); i { case 0: return &v.state case 1: @@ -8514,7 +8936,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[111].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResetSequencesResponse); i { + switch v := v.(*VDiffOptions); i { case 0: return &v.state case 1: @@ -8526,7 +8948,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[112].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CheckThrottlerRequest); i { + switch v := v.(*UpdateVReplicationWorkflowRequest); i { case 0: return &v.state case 1: @@ -8538,7 +8960,43 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[113].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CheckThrottlerResponse); i { + switch v := v.(*UpdateVReplicationWorkflowResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tabletmanagerdata_proto_msgTypes[114].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateVReplicationWorkflowsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tabletmanagerdata_proto_msgTypes[115].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateVReplicationWorkflowsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tabletmanagerdata_proto_msgTypes[116].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResetSequencesRequest); i { case 0: return &v.state case 1: @@ -8550,6 +9008,42 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[117].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResetSequencesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tabletmanagerdata_proto_msgTypes[118].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CheckThrottlerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tabletmanagerdata_proto_msgTypes[119].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CheckThrottlerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tabletmanagerdata_proto_msgTypes[123].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReadVReplicationWorkflowResponse_Stream); i { case 0: return &v.state @@ -8568,7 +9062,7 @@ func file_tabletmanagerdata_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_tabletmanagerdata_proto_rawDesc, NumEnums: 1, - NumMessages: 118, + NumMessages: 124, NumExtensions: 0, NumServices: 0, }, diff --git a/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go b/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go index 4d5b4188e5e..2bc1b46df27 100644 --- a/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go +++ b/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go @@ -1923,6 +1923,106 @@ func (m *DeleteVReplicationWorkflowResponse) CloneMessageVT() proto.Message { return m.CloneVT() } +func (m *HasVReplicationWorkflowsRequest) CloneVT() *HasVReplicationWorkflowsRequest { + if m == nil { + return (*HasVReplicationWorkflowsRequest)(nil) + } + r := &HasVReplicationWorkflowsRequest{} + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *HasVReplicationWorkflowsRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *HasVReplicationWorkflowsResponse) CloneVT() *HasVReplicationWorkflowsResponse { + if m == nil { + return (*HasVReplicationWorkflowsResponse)(nil) + } + r := &HasVReplicationWorkflowsResponse{ + Has: m.Has, + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *HasVReplicationWorkflowsResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ReadVReplicationWorkflowsRequest) CloneVT() *ReadVReplicationWorkflowsRequest { + if m == nil { + return (*ReadVReplicationWorkflowsRequest)(nil) + } + r := &ReadVReplicationWorkflowsRequest{ + ExcludeFrozen: m.ExcludeFrozen, + } + if rhs := m.IncludeIds; rhs != nil { + tmpContainer := make([]int32, len(rhs)) + copy(tmpContainer, rhs) + r.IncludeIds = tmpContainer + } + if rhs := m.IncludeWorkflows; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.IncludeWorkflows = tmpContainer + } + if rhs := m.IncludeStates; rhs != nil { + tmpContainer := make([]binlogdata.VReplicationWorkflowState, len(rhs)) + copy(tmpContainer, rhs) + r.IncludeStates = tmpContainer + } + if rhs := m.ExcludeWorkflows; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.ExcludeWorkflows = tmpContainer + } + if rhs := m.ExcludeStates; rhs != nil { + tmpContainer := make([]binlogdata.VReplicationWorkflowState, len(rhs)) + copy(tmpContainer, rhs) + r.ExcludeStates = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ReadVReplicationWorkflowsRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ReadVReplicationWorkflowsResponse) CloneVT() *ReadVReplicationWorkflowsResponse { + if m == nil { + return (*ReadVReplicationWorkflowsResponse)(nil) + } + r := &ReadVReplicationWorkflowsResponse{} + if rhs := m.Workflows; rhs != nil { + tmpContainer := make([]*ReadVReplicationWorkflowResponse, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Workflows = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ReadVReplicationWorkflowsResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + func (m *ReadVReplicationWorkflowRequest) CloneVT() *ReadVReplicationWorkflowRequest { if m == nil { return (*ReadVReplicationWorkflowRequest)(nil) @@ -2193,6 +2293,55 @@ func (m *UpdateVReplicationWorkflowResponse) CloneMessageVT() proto.Message { return m.CloneVT() } +func (m *UpdateVReplicationWorkflowsRequest) CloneVT() *UpdateVReplicationWorkflowsRequest { + if m == nil { + return (*UpdateVReplicationWorkflowsRequest)(nil) + } + r := &UpdateVReplicationWorkflowsRequest{ + AllWorkflows: m.AllWorkflows, + State: m.State, + Message: m.Message, + StopPosition: m.StopPosition, + } + if rhs := m.IncludeWorkflows; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.IncludeWorkflows = tmpContainer + } + if rhs := m.ExcludeWorkflows; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.ExcludeWorkflows = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *UpdateVReplicationWorkflowsRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *UpdateVReplicationWorkflowsResponse) CloneVT() *UpdateVReplicationWorkflowsResponse { + if m == nil { + return (*UpdateVReplicationWorkflowsResponse)(nil) + } + r := &UpdateVReplicationWorkflowsResponse{ + Result: m.Result.CloneVT(), + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *UpdateVReplicationWorkflowsResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + func (m *ResetSequencesRequest) CloneVT() *ResetSequencesRequest { if m == nil { return (*ResetSequencesRequest)(nil) @@ -6700,7 +6849,7 @@ func (m *DeleteVReplicationWorkflowResponse) MarshalToSizedBufferVT(dAtA []byte) return len(dAtA) - i, nil } -func (m *ReadVReplicationWorkflowRequest) MarshalVT() (dAtA []byte, err error) { +func (m *HasVReplicationWorkflowsRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -6713,12 +6862,12 @@ func (m *ReadVReplicationWorkflowRequest) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ReadVReplicationWorkflowRequest) MarshalToVT(dAtA []byte) (int, error) { +func (m *HasVReplicationWorkflowsRequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ReadVReplicationWorkflowRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *HasVReplicationWorkflowsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -6730,17 +6879,10 @@ func (m *ReadVReplicationWorkflowRequest) MarshalToSizedBufferVT(dAtA []byte) (i i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - 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] = 0xa - } return len(dAtA) - i, nil } -func (m *ReadVReplicationWorkflowResponse_Stream) MarshalVT() (dAtA []byte, err error) { +func (m *HasVReplicationWorkflowsResponse) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -6753,12 +6895,12 @@ func (m *ReadVReplicationWorkflowResponse_Stream) MarshalVT() (dAtA []byte, err return dAtA[:n], nil } -func (m *ReadVReplicationWorkflowResponse_Stream) MarshalToVT(dAtA []byte) (int, error) { +func (m *HasVReplicationWorkflowsResponse) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ReadVReplicationWorkflowResponse_Stream) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *HasVReplicationWorkflowsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -6770,113 +6912,20 @@ func (m *ReadVReplicationWorkflowResponse_Stream) MarshalToSizedBufferVT(dAtA [] i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.ComponentThrottled) > 0 { - i -= len(m.ComponentThrottled) - copy(dAtA[i:], m.ComponentThrottled) - i = encodeVarint(dAtA, i, uint64(len(m.ComponentThrottled))) - i-- - dAtA[i] = 0x72 - } - if m.TimeThrottled != nil { - size, err := m.TimeThrottled.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x6a - } - if m.TimeHeartbeat != nil { - size, err := m.TimeHeartbeat.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x62 - } - if m.RowsCopied != 0 { - i = encodeVarint(dAtA, i, uint64(m.RowsCopied)) - i-- - dAtA[i] = 0x58 - } - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarint(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0x52 - } - if m.State != 0 { - i = encodeVarint(dAtA, i, uint64(m.State)) - i-- - dAtA[i] = 0x48 - } - if m.TransactionTimestamp != nil { - size, err := m.TransactionTimestamp.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x42 - } - if m.TimeUpdated != nil { - size, err := m.TimeUpdated.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x3a - } - if m.MaxReplicationLag != 0 { - i = encodeVarint(dAtA, i, uint64(m.MaxReplicationLag)) - i-- - dAtA[i] = 0x30 - } - if m.MaxTps != 0 { - i = encodeVarint(dAtA, i, uint64(m.MaxTps)) - i-- - dAtA[i] = 0x28 - } - if len(m.StopPos) > 0 { - i -= len(m.StopPos) - copy(dAtA[i:], m.StopPos) - i = encodeVarint(dAtA, i, uint64(len(m.StopPos))) - i-- - dAtA[i] = 0x22 - } - if len(m.Pos) > 0 { - i -= len(m.Pos) - copy(dAtA[i:], m.Pos) - i = encodeVarint(dAtA, i, uint64(len(m.Pos))) + if m.Has { i-- - dAtA[i] = 0x1a - } - if m.Bls != nil { - size, err := m.Bls.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err + if m.Has { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x12 - } - if m.Id != 0 { - i = encodeVarint(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *ReadVReplicationWorkflowResponse) MarshalVT() (dAtA []byte, err error) { +func (m *ReadVReplicationWorkflowsRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -6889,12 +6938,12 @@ func (m *ReadVReplicationWorkflowResponse) MarshalVT() (dAtA []byte, err error) return dAtA[:n], nil } -func (m *ReadVReplicationWorkflowResponse) MarshalToVT(dAtA []byte) (int, error) { +func (m *ReadVReplicationWorkflowsRequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ReadVReplicationWorkflowResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *ReadVReplicationWorkflowsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -6906,96 +6955,101 @@ func (m *ReadVReplicationWorkflowResponse) MarshalToSizedBufferVT(dAtA []byte) ( i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Streams) > 0 { - for iNdEx := len(m.Streams) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Streams[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x5a - } - } - if m.DeferSecondaryKeys { + if m.ExcludeFrozen { i-- - if m.DeferSecondaryKeys { + if m.ExcludeFrozen { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- - dAtA[i] = 0x50 - } - if m.WorkflowSubType != 0 { - i = encodeVarint(dAtA, i, uint64(m.WorkflowSubType)) - i-- - dAtA[i] = 0x48 + dAtA[i] = 0x30 } - if m.WorkflowType != 0 { - i = encodeVarint(dAtA, i, uint64(m.WorkflowType)) + if len(m.ExcludeStates) > 0 { + var pksize2 int + for _, num := range m.ExcludeStates { + pksize2 += sov(uint64(num)) + } + i -= pksize2 + j1 := i + for _, num1 := range m.ExcludeStates { + num := uint64(num1) + for num >= 1<<7 { + dAtA[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA[j1] = uint8(num) + j1++ + } + i = encodeVarint(dAtA, i, uint64(pksize2)) i-- - dAtA[i] = 0x40 + dAtA[i] = 0x2a } - if len(m.Tags) > 0 { - i -= len(m.Tags) - copy(dAtA[i:], m.Tags) - i = encodeVarint(dAtA, i, uint64(len(m.Tags))) - i-- - dAtA[i] = 0x3a - } - if len(m.DbName) > 0 { - i -= len(m.DbName) - copy(dAtA[i:], m.DbName) - i = encodeVarint(dAtA, i, uint64(len(m.DbName))) - i-- - dAtA[i] = 0x32 - } - if m.TabletSelectionPreference != 0 { - i = encodeVarint(dAtA, i, uint64(m.TabletSelectionPreference)) - i-- - dAtA[i] = 0x28 + if len(m.ExcludeWorkflows) > 0 { + for iNdEx := len(m.ExcludeWorkflows) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ExcludeWorkflows[iNdEx]) + copy(dAtA[i:], m.ExcludeWorkflows[iNdEx]) + i = encodeVarint(dAtA, i, uint64(len(m.ExcludeWorkflows[iNdEx]))) + i-- + dAtA[i] = 0x22 + } } - if len(m.TabletTypes) > 0 { - var pksize2 int - for _, num := range m.TabletTypes { - pksize2 += sov(uint64(num)) + if len(m.IncludeStates) > 0 { + var pksize4 int + for _, num := range m.IncludeStates { + pksize4 += sov(uint64(num)) } - i -= pksize2 - j1 := i - for _, num1 := range m.TabletTypes { + i -= pksize4 + j3 := i + for _, num1 := range m.IncludeStates { num := uint64(num1) for num >= 1<<7 { - dAtA[j1] = uint8(uint64(num)&0x7f | 0x80) + dAtA[j3] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j1++ + j3++ } - dAtA[j1] = uint8(num) - j1++ + dAtA[j3] = uint8(num) + j3++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) - i-- - dAtA[i] = 0x22 - } - if len(m.Cells) > 0 { - i -= len(m.Cells) - copy(dAtA[i:], m.Cells) - i = encodeVarint(dAtA, i, uint64(len(m.Cells))) + i = encodeVarint(dAtA, i, uint64(pksize4)) i-- dAtA[i] = 0x1a } - if len(m.Workflow) > 0 { - i -= len(m.Workflow) - copy(dAtA[i:], m.Workflow) - i = encodeVarint(dAtA, i, uint64(len(m.Workflow))) + if len(m.IncludeWorkflows) > 0 { + for iNdEx := len(m.IncludeWorkflows) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.IncludeWorkflows[iNdEx]) + copy(dAtA[i:], m.IncludeWorkflows[iNdEx]) + i = encodeVarint(dAtA, i, uint64(len(m.IncludeWorkflows[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.IncludeIds) > 0 { + var pksize6 int + for _, num := range m.IncludeIds { + pksize6 += sov(uint64(num)) + } + i -= pksize6 + j5 := i + for _, num1 := range m.IncludeIds { + num := uint64(num1) + for num >= 1<<7 { + dAtA[j5] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j5++ + } + dAtA[j5] = uint8(num) + j5++ + } + i = encodeVarint(dAtA, i, uint64(pksize6)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *VDiffRequest) MarshalVT() (dAtA []byte, err error) { +func (m *ReadVReplicationWorkflowsResponse) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -7008,12 +7062,12 @@ func (m *VDiffRequest) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *VDiffRequest) MarshalToVT(dAtA []byte) (int, error) { +func (m *ReadVReplicationWorkflowsResponse) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *VDiffRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *ReadVReplicationWorkflowsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -7025,55 +7079,62 @@ func (m *VDiffRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.Options != nil { - size, err := m.Options.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Workflows) > 0 { + for iNdEx := len(m.Workflows) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Workflows[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x32 } - if len(m.VdiffUuid) > 0 { - i -= len(m.VdiffUuid) - copy(dAtA[i:], m.VdiffUuid) - i = encodeVarint(dAtA, i, uint64(len(m.VdiffUuid))) - i-- - dAtA[i] = 0x2a + return len(dAtA) - i, nil +} + +func (m *ReadVReplicationWorkflowRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil } - if len(m.ActionArg) > 0 { - i -= len(m.ActionArg) - copy(dAtA[i:], m.ActionArg) - i = encodeVarint(dAtA, i, uint64(len(m.ActionArg))) - i-- - dAtA[i] = 0x22 + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err } - if len(m.Action) > 0 { - i -= len(m.Action) - copy(dAtA[i:], m.Action) - i = encodeVarint(dAtA, i, uint64(len(m.Action))) - i-- - dAtA[i] = 0x1a + return dAtA[:n], nil +} + +func (m *ReadVReplicationWorkflowRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ReadVReplicationWorkflowRequest) 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.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 *VDiffResponse) MarshalVT() (dAtA []byte, err error) { +func (m *ReadVReplicationWorkflowResponse_Stream) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -7086,12 +7147,12 @@ func (m *VDiffResponse) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *VDiffResponse) MarshalToVT(dAtA []byte) (int, error) { +func (m *ReadVReplicationWorkflowResponse_Stream) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *VDiffResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *ReadVReplicationWorkflowResponse_Stream) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -7103,15 +7164,96 @@ func (m *VDiffResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.VdiffUuid) > 0 { - i -= len(m.VdiffUuid) - copy(dAtA[i:], m.VdiffUuid) - i = encodeVarint(dAtA, i, uint64(len(m.VdiffUuid))) + if len(m.ComponentThrottled) > 0 { + i -= len(m.ComponentThrottled) + copy(dAtA[i:], m.ComponentThrottled) + i = encodeVarint(dAtA, i, uint64(len(m.ComponentThrottled))) + i-- + dAtA[i] = 0x72 + } + if m.TimeThrottled != nil { + size, err := m.TimeThrottled.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x6a + } + if m.TimeHeartbeat != nil { + size, err := m.TimeHeartbeat.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x62 + } + if m.RowsCopied != 0 { + i = encodeVarint(dAtA, i, uint64(m.RowsCopied)) + i-- + dAtA[i] = 0x58 + } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarint(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x52 + } + if m.State != 0 { + i = encodeVarint(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x48 + } + if m.TransactionTimestamp != nil { + size, err := m.TransactionTimestamp.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 + } + if m.TimeUpdated != nil { + size, err := m.TimeUpdated.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + if m.MaxReplicationLag != 0 { + i = encodeVarint(dAtA, i, uint64(m.MaxReplicationLag)) + i-- + dAtA[i] = 0x30 + } + if m.MaxTps != 0 { + i = encodeVarint(dAtA, i, uint64(m.MaxTps)) + i-- + dAtA[i] = 0x28 + } + if len(m.StopPos) > 0 { + i -= len(m.StopPos) + copy(dAtA[i:], m.StopPos) + i = encodeVarint(dAtA, i, uint64(len(m.StopPos))) + i-- + dAtA[i] = 0x22 + } + if len(m.Pos) > 0 { + i -= len(m.Pos) + copy(dAtA[i:], m.Pos) + i = encodeVarint(dAtA, i, uint64(len(m.Pos))) i-- dAtA[i] = 0x1a } - if m.Output != nil { - size, err := m.Output.MarshalToSizedBufferVT(dAtA[:i]) + if m.Bls != nil { + size, err := m.Bls.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -7128,7 +7270,7 @@ func (m *VDiffResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *VDiffPickerOptions) MarshalVT() (dAtA []byte, err error) { +func (m *ReadVReplicationWorkflowResponse) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -7141,12 +7283,12 @@ func (m *VDiffPickerOptions) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *VDiffPickerOptions) MarshalToVT(dAtA []byte) (int, error) { +func (m *ReadVReplicationWorkflowResponse) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *VDiffPickerOptions) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *ReadVReplicationWorkflowResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -7158,17 +7300,269 @@ func (m *VDiffPickerOptions) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.TargetCell) > 0 { - i -= len(m.TargetCell) - copy(dAtA[i:], m.TargetCell) - i = encodeVarint(dAtA, i, uint64(len(m.TargetCell))) - i-- - dAtA[i] = 0x1a + if len(m.Streams) > 0 { + for iNdEx := len(m.Streams) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Streams[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x5a + } } - if len(m.SourceCell) > 0 { - i -= len(m.SourceCell) - copy(dAtA[i:], m.SourceCell) - i = encodeVarint(dAtA, i, uint64(len(m.SourceCell))) + if m.DeferSecondaryKeys { + i-- + if m.DeferSecondaryKeys { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } + if m.WorkflowSubType != 0 { + i = encodeVarint(dAtA, i, uint64(m.WorkflowSubType)) + i-- + dAtA[i] = 0x48 + } + if m.WorkflowType != 0 { + i = encodeVarint(dAtA, i, uint64(m.WorkflowType)) + i-- + dAtA[i] = 0x40 + } + if len(m.Tags) > 0 { + i -= len(m.Tags) + copy(dAtA[i:], m.Tags) + i = encodeVarint(dAtA, i, uint64(len(m.Tags))) + i-- + dAtA[i] = 0x3a + } + if len(m.DbName) > 0 { + i -= len(m.DbName) + copy(dAtA[i:], m.DbName) + i = encodeVarint(dAtA, i, uint64(len(m.DbName))) + i-- + dAtA[i] = 0x32 + } + if m.TabletSelectionPreference != 0 { + i = encodeVarint(dAtA, i, uint64(m.TabletSelectionPreference)) + i-- + dAtA[i] = 0x28 + } + if len(m.TabletTypes) > 0 { + var pksize2 int + for _, num := range m.TabletTypes { + pksize2 += sov(uint64(num)) + } + i -= pksize2 + j1 := i + for _, num1 := range m.TabletTypes { + num := uint64(num1) + for num >= 1<<7 { + dAtA[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA[j1] = uint8(num) + j1++ + } + i = encodeVarint(dAtA, i, uint64(pksize2)) + i-- + dAtA[i] = 0x22 + } + if len(m.Cells) > 0 { + i -= len(m.Cells) + copy(dAtA[i:], m.Cells) + i = encodeVarint(dAtA, i, uint64(len(m.Cells))) + i-- + dAtA[i] = 0x1a + } + 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 + } + return len(dAtA) - i, nil +} + +func (m *VDiffRequest) 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 *VDiffRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *VDiffRequest) 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.Options != nil { + size, err := m.Options.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + if len(m.VdiffUuid) > 0 { + i -= len(m.VdiffUuid) + copy(dAtA[i:], m.VdiffUuid) + i = encodeVarint(dAtA, i, uint64(len(m.VdiffUuid))) + i-- + dAtA[i] = 0x2a + } + if len(m.ActionArg) > 0 { + i -= len(m.ActionArg) + copy(dAtA[i:], m.ActionArg) + i = encodeVarint(dAtA, i, uint64(len(m.ActionArg))) + i-- + dAtA[i] = 0x22 + } + if len(m.Action) > 0 { + i -= len(m.Action) + copy(dAtA[i:], m.Action) + i = encodeVarint(dAtA, i, uint64(len(m.Action))) + i-- + dAtA[i] = 0x1a + } + 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 *VDiffResponse) 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 *VDiffResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *VDiffResponse) 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.VdiffUuid) > 0 { + i -= len(m.VdiffUuid) + copy(dAtA[i:], m.VdiffUuid) + i = encodeVarint(dAtA, i, uint64(len(m.VdiffUuid))) + i-- + dAtA[i] = 0x1a + } + if m.Output != nil { + size, err := m.Output.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarint(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *VDiffPickerOptions) 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 *VDiffPickerOptions) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *VDiffPickerOptions) 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.TargetCell) > 0 { + i -= len(m.TargetCell) + copy(dAtA[i:], m.TargetCell) + i = encodeVarint(dAtA, i, uint64(len(m.TargetCell))) + i-- + dAtA[i] = 0x1a + } + if len(m.SourceCell) > 0 { + i -= len(m.SourceCell) + copy(dAtA[i:], m.SourceCell) + i = encodeVarint(dAtA, i, uint64(len(m.SourceCell))) i-- dAtA[i] = 0x12 } @@ -7542,7 +7936,7 @@ func (m *UpdateVReplicationWorkflowResponse) MarshalToSizedBufferVT(dAtA []byte) return len(dAtA) - i, nil } -func (m *ResetSequencesRequest) MarshalVT() (dAtA []byte, err error) { +func (m *UpdateVReplicationWorkflowsRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -7555,12 +7949,12 @@ func (m *ResetSequencesRequest) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResetSequencesRequest) MarshalToVT(dAtA []byte) (int, error) { +func (m *UpdateVReplicationWorkflowsRequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ResetSequencesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *UpdateVReplicationWorkflowsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -7572,9 +7966,132 @@ func (m *ResetSequencesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Tables) > 0 { - for iNdEx := len(m.Tables) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Tables[iNdEx]) + if len(m.StopPosition) > 0 { + i -= len(m.StopPosition) + copy(dAtA[i:], m.StopPosition) + i = encodeVarint(dAtA, i, uint64(len(m.StopPosition))) + i-- + dAtA[i] = 0x32 + } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarint(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x2a + } + if m.State != 0 { + i = encodeVarint(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x20 + } + if len(m.ExcludeWorkflows) > 0 { + for iNdEx := len(m.ExcludeWorkflows) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ExcludeWorkflows[iNdEx]) + copy(dAtA[i:], m.ExcludeWorkflows[iNdEx]) + i = encodeVarint(dAtA, i, uint64(len(m.ExcludeWorkflows[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.IncludeWorkflows) > 0 { + for iNdEx := len(m.IncludeWorkflows) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.IncludeWorkflows[iNdEx]) + copy(dAtA[i:], m.IncludeWorkflows[iNdEx]) + i = encodeVarint(dAtA, i, uint64(len(m.IncludeWorkflows[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if m.AllWorkflows { + i-- + if m.AllWorkflows { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *UpdateVReplicationWorkflowsResponse) 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 *UpdateVReplicationWorkflowsResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UpdateVReplicationWorkflowsResponse) 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.Result != nil { + size, err := m.Result.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 *ResetSequencesRequest) 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 *ResetSequencesRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ResetSequencesRequest) 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.Tables) > 0 { + for iNdEx := len(m.Tables) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Tables[iNdEx]) copy(dAtA[i:], m.Tables[iNdEx]) i = encodeVarint(dAtA, i, uint64(len(m.Tables[iNdEx]))) i-- @@ -9269,6 +9786,91 @@ func (m *DeleteVReplicationWorkflowResponse) SizeVT() (n int) { return n } +func (m *HasVReplicationWorkflowsRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *HasVReplicationWorkflowsResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Has { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *ReadVReplicationWorkflowsRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.IncludeIds) > 0 { + l = 0 + for _, e := range m.IncludeIds { + l += sov(uint64(e)) + } + n += 1 + sov(uint64(l)) + l + } + if len(m.IncludeWorkflows) > 0 { + for _, s := range m.IncludeWorkflows { + l = len(s) + n += 1 + l + sov(uint64(l)) + } + } + if len(m.IncludeStates) > 0 { + l = 0 + for _, e := range m.IncludeStates { + l += sov(uint64(e)) + } + n += 1 + sov(uint64(l)) + l + } + if len(m.ExcludeWorkflows) > 0 { + for _, s := range m.ExcludeWorkflows { + l = len(s) + n += 1 + l + sov(uint64(l)) + } + } + if len(m.ExcludeStates) > 0 { + l = 0 + for _, e := range m.ExcludeStates { + l += sov(uint64(e)) + } + n += 1 + sov(uint64(l)) + l + } + if m.ExcludeFrozen { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *ReadVReplicationWorkflowsResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Workflows) > 0 { + for _, e := range m.Workflows { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + func (m *ReadVReplicationWorkflowRequest) SizeVT() (n int) { if m == nil { return 0 @@ -9611,6 +10213,56 @@ func (m *UpdateVReplicationWorkflowResponse) SizeVT() (n int) { return n } +func (m *UpdateVReplicationWorkflowsRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AllWorkflows { + n += 2 + } + if len(m.IncludeWorkflows) > 0 { + for _, s := range m.IncludeWorkflows { + l = len(s) + n += 1 + l + sov(uint64(l)) + } + } + if len(m.ExcludeWorkflows) > 0 { + for _, s := range m.ExcludeWorkflows { + l = len(s) + n += 1 + l + sov(uint64(l)) + } + } + if m.State != 0 { + n += 1 + sov(uint64(m.State)) + } + l = len(m.Message) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.StopPosition) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *UpdateVReplicationWorkflowsResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Result != nil { + l = m.Result.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + func (m *ResetSequencesRequest) SizeVT() (n int) { if m == nil { return 0 @@ -18768,19 +19420,488 @@ func (m *DeleteVReplicationWorkflowRequest) UnmarshalVT(dAtA []byte) error { if b < 0x80 { break } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DeleteVReplicationWorkflowRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteVReplicationWorkflowRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteVReplicationWorkflowRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteVReplicationWorkflowRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 + 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 *DeleteVReplicationWorkflowResponse) 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: DeleteVReplicationWorkflowResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteVReplicationWorkflowResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", 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.Result == nil { + m.Result = &query.QueryResult{} + } + if err := m.Result.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 *HasVReplicationWorkflowsRequest) 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: HasVReplicationWorkflowsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HasVReplicationWorkflowsRequest: 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 *HasVReplicationWorkflowsResponse) 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: HasVReplicationWorkflowsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HasVReplicationWorkflowsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Has", 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.Has = bool(v != 0) + 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 *ReadVReplicationWorkflowsRequest) 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: ReadVReplicationWorkflowsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ReadVReplicationWorkflowsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IncludeIds = append(m.IncludeIds, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.IncludeIds) == 0 { + m.IncludeIds = make([]int32, 0, elementCount) + } + for iNdEx < postIndex { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IncludeIds = append(m.IncludeIds, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field IncludeIds", wireType) + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IncludeWorkflows", 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.IncludeWorkflows = append(m.IncludeWorkflows, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType == 0 { + var v binlogdata.VReplicationWorkflowState + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= binlogdata.VReplicationWorkflowState(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IncludeStates = append(m.IncludeStates, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + if elementCount != 0 && len(m.IncludeStates) == 0 { + m.IncludeStates = make([]binlogdata.VReplicationWorkflowState, 0, elementCount) + } + for iNdEx < postIndex { + var v binlogdata.VReplicationWorkflowState + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= binlogdata.VReplicationWorkflowState(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IncludeStates = append(m.IncludeStates, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field IncludeStates", wireType) + } + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Workflow", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExcludeWorkflows", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -18808,8 +19929,97 @@ func (m *DeleteVReplicationWorkflowRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Workflow = string(dAtA[iNdEx:postIndex]) + m.ExcludeWorkflows = append(m.ExcludeWorkflows, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 5: + if wireType == 0 { + var v binlogdata.VReplicationWorkflowState + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= binlogdata.VReplicationWorkflowState(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ExcludeStates = append(m.ExcludeStates, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + if elementCount != 0 && len(m.ExcludeStates) == 0 { + m.ExcludeStates = make([]binlogdata.VReplicationWorkflowState, 0, elementCount) + } + for iNdEx < postIndex { + var v binlogdata.VReplicationWorkflowState + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= binlogdata.VReplicationWorkflowState(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ExcludeStates = append(m.ExcludeStates, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field ExcludeStates", wireType) + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExcludeFrozen", 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.ExcludeFrozen = bool(v != 0) default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) @@ -18832,7 +20042,7 @@ func (m *DeleteVReplicationWorkflowRequest) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *DeleteVReplicationWorkflowResponse) UnmarshalVT(dAtA []byte) error { +func (m *ReadVReplicationWorkflowsResponse) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18855,15 +20065,15 @@ func (m *DeleteVReplicationWorkflowResponse) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeleteVReplicationWorkflowResponse: wiretype end group for non-group") + return fmt.Errorf("proto: ReadVReplicationWorkflowsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteVReplicationWorkflowResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ReadVReplicationWorkflowsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Workflows", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -18890,10 +20100,8 @@ func (m *DeleteVReplicationWorkflowResponse) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Result == nil { - m.Result = &query.QueryResult{} - } - if err := m.Result.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + m.Workflows = append(m.Workflows, &ReadVReplicationWorkflowResponse{}) + if err := m.Workflows[len(m.Workflows)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -19622,7 +20830,148 @@ func (m *ReadVReplicationWorkflowResponse) UnmarshalVT(dAtA []byte) error { if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field TabletSelectionPreference", wireType) } - m.TabletSelectionPreference = 0 + m.TabletSelectionPreference = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TabletSelectionPreference |= TabletSelectionPreference(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DbName", 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.DbName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", 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.Tags = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WorkflowType", wireType) + } + m.WorkflowType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.WorkflowType |= binlogdata.VReplicationWorkflowType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WorkflowSubType", wireType) + } + m.WorkflowSubType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.WorkflowSubType |= binlogdata.VReplicationWorkflowSubType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DeferSecondaryKeys", 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.DeferSecondaryKeys = bool(v != 0) + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Streams", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -19632,14 +20981,80 @@ func (m *ReadVReplicationWorkflowResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.TabletSelectionPreference |= TabletSelectionPreference(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 6: + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Streams = append(m.Streams, &ReadVReplicationWorkflowResponse_Stream{}) + if err := m.Streams[len(m.Streams)-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 *VDiffRequest) 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: VDiffRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VDiffRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DbName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -19667,11 +21082,11 @@ func (m *ReadVReplicationWorkflowResponse) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DbName = string(dAtA[iNdEx:postIndex]) + m.Keyspace = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Workflow", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -19699,13 +21114,13 @@ func (m *ReadVReplicationWorkflowResponse) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Tags = string(dAtA[iNdEx:postIndex]) + m.Workflow = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WorkflowType", wireType) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) } - m.WorkflowType = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -19715,16 +21130,29 @@ func (m *ReadVReplicationWorkflowResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.WorkflowType |= binlogdata.VReplicationWorkflowType(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WorkflowSubType", wireType) + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength } - m.WorkflowSubType = 0 + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Action = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActionArg", wireType) + } + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -19734,16 +21162,29 @@ func (m *ReadVReplicationWorkflowResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.WorkflowSubType |= binlogdata.VReplicationWorkflowSubType(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DeferSecondaryKeys", wireType) + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength } - var v int + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ActionArg = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VdiffUuid", wireType) + } + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -19753,15 +21194,27 @@ func (m *ReadVReplicationWorkflowResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.DeferSecondaryKeys = bool(v != 0) - case 11: + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VdiffUuid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Streams", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -19788,8 +21241,10 @@ func (m *ReadVReplicationWorkflowResponse) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Streams = append(m.Streams, &ReadVReplicationWorkflowResponse_Stream{}) - if err := m.Streams[len(m.Streams)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if m.Options == nil { + m.Options = &VDiffOptions{} + } + if err := m.Options.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -19815,7 +21270,7 @@ func (m *ReadVReplicationWorkflowResponse) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *VDiffRequest) UnmarshalVT(dAtA []byte) error { +func (m *VDiffResponse) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -19838,17 +21293,17 @@ func (m *VDiffRequest) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: VDiffRequest: wiretype end group for non-group") + return fmt.Errorf("proto: VDiffResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: VDiffRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: VDiffResponse: 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) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } - var stringLen uint64 + m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -19858,29 +21313,16 @@ func (m *VDiffRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.Id |= int64(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) + return fmt.Errorf("proto: wrong wireType = %d for field Output", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -19890,27 +21332,31 @@ func (m *VDiffRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Workflow = string(dAtA[iNdEx:postIndex]) + if m.Output == nil { + m.Output = &query.QueryResult{} + } + if err := m.Output.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field VdiffUuid", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -19938,11 +21384,62 @@ func (m *VDiffRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Action = string(dAtA[iNdEx:postIndex]) + m.VdiffUuid = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + 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 *VDiffPickerOptions) 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: VDiffPickerOptions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VDiffPickerOptions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActionArg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TabletTypes", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -19970,11 +21467,11 @@ func (m *VDiffRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ActionArg = string(dAtA[iNdEx:postIndex]) + m.TabletTypes = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VdiffUuid", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SourceCell", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -20002,13 +21499,13 @@ func (m *VDiffRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.VdiffUuid = string(dAtA[iNdEx:postIndex]) + m.SourceCell = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TargetCell", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -20018,27 +21515,23 @@ func (m *VDiffRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Options == nil { - m.Options = &VDiffOptions{} - } - if err := m.Options.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.TargetCell = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -20062,7 +21555,7 @@ func (m *VDiffRequest) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *VDiffResponse) UnmarshalVT(dAtA []byte) error { +func (m *VDiffReportOptions) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -20085,17 +21578,17 @@ func (m *VDiffResponse) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: VDiffResponse: wiretype end group for non-group") + return fmt.Errorf("proto: VDiffReportOptions: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: VDiffResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: VDiffReportOptions: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OnlyPks", wireType) } - m.Id = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -20105,16 +21598,17 @@ func (m *VDiffResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Id |= int64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } + m.OnlyPks = bool(v != 0) case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Output", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DebugQuery", wireType) } - var msglen int + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -20124,31 +21618,15 @@ func (m *VDiffResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + v |= 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.Output == nil { - m.Output = &query.QueryResult{} - } - if err := m.Output.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex + m.DebugQuery = bool(v != 0) case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VdiffUuid", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -20176,8 +21654,27 @@ func (m *VDiffResponse) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.VdiffUuid = string(dAtA[iNdEx:postIndex]) + m.Format = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxSampleRows", wireType) + } + m.MaxSampleRows = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxSampleRows |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) @@ -20200,7 +21697,7 @@ func (m *VDiffResponse) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *VDiffPickerOptions) UnmarshalVT(dAtA []byte) error { +func (m *VDiffCoreOptions) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -20223,15 +21720,15 @@ func (m *VDiffPickerOptions) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: VDiffPickerOptions: wiretype end group for non-group") + return fmt.Errorf("proto: VDiffCoreOptions: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: VDiffPickerOptions: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: VDiffCoreOptions: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TabletTypes", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Tables", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -20259,13 +21756,13 @@ func (m *VDiffPickerOptions) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TabletTypes = string(dAtA[iNdEx:postIndex]) + m.Tables = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceCell", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AutoRetry", wireType) } - var stringLen uint64 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -20275,29 +21772,56 @@ func (m *VDiffPickerOptions) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength + m.AutoRetry = bool(v != 0) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxRows", wireType) } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength + m.MaxRows = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxRows |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - if postIndex > l { - return io.ErrUnexpectedEOF + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Checksum", wireType) } - m.SourceCell = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TargetCell", 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 + } } - var stringLen uint64 + m.Checksum = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SamplePct", wireType) + } + m.SamplePct = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -20307,24 +21831,88 @@ func (m *VDiffPickerOptions) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.SamplePct |= int64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutSeconds", wireType) } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength + m.TimeoutSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeoutSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - if postIndex > l { - return io.ErrUnexpectedEOF + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxExtraRowsToCompare", wireType) + } + m.MaxExtraRowsToCompare = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxExtraRowsToCompare |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UpdateTableStats", 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.UpdateTableStats = bool(v != 0) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxDiffSeconds", wireType) + } + m.MaxDiffSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxDiffSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - m.TargetCell = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) @@ -20347,7 +21935,7 @@ func (m *VDiffPickerOptions) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *VDiffReportOptions) UnmarshalVT(dAtA []byte) error { +func (m *VDiffOptions) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -20370,17 +21958,17 @@ func (m *VDiffReportOptions) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: VDiffReportOptions: wiretype end group for non-group") + return fmt.Errorf("proto: VDiffOptions: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: VDiffReportOptions: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: VDiffOptions: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OnlyPks", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PickerOptions", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -20390,17 +21978,33 @@ func (m *VDiffReportOptions) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.OnlyPks = bool(v != 0) + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PickerOptions == nil { + m.PickerOptions = &VDiffPickerOptions{} + } + if err := m.PickerOptions.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DebugQuery", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CoreOptions", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -20410,17 +22014,33 @@ func (m *VDiffReportOptions) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.DebugQuery = bool(v != 0) + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CoreOptions == nil { + m.CoreOptions = &VDiffCoreOptions{} + } + if err := m.CoreOptions.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ReportOptions", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -20430,43 +22050,28 @@ func (m *VDiffReportOptions) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Format = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxSampleRows", wireType) + if m.ReportOptions == nil { + m.ReportOptions = &VDiffReportOptions{} } - m.MaxSampleRows = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxSampleRows |= int64(b&0x7F) << shift - if b < 0x80 { - break - } + if err := m.ReportOptions.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) @@ -20489,7 +22094,7 @@ func (m *VDiffReportOptions) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *VDiffCoreOptions) UnmarshalVT(dAtA []byte) error { +func (m *UpdateVReplicationWorkflowRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -20512,15 +22117,15 @@ func (m *VDiffCoreOptions) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: VDiffCoreOptions: wiretype end group for non-group") + return fmt.Errorf("proto: UpdateVReplicationWorkflowRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: VDiffCoreOptions: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: UpdateVReplicationWorkflowRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tables", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Workflow", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -20548,13 +22153,13 @@ func (m *VDiffCoreOptions) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Tables = string(dAtA[iNdEx:postIndex]) + m.Workflow = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AutoRetry", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cells", wireType) } - var v int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -20564,75 +22169,98 @@ func (m *VDiffCoreOptions) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.AutoRetry = bool(v != 0) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxRows", wireType) + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength } - m.MaxRows = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxRows |= int64(b&0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Checksum", wireType) + if postIndex > l { + return io.ErrUnexpectedEOF } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow + m.Cells = append(m.Cells, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType == 0 { + var v topodata.TabletType + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= topodata.TabletType(b&0x7F) << shift + if b < 0x80 { + break + } } - if iNdEx >= l { - return io.ErrUnexpectedEOF + m.TabletTypes = append(m.TabletTypes, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break + if packedLen < 0 { + return ErrInvalidLength } - } - m.Checksum = bool(v != 0) - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SamplePct", wireType) - } - m.SamplePct = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLength } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - m.SamplePct |= int64(b&0x7F) << shift - if b < 0x80 { - break + var elementCount int + if elementCount != 0 && len(m.TabletTypes) == 0 { + m.TabletTypes = make([]topodata.TabletType, 0, elementCount) + } + for iNdEx < postIndex { + var v topodata.TabletType + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= topodata.TabletType(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TabletTypes = append(m.TabletTypes, v) } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field TabletTypes", wireType) } - case 6: + case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeoutSeconds", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TabletSelectionPreference", wireType) } - m.TimeoutSeconds = 0 + m.TabletSelectionPreference = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -20642,16 +22270,16 @@ func (m *VDiffCoreOptions) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.TimeoutSeconds |= int64(b&0x7F) << shift + m.TabletSelectionPreference |= TabletSelectionPreference(b&0x7F) << shift if b < 0x80 { break } } - case 7: + case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxExtraRowsToCompare", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OnDdl", wireType) } - m.MaxExtraRowsToCompare = 0 + m.OnDdl = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -20661,16 +22289,16 @@ func (m *VDiffCoreOptions) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MaxExtraRowsToCompare |= int64(b&0x7F) << shift + m.OnDdl |= binlogdata.OnDDLAction(b&0x7F) << shift if b < 0x80 { break } } - case 8: + case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UpdateTableStats", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } - var v int + m.State = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -20680,17 +22308,16 @@ func (m *VDiffCoreOptions) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.State |= binlogdata.VReplicationWorkflowState(b&0x7F) << shift if b < 0x80 { break } } - m.UpdateTableStats = bool(v != 0) - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxDiffSeconds", wireType) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Shards", wireType) } - m.MaxDiffSeconds = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -20700,11 +22327,24 @@ func (m *VDiffCoreOptions) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MaxDiffSeconds |= int64(b&0x7F) << shift + 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.Shards = append(m.Shards, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) @@ -20727,7 +22367,7 @@ func (m *VDiffCoreOptions) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *VDiffOptions) UnmarshalVT(dAtA []byte) error { +func (m *UpdateVReplicationWorkflowResponse) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -20750,87 +22390,15 @@ func (m *VDiffOptions) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: VDiffOptions: wiretype end group for non-group") + return fmt.Errorf("proto: UpdateVReplicationWorkflowResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: VDiffOptions: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: UpdateVReplicationWorkflowResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PickerOptions", 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.PickerOptions == nil { - m.PickerOptions = &VDiffPickerOptions{} - } - if err := m.PickerOptions.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CoreOptions", 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.CoreOptions == nil { - m.CoreOptions = &VDiffCoreOptions{} - } - if err := m.CoreOptions.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ReportOptions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -20857,10 +22425,10 @@ func (m *VDiffOptions) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ReportOptions == nil { - m.ReportOptions = &VDiffReportOptions{} + if m.Result == nil { + m.Result = &query.QueryResult{} } - if err := m.ReportOptions.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Result.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -20886,7 +22454,7 @@ func (m *VDiffOptions) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *UpdateVReplicationWorkflowRequest) UnmarshalVT(dAtA []byte) error { +func (m *UpdateVReplicationWorkflowsRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -20909,15 +22477,35 @@ func (m *UpdateVReplicationWorkflowRequest) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: UpdateVReplicationWorkflowRequest: wiretype end group for non-group") + return fmt.Errorf("proto: UpdateVReplicationWorkflowsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateVReplicationWorkflowRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: UpdateVReplicationWorkflowsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllWorkflows", 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.AllWorkflows = bool(v != 0) + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Workflow", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IncludeWorkflows", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -20945,11 +22533,11 @@ func (m *UpdateVReplicationWorkflowRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Workflow = string(dAtA[iNdEx:postIndex]) + m.IncludeWorkflows = append(m.IncludeWorkflows, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cells", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExcludeWorkflows", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -20977,82 +22565,13 @@ func (m *UpdateVReplicationWorkflowRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Cells = append(m.Cells, string(dAtA[iNdEx:postIndex])) + m.ExcludeWorkflows = append(m.ExcludeWorkflows, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 3: - if wireType == 0 { - var v topodata.TabletType - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= topodata.TabletType(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.TabletTypes = append(m.TabletTypes, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - if elementCount != 0 && len(m.TabletTypes) == 0 { - m.TabletTypes = make([]topodata.TabletType, 0, elementCount) - } - for iNdEx < postIndex { - var v topodata.TabletType - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= topodata.TabletType(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.TabletTypes = append(m.TabletTypes, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field TabletTypes", wireType) - } case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TabletSelectionPreference", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } - m.TabletSelectionPreference = 0 + m.State = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -21062,16 +22581,16 @@ func (m *UpdateVReplicationWorkflowRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.TabletSelectionPreference |= TabletSelectionPreference(b&0x7F) << shift + m.State |= binlogdata.VReplicationWorkflowState(b&0x7F) << shift if b < 0x80 { break } } case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OnDdl", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } - m.OnDdl = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -21081,33 +22600,27 @@ func (m *UpdateVReplicationWorkflowRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.OnDdl |= binlogdata.OnDDLAction(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength } - m.State = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.State |= binlogdata.VReplicationWorkflowState(b&0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength } - case 7: + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Shards", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StopPosition", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -21135,7 +22648,7 @@ func (m *UpdateVReplicationWorkflowRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Shards = append(m.Shards, string(dAtA[iNdEx:postIndex])) + m.StopPosition = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -21159,7 +22672,7 @@ func (m *UpdateVReplicationWorkflowRequest) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *UpdateVReplicationWorkflowResponse) UnmarshalVT(dAtA []byte) error { +func (m *UpdateVReplicationWorkflowsResponse) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -21182,10 +22695,10 @@ func (m *UpdateVReplicationWorkflowResponse) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: UpdateVReplicationWorkflowResponse: wiretype end group for non-group") + return fmt.Errorf("proto: UpdateVReplicationWorkflowsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateVReplicationWorkflowResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: UpdateVReplicationWorkflowsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/go/vt/proto/tabletmanagerservice/tabletmanagerservice.pb.go b/go/vt/proto/tabletmanagerservice/tabletmanagerservice.pb.go index 400e0731611..3068ba7c0bb 100644 --- a/go/vt/proto/tabletmanagerservice/tabletmanagerservice.pb.go +++ b/go/vt/proto/tabletmanagerservice/tabletmanagerservice.pb.go @@ -45,7 +45,7 @@ var file_tabletmanagerservice_proto_rawDesc = []byte{ 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x17, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xca, 0x2c, 0x0a, 0x0d, + 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xee, 0x2f, 0x0a, 0x0d, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x49, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x1e, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, @@ -253,160 +253,186 @@ var file_tabletmanagerservice_proto_rawDesc = []byte{ 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x85, 0x01, 0x0a, 0x18, - 0x52, 0x65, 0x61, 0x64, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x32, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, - 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x61, - 0x64, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, - 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x74, - 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, - 0x2e, 0x52, 0x65, 0x61, 0x64, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x6d, 0x0a, 0x10, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x65, 0x63, 0x12, 0x2a, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, - 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, 0x52, 0x65, 0x70, - 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x7f, 0x0a, 0x16, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x57, 0x61, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x50, 0x6f, 0x73, 0x12, 0x30, 0x2e, 0x74, + 0x48, 0x61, 0x73, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, + 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x12, 0x32, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x48, 0x61, 0x73, + 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, + 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, - 0x2e, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x61, 0x69, - 0x74, 0x46, 0x6f, 0x72, 0x50, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, - 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, - 0x74, 0x61, 0x2e, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, - 0x61, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x50, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x8b, 0x01, 0x0a, 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x52, - 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, - 0x6f, 0x77, 0x12, 0x34, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x52, 0x65, + 0x2e, 0x48, 0x61, 0x73, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x85, 0x01, 0x0a, 0x18, 0x52, 0x65, 0x61, 0x64, 0x56, 0x52, 0x65, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, + 0x12, 0x32, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, - 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, - 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, - 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x4c, 0x0a, 0x05, 0x56, 0x44, 0x69, 0x66, 0x66, 0x12, 0x1f, 0x2e, 0x74, 0x61, 0x62, + 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x88, 0x01, 0x0a, 0x19, + 0x52, 0x65, 0x61, 0x64, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x12, 0x33, 0x2e, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, + 0x61, 0x64, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, + 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6d, 0x0a, 0x10, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x65, 0x63, 0x12, 0x2a, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, - 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x74, 0x61, + 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x65, 0x63, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, 0x52, 0x65, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7f, 0x0a, 0x16, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x61, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x50, 0x6f, 0x73, 0x12, + 0x30, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x57, 0x61, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x50, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x31, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x57, 0x61, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x50, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8b, 0x01, 0x0a, 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, + 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x34, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, + 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x74, 0x61, + 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x8e, 0x01, 0x0a, 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, + 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, + 0x6c, 0x6f, 0x77, 0x73, 0x12, 0x35, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, + 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, + 0x6c, 0x6f, 0x77, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, - 0x56, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x6d, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x05, 0x56, 0x44, 0x69, 0x66, 0x66, 0x12, 0x1f, + 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x56, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x20, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x56, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x6d, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x65, + 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x70, - 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2b, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, - 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, - 0x0a, 0x0b, 0x49, 0x6e, 0x69, 0x74, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x25, 0x2e, - 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, - 0x61, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x50, 0x72, 0x69, - 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x82, - 0x01, 0x0a, 0x17, 0x50, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x61, 0x6c, 0x12, 0x31, 0x2e, 0x74, 0x61, 0x62, - 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x50, - 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4a, - 0x6f, 0x75, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, - 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, - 0x61, 0x2e, 0x50, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x61, 0x72, 0x65, - 0x6e, 0x74, 0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x0b, 0x49, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x12, 0x25, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x74, 0x61, 0x62, 0x6c, - 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x49, 0x6e, - 0x69, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x64, 0x0a, 0x0d, 0x44, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x72, 0x69, - 0x6d, 0x61, 0x72, 0x79, 0x12, 0x27, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x44, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, - 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, - 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, - 0x61, 0x2e, 0x44, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x70, 0x0a, 0x11, 0x55, 0x6e, 0x64, - 0x6f, 0x44, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x2b, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x0b, 0x49, 0x6e, 0x69, 0x74, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, + 0x79, 0x12, 0x25, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x49, 0x6e, 0x69, + 0x74, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x82, 0x01, 0x0a, 0x17, 0x50, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x61, 0x6c, 0x12, 0x31, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, - 0x74, 0x61, 0x2e, 0x55, 0x6e, 0x64, 0x6f, 0x44, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x72, 0x69, - 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x74, 0x61, - 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, - 0x55, 0x6e, 0x64, 0x6f, 0x44, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, - 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x73, 0x0a, 0x12, 0x52, - 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x57, 0x61, 0x73, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x65, - 0x64, 0x12, 0x2c, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x57, 0x61, 0x73, - 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2d, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, - 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x57, 0x61, 0x73, 0x50, 0x72, - 0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x8b, 0x01, 0x0a, 0x1a, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, - 0x34, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, - 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, - 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, - 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5b, - 0x0a, 0x0a, 0x46, 0x75, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x2e, 0x74, - 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, - 0x2e, 0x46, 0x75, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x46, 0x75, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x79, 0x0a, 0x14, 0x53, - 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x12, 0x2e, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x76, 0x0a, 0x13, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, - 0x61, 0x57, 0x61, 0x73, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x2d, 0x2e, + 0x74, 0x61, 0x2e, 0x50, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x32, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x0b, 0x49, 0x6e, 0x69, 0x74, 0x52, + 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x12, 0x25, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x52, + 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, - 0x61, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x57, 0x61, 0x73, 0x52, 0x65, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x74, - 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, - 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x57, 0x61, 0x73, 0x52, 0x65, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8e, - 0x01, 0x0a, 0x1b, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x35, - 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, - 0x74, 0x61, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x47, 0x65, 0x74, 0x53, + 0x61, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x64, 0x0a, 0x0d, 0x44, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x27, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x44, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x28, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x44, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x72, 0x69, 0x6d, + 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x70, 0x0a, + 0x11, 0x55, 0x6e, 0x64, 0x6f, 0x44, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x72, 0x69, 0x6d, 0x61, + 0x72, 0x79, 0x12, 0x2b, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x55, 0x6e, 0x64, 0x6f, 0x44, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2c, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x55, 0x6e, 0x64, 0x6f, 0x44, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x72, + 0x69, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x73, 0x0a, 0x12, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x57, 0x61, 0x73, 0x50, 0x72, 0x6f, + 0x6d, 0x6f, 0x74, 0x65, 0x64, 0x12, 0x2c, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x57, 0x61, 0x73, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x57, + 0x61, 0x73, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x8b, 0x01, 0x0a, 0x1a, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, + 0x65, 0x72, 0x73, 0x12, 0x34, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, + 0x73, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x0a, 0x46, 0x75, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x24, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x64, 0x61, 0x74, 0x61, 0x2e, 0x46, 0x75, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x46, 0x75, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x67, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, - 0x61, 0x12, 0x28, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x70, - 0x6c, 0x69, 0x63, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x74, 0x61, - 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, - 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x06, 0x42, 0x61, 0x63, 0x6b, - 0x75, 0x70, 0x12, 0x20, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x72, 0x0a, 0x11, 0x52, - 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, - 0x12, 0x2b, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, - 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x46, 0x72, 0x6f, 0x6d, - 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, - 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, - 0x61, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x42, 0x61, 0x63, + 0x79, 0x0a, 0x14, 0x53, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2e, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x53, 0x65, 0x74, 0x52, + 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x53, 0x65, 0x74, 0x52, + 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x76, 0x0a, 0x13, 0x52, 0x65, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x57, 0x61, 0x73, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, + 0x64, 0x12, 0x2d, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x57, 0x61, 0x73, + 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2e, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x57, 0x61, 0x73, 0x52, + 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x8e, 0x01, 0x0a, 0x1b, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x35, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x53, 0x74, + 0x6f, 0x70, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, + 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x67, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x12, 0x28, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x74, + 0x65, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x29, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x06, + 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x20, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, + 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, - 0x67, 0x0a, 0x0e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, - 0x72, 0x12, 0x28, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x68, 0x72, 0x6f, 0x74, - 0x74, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x74, 0x61, - 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x33, 0x5a, 0x31, 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, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x42, 0x61, + 0x63, 0x6b, 0x75, 0x70, 0x12, 0x2b, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x46, 0x72, 0x6f, 0x6d, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2c, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x46, 0x72, 0x6f, + 0x6d, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x30, 0x01, 0x12, 0x67, 0x0a, 0x0e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x68, 0x72, 0x6f, + 0x74, 0x74, 0x6c, 0x65, 0x72, 0x12, 0x28, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, + 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x29, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x33, 0x5a, 0x31, + 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, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_tabletmanagerservice_proto_goTypes = []interface{}{ @@ -441,79 +467,85 @@ var file_tabletmanagerservice_proto_goTypes = []interface{}{ (*tabletmanagerdata.GetReplicasRequest)(nil), // 28: tabletmanagerdata.GetReplicasRequest (*tabletmanagerdata.CreateVReplicationWorkflowRequest)(nil), // 29: tabletmanagerdata.CreateVReplicationWorkflowRequest (*tabletmanagerdata.DeleteVReplicationWorkflowRequest)(nil), // 30: tabletmanagerdata.DeleteVReplicationWorkflowRequest - (*tabletmanagerdata.ReadVReplicationWorkflowRequest)(nil), // 31: tabletmanagerdata.ReadVReplicationWorkflowRequest - (*tabletmanagerdata.VReplicationExecRequest)(nil), // 32: tabletmanagerdata.VReplicationExecRequest - (*tabletmanagerdata.VReplicationWaitForPosRequest)(nil), // 33: tabletmanagerdata.VReplicationWaitForPosRequest - (*tabletmanagerdata.UpdateVReplicationWorkflowRequest)(nil), // 34: tabletmanagerdata.UpdateVReplicationWorkflowRequest - (*tabletmanagerdata.VDiffRequest)(nil), // 35: tabletmanagerdata.VDiffRequest - (*tabletmanagerdata.ResetReplicationRequest)(nil), // 36: tabletmanagerdata.ResetReplicationRequest - (*tabletmanagerdata.InitPrimaryRequest)(nil), // 37: tabletmanagerdata.InitPrimaryRequest - (*tabletmanagerdata.PopulateReparentJournalRequest)(nil), // 38: tabletmanagerdata.PopulateReparentJournalRequest - (*tabletmanagerdata.InitReplicaRequest)(nil), // 39: tabletmanagerdata.InitReplicaRequest - (*tabletmanagerdata.DemotePrimaryRequest)(nil), // 40: tabletmanagerdata.DemotePrimaryRequest - (*tabletmanagerdata.UndoDemotePrimaryRequest)(nil), // 41: tabletmanagerdata.UndoDemotePrimaryRequest - (*tabletmanagerdata.ReplicaWasPromotedRequest)(nil), // 42: tabletmanagerdata.ReplicaWasPromotedRequest - (*tabletmanagerdata.ResetReplicationParametersRequest)(nil), // 43: tabletmanagerdata.ResetReplicationParametersRequest - (*tabletmanagerdata.FullStatusRequest)(nil), // 44: tabletmanagerdata.FullStatusRequest - (*tabletmanagerdata.SetReplicationSourceRequest)(nil), // 45: tabletmanagerdata.SetReplicationSourceRequest - (*tabletmanagerdata.ReplicaWasRestartedRequest)(nil), // 46: tabletmanagerdata.ReplicaWasRestartedRequest - (*tabletmanagerdata.StopReplicationAndGetStatusRequest)(nil), // 47: tabletmanagerdata.StopReplicationAndGetStatusRequest - (*tabletmanagerdata.PromoteReplicaRequest)(nil), // 48: tabletmanagerdata.PromoteReplicaRequest - (*tabletmanagerdata.BackupRequest)(nil), // 49: tabletmanagerdata.BackupRequest - (*tabletmanagerdata.RestoreFromBackupRequest)(nil), // 50: tabletmanagerdata.RestoreFromBackupRequest - (*tabletmanagerdata.CheckThrottlerRequest)(nil), // 51: tabletmanagerdata.CheckThrottlerRequest - (*tabletmanagerdata.PingResponse)(nil), // 52: tabletmanagerdata.PingResponse - (*tabletmanagerdata.SleepResponse)(nil), // 53: tabletmanagerdata.SleepResponse - (*tabletmanagerdata.ExecuteHookResponse)(nil), // 54: tabletmanagerdata.ExecuteHookResponse - (*tabletmanagerdata.GetSchemaResponse)(nil), // 55: tabletmanagerdata.GetSchemaResponse - (*tabletmanagerdata.GetPermissionsResponse)(nil), // 56: tabletmanagerdata.GetPermissionsResponse - (*tabletmanagerdata.SetReadOnlyResponse)(nil), // 57: tabletmanagerdata.SetReadOnlyResponse - (*tabletmanagerdata.SetReadWriteResponse)(nil), // 58: tabletmanagerdata.SetReadWriteResponse - (*tabletmanagerdata.ChangeTypeResponse)(nil), // 59: tabletmanagerdata.ChangeTypeResponse - (*tabletmanagerdata.RefreshStateResponse)(nil), // 60: tabletmanagerdata.RefreshStateResponse - (*tabletmanagerdata.RunHealthCheckResponse)(nil), // 61: tabletmanagerdata.RunHealthCheckResponse - (*tabletmanagerdata.ReloadSchemaResponse)(nil), // 62: tabletmanagerdata.ReloadSchemaResponse - (*tabletmanagerdata.PreflightSchemaResponse)(nil), // 63: tabletmanagerdata.PreflightSchemaResponse - (*tabletmanagerdata.ApplySchemaResponse)(nil), // 64: tabletmanagerdata.ApplySchemaResponse - (*tabletmanagerdata.ResetSequencesResponse)(nil), // 65: tabletmanagerdata.ResetSequencesResponse - (*tabletmanagerdata.LockTablesResponse)(nil), // 66: tabletmanagerdata.LockTablesResponse - (*tabletmanagerdata.UnlockTablesResponse)(nil), // 67: tabletmanagerdata.UnlockTablesResponse - (*tabletmanagerdata.ExecuteQueryResponse)(nil), // 68: tabletmanagerdata.ExecuteQueryResponse - (*tabletmanagerdata.ExecuteFetchAsDbaResponse)(nil), // 69: tabletmanagerdata.ExecuteFetchAsDbaResponse - (*tabletmanagerdata.ExecuteFetchAsAllPrivsResponse)(nil), // 70: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse - (*tabletmanagerdata.ExecuteFetchAsAppResponse)(nil), // 71: tabletmanagerdata.ExecuteFetchAsAppResponse - (*tabletmanagerdata.ReplicationStatusResponse)(nil), // 72: tabletmanagerdata.ReplicationStatusResponse - (*tabletmanagerdata.PrimaryStatusResponse)(nil), // 73: tabletmanagerdata.PrimaryStatusResponse - (*tabletmanagerdata.PrimaryPositionResponse)(nil), // 74: tabletmanagerdata.PrimaryPositionResponse - (*tabletmanagerdata.WaitForPositionResponse)(nil), // 75: tabletmanagerdata.WaitForPositionResponse - (*tabletmanagerdata.StopReplicationResponse)(nil), // 76: tabletmanagerdata.StopReplicationResponse - (*tabletmanagerdata.StopReplicationMinimumResponse)(nil), // 77: tabletmanagerdata.StopReplicationMinimumResponse - (*tabletmanagerdata.StartReplicationResponse)(nil), // 78: tabletmanagerdata.StartReplicationResponse - (*tabletmanagerdata.StartReplicationUntilAfterResponse)(nil), // 79: tabletmanagerdata.StartReplicationUntilAfterResponse - (*tabletmanagerdata.GetReplicasResponse)(nil), // 80: tabletmanagerdata.GetReplicasResponse - (*tabletmanagerdata.CreateVReplicationWorkflowResponse)(nil), // 81: tabletmanagerdata.CreateVReplicationWorkflowResponse - (*tabletmanagerdata.DeleteVReplicationWorkflowResponse)(nil), // 82: tabletmanagerdata.DeleteVReplicationWorkflowResponse - (*tabletmanagerdata.ReadVReplicationWorkflowResponse)(nil), // 83: tabletmanagerdata.ReadVReplicationWorkflowResponse - (*tabletmanagerdata.VReplicationExecResponse)(nil), // 84: tabletmanagerdata.VReplicationExecResponse - (*tabletmanagerdata.VReplicationWaitForPosResponse)(nil), // 85: tabletmanagerdata.VReplicationWaitForPosResponse - (*tabletmanagerdata.UpdateVReplicationWorkflowResponse)(nil), // 86: tabletmanagerdata.UpdateVReplicationWorkflowResponse - (*tabletmanagerdata.VDiffResponse)(nil), // 87: tabletmanagerdata.VDiffResponse - (*tabletmanagerdata.ResetReplicationResponse)(nil), // 88: tabletmanagerdata.ResetReplicationResponse - (*tabletmanagerdata.InitPrimaryResponse)(nil), // 89: tabletmanagerdata.InitPrimaryResponse - (*tabletmanagerdata.PopulateReparentJournalResponse)(nil), // 90: tabletmanagerdata.PopulateReparentJournalResponse - (*tabletmanagerdata.InitReplicaResponse)(nil), // 91: tabletmanagerdata.InitReplicaResponse - (*tabletmanagerdata.DemotePrimaryResponse)(nil), // 92: tabletmanagerdata.DemotePrimaryResponse - (*tabletmanagerdata.UndoDemotePrimaryResponse)(nil), // 93: tabletmanagerdata.UndoDemotePrimaryResponse - (*tabletmanagerdata.ReplicaWasPromotedResponse)(nil), // 94: tabletmanagerdata.ReplicaWasPromotedResponse - (*tabletmanagerdata.ResetReplicationParametersResponse)(nil), // 95: tabletmanagerdata.ResetReplicationParametersResponse - (*tabletmanagerdata.FullStatusResponse)(nil), // 96: tabletmanagerdata.FullStatusResponse - (*tabletmanagerdata.SetReplicationSourceResponse)(nil), // 97: tabletmanagerdata.SetReplicationSourceResponse - (*tabletmanagerdata.ReplicaWasRestartedResponse)(nil), // 98: tabletmanagerdata.ReplicaWasRestartedResponse - (*tabletmanagerdata.StopReplicationAndGetStatusResponse)(nil), // 99: tabletmanagerdata.StopReplicationAndGetStatusResponse - (*tabletmanagerdata.PromoteReplicaResponse)(nil), // 100: tabletmanagerdata.PromoteReplicaResponse - (*tabletmanagerdata.BackupResponse)(nil), // 101: tabletmanagerdata.BackupResponse - (*tabletmanagerdata.RestoreFromBackupResponse)(nil), // 102: tabletmanagerdata.RestoreFromBackupResponse - (*tabletmanagerdata.CheckThrottlerResponse)(nil), // 103: tabletmanagerdata.CheckThrottlerResponse + (*tabletmanagerdata.HasVReplicationWorkflowsRequest)(nil), // 31: tabletmanagerdata.HasVReplicationWorkflowsRequest + (*tabletmanagerdata.ReadVReplicationWorkflowRequest)(nil), // 32: tabletmanagerdata.ReadVReplicationWorkflowRequest + (*tabletmanagerdata.ReadVReplicationWorkflowsRequest)(nil), // 33: tabletmanagerdata.ReadVReplicationWorkflowsRequest + (*tabletmanagerdata.VReplicationExecRequest)(nil), // 34: tabletmanagerdata.VReplicationExecRequest + (*tabletmanagerdata.VReplicationWaitForPosRequest)(nil), // 35: tabletmanagerdata.VReplicationWaitForPosRequest + (*tabletmanagerdata.UpdateVReplicationWorkflowRequest)(nil), // 36: tabletmanagerdata.UpdateVReplicationWorkflowRequest + (*tabletmanagerdata.UpdateVReplicationWorkflowsRequest)(nil), // 37: tabletmanagerdata.UpdateVReplicationWorkflowsRequest + (*tabletmanagerdata.VDiffRequest)(nil), // 38: tabletmanagerdata.VDiffRequest + (*tabletmanagerdata.ResetReplicationRequest)(nil), // 39: tabletmanagerdata.ResetReplicationRequest + (*tabletmanagerdata.InitPrimaryRequest)(nil), // 40: tabletmanagerdata.InitPrimaryRequest + (*tabletmanagerdata.PopulateReparentJournalRequest)(nil), // 41: tabletmanagerdata.PopulateReparentJournalRequest + (*tabletmanagerdata.InitReplicaRequest)(nil), // 42: tabletmanagerdata.InitReplicaRequest + (*tabletmanagerdata.DemotePrimaryRequest)(nil), // 43: tabletmanagerdata.DemotePrimaryRequest + (*tabletmanagerdata.UndoDemotePrimaryRequest)(nil), // 44: tabletmanagerdata.UndoDemotePrimaryRequest + (*tabletmanagerdata.ReplicaWasPromotedRequest)(nil), // 45: tabletmanagerdata.ReplicaWasPromotedRequest + (*tabletmanagerdata.ResetReplicationParametersRequest)(nil), // 46: tabletmanagerdata.ResetReplicationParametersRequest + (*tabletmanagerdata.FullStatusRequest)(nil), // 47: tabletmanagerdata.FullStatusRequest + (*tabletmanagerdata.SetReplicationSourceRequest)(nil), // 48: tabletmanagerdata.SetReplicationSourceRequest + (*tabletmanagerdata.ReplicaWasRestartedRequest)(nil), // 49: tabletmanagerdata.ReplicaWasRestartedRequest + (*tabletmanagerdata.StopReplicationAndGetStatusRequest)(nil), // 50: tabletmanagerdata.StopReplicationAndGetStatusRequest + (*tabletmanagerdata.PromoteReplicaRequest)(nil), // 51: tabletmanagerdata.PromoteReplicaRequest + (*tabletmanagerdata.BackupRequest)(nil), // 52: tabletmanagerdata.BackupRequest + (*tabletmanagerdata.RestoreFromBackupRequest)(nil), // 53: tabletmanagerdata.RestoreFromBackupRequest + (*tabletmanagerdata.CheckThrottlerRequest)(nil), // 54: tabletmanagerdata.CheckThrottlerRequest + (*tabletmanagerdata.PingResponse)(nil), // 55: tabletmanagerdata.PingResponse + (*tabletmanagerdata.SleepResponse)(nil), // 56: tabletmanagerdata.SleepResponse + (*tabletmanagerdata.ExecuteHookResponse)(nil), // 57: tabletmanagerdata.ExecuteHookResponse + (*tabletmanagerdata.GetSchemaResponse)(nil), // 58: tabletmanagerdata.GetSchemaResponse + (*tabletmanagerdata.GetPermissionsResponse)(nil), // 59: tabletmanagerdata.GetPermissionsResponse + (*tabletmanagerdata.SetReadOnlyResponse)(nil), // 60: tabletmanagerdata.SetReadOnlyResponse + (*tabletmanagerdata.SetReadWriteResponse)(nil), // 61: tabletmanagerdata.SetReadWriteResponse + (*tabletmanagerdata.ChangeTypeResponse)(nil), // 62: tabletmanagerdata.ChangeTypeResponse + (*tabletmanagerdata.RefreshStateResponse)(nil), // 63: tabletmanagerdata.RefreshStateResponse + (*tabletmanagerdata.RunHealthCheckResponse)(nil), // 64: tabletmanagerdata.RunHealthCheckResponse + (*tabletmanagerdata.ReloadSchemaResponse)(nil), // 65: tabletmanagerdata.ReloadSchemaResponse + (*tabletmanagerdata.PreflightSchemaResponse)(nil), // 66: tabletmanagerdata.PreflightSchemaResponse + (*tabletmanagerdata.ApplySchemaResponse)(nil), // 67: tabletmanagerdata.ApplySchemaResponse + (*tabletmanagerdata.ResetSequencesResponse)(nil), // 68: tabletmanagerdata.ResetSequencesResponse + (*tabletmanagerdata.LockTablesResponse)(nil), // 69: tabletmanagerdata.LockTablesResponse + (*tabletmanagerdata.UnlockTablesResponse)(nil), // 70: tabletmanagerdata.UnlockTablesResponse + (*tabletmanagerdata.ExecuteQueryResponse)(nil), // 71: tabletmanagerdata.ExecuteQueryResponse + (*tabletmanagerdata.ExecuteFetchAsDbaResponse)(nil), // 72: tabletmanagerdata.ExecuteFetchAsDbaResponse + (*tabletmanagerdata.ExecuteFetchAsAllPrivsResponse)(nil), // 73: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse + (*tabletmanagerdata.ExecuteFetchAsAppResponse)(nil), // 74: tabletmanagerdata.ExecuteFetchAsAppResponse + (*tabletmanagerdata.ReplicationStatusResponse)(nil), // 75: tabletmanagerdata.ReplicationStatusResponse + (*tabletmanagerdata.PrimaryStatusResponse)(nil), // 76: tabletmanagerdata.PrimaryStatusResponse + (*tabletmanagerdata.PrimaryPositionResponse)(nil), // 77: tabletmanagerdata.PrimaryPositionResponse + (*tabletmanagerdata.WaitForPositionResponse)(nil), // 78: tabletmanagerdata.WaitForPositionResponse + (*tabletmanagerdata.StopReplicationResponse)(nil), // 79: tabletmanagerdata.StopReplicationResponse + (*tabletmanagerdata.StopReplicationMinimumResponse)(nil), // 80: tabletmanagerdata.StopReplicationMinimumResponse + (*tabletmanagerdata.StartReplicationResponse)(nil), // 81: tabletmanagerdata.StartReplicationResponse + (*tabletmanagerdata.StartReplicationUntilAfterResponse)(nil), // 82: tabletmanagerdata.StartReplicationUntilAfterResponse + (*tabletmanagerdata.GetReplicasResponse)(nil), // 83: tabletmanagerdata.GetReplicasResponse + (*tabletmanagerdata.CreateVReplicationWorkflowResponse)(nil), // 84: tabletmanagerdata.CreateVReplicationWorkflowResponse + (*tabletmanagerdata.DeleteVReplicationWorkflowResponse)(nil), // 85: tabletmanagerdata.DeleteVReplicationWorkflowResponse + (*tabletmanagerdata.HasVReplicationWorkflowsResponse)(nil), // 86: tabletmanagerdata.HasVReplicationWorkflowsResponse + (*tabletmanagerdata.ReadVReplicationWorkflowResponse)(nil), // 87: tabletmanagerdata.ReadVReplicationWorkflowResponse + (*tabletmanagerdata.ReadVReplicationWorkflowsResponse)(nil), // 88: tabletmanagerdata.ReadVReplicationWorkflowsResponse + (*tabletmanagerdata.VReplicationExecResponse)(nil), // 89: tabletmanagerdata.VReplicationExecResponse + (*tabletmanagerdata.VReplicationWaitForPosResponse)(nil), // 90: tabletmanagerdata.VReplicationWaitForPosResponse + (*tabletmanagerdata.UpdateVReplicationWorkflowResponse)(nil), // 91: tabletmanagerdata.UpdateVReplicationWorkflowResponse + (*tabletmanagerdata.UpdateVReplicationWorkflowsResponse)(nil), // 92: tabletmanagerdata.UpdateVReplicationWorkflowsResponse + (*tabletmanagerdata.VDiffResponse)(nil), // 93: tabletmanagerdata.VDiffResponse + (*tabletmanagerdata.ResetReplicationResponse)(nil), // 94: tabletmanagerdata.ResetReplicationResponse + (*tabletmanagerdata.InitPrimaryResponse)(nil), // 95: tabletmanagerdata.InitPrimaryResponse + (*tabletmanagerdata.PopulateReparentJournalResponse)(nil), // 96: tabletmanagerdata.PopulateReparentJournalResponse + (*tabletmanagerdata.InitReplicaResponse)(nil), // 97: tabletmanagerdata.InitReplicaResponse + (*tabletmanagerdata.DemotePrimaryResponse)(nil), // 98: tabletmanagerdata.DemotePrimaryResponse + (*tabletmanagerdata.UndoDemotePrimaryResponse)(nil), // 99: tabletmanagerdata.UndoDemotePrimaryResponse + (*tabletmanagerdata.ReplicaWasPromotedResponse)(nil), // 100: tabletmanagerdata.ReplicaWasPromotedResponse + (*tabletmanagerdata.ResetReplicationParametersResponse)(nil), // 101: tabletmanagerdata.ResetReplicationParametersResponse + (*tabletmanagerdata.FullStatusResponse)(nil), // 102: tabletmanagerdata.FullStatusResponse + (*tabletmanagerdata.SetReplicationSourceResponse)(nil), // 103: tabletmanagerdata.SetReplicationSourceResponse + (*tabletmanagerdata.ReplicaWasRestartedResponse)(nil), // 104: tabletmanagerdata.ReplicaWasRestartedResponse + (*tabletmanagerdata.StopReplicationAndGetStatusResponse)(nil), // 105: tabletmanagerdata.StopReplicationAndGetStatusResponse + (*tabletmanagerdata.PromoteReplicaResponse)(nil), // 106: tabletmanagerdata.PromoteReplicaResponse + (*tabletmanagerdata.BackupResponse)(nil), // 107: tabletmanagerdata.BackupResponse + (*tabletmanagerdata.RestoreFromBackupResponse)(nil), // 108: tabletmanagerdata.RestoreFromBackupResponse + (*tabletmanagerdata.CheckThrottlerResponse)(nil), // 109: tabletmanagerdata.CheckThrottlerResponse } var file_tabletmanagerservice_proto_depIdxs = []int32{ 0, // 0: tabletmanagerservice.TabletManager.Ping:input_type -> tabletmanagerdata.PingRequest @@ -547,81 +579,87 @@ var file_tabletmanagerservice_proto_depIdxs = []int32{ 28, // 28: tabletmanagerservice.TabletManager.GetReplicas:input_type -> tabletmanagerdata.GetReplicasRequest 29, // 29: tabletmanagerservice.TabletManager.CreateVReplicationWorkflow:input_type -> tabletmanagerdata.CreateVReplicationWorkflowRequest 30, // 30: tabletmanagerservice.TabletManager.DeleteVReplicationWorkflow:input_type -> tabletmanagerdata.DeleteVReplicationWorkflowRequest - 31, // 31: tabletmanagerservice.TabletManager.ReadVReplicationWorkflow:input_type -> tabletmanagerdata.ReadVReplicationWorkflowRequest - 32, // 32: tabletmanagerservice.TabletManager.VReplicationExec:input_type -> tabletmanagerdata.VReplicationExecRequest - 33, // 33: tabletmanagerservice.TabletManager.VReplicationWaitForPos:input_type -> tabletmanagerdata.VReplicationWaitForPosRequest - 34, // 34: tabletmanagerservice.TabletManager.UpdateVReplicationWorkflow:input_type -> tabletmanagerdata.UpdateVReplicationWorkflowRequest - 35, // 35: tabletmanagerservice.TabletManager.VDiff:input_type -> tabletmanagerdata.VDiffRequest - 36, // 36: tabletmanagerservice.TabletManager.ResetReplication:input_type -> tabletmanagerdata.ResetReplicationRequest - 37, // 37: tabletmanagerservice.TabletManager.InitPrimary:input_type -> tabletmanagerdata.InitPrimaryRequest - 38, // 38: tabletmanagerservice.TabletManager.PopulateReparentJournal:input_type -> tabletmanagerdata.PopulateReparentJournalRequest - 39, // 39: tabletmanagerservice.TabletManager.InitReplica:input_type -> tabletmanagerdata.InitReplicaRequest - 40, // 40: tabletmanagerservice.TabletManager.DemotePrimary:input_type -> tabletmanagerdata.DemotePrimaryRequest - 41, // 41: tabletmanagerservice.TabletManager.UndoDemotePrimary:input_type -> tabletmanagerdata.UndoDemotePrimaryRequest - 42, // 42: tabletmanagerservice.TabletManager.ReplicaWasPromoted:input_type -> tabletmanagerdata.ReplicaWasPromotedRequest - 43, // 43: tabletmanagerservice.TabletManager.ResetReplicationParameters:input_type -> tabletmanagerdata.ResetReplicationParametersRequest - 44, // 44: tabletmanagerservice.TabletManager.FullStatus:input_type -> tabletmanagerdata.FullStatusRequest - 45, // 45: tabletmanagerservice.TabletManager.SetReplicationSource:input_type -> tabletmanagerdata.SetReplicationSourceRequest - 46, // 46: tabletmanagerservice.TabletManager.ReplicaWasRestarted:input_type -> tabletmanagerdata.ReplicaWasRestartedRequest - 47, // 47: tabletmanagerservice.TabletManager.StopReplicationAndGetStatus:input_type -> tabletmanagerdata.StopReplicationAndGetStatusRequest - 48, // 48: tabletmanagerservice.TabletManager.PromoteReplica:input_type -> tabletmanagerdata.PromoteReplicaRequest - 49, // 49: tabletmanagerservice.TabletManager.Backup:input_type -> tabletmanagerdata.BackupRequest - 50, // 50: tabletmanagerservice.TabletManager.RestoreFromBackup:input_type -> tabletmanagerdata.RestoreFromBackupRequest - 51, // 51: tabletmanagerservice.TabletManager.CheckThrottler:input_type -> tabletmanagerdata.CheckThrottlerRequest - 52, // 52: tabletmanagerservice.TabletManager.Ping:output_type -> tabletmanagerdata.PingResponse - 53, // 53: tabletmanagerservice.TabletManager.Sleep:output_type -> tabletmanagerdata.SleepResponse - 54, // 54: tabletmanagerservice.TabletManager.ExecuteHook:output_type -> tabletmanagerdata.ExecuteHookResponse - 55, // 55: tabletmanagerservice.TabletManager.GetSchema:output_type -> tabletmanagerdata.GetSchemaResponse - 56, // 56: tabletmanagerservice.TabletManager.GetPermissions:output_type -> tabletmanagerdata.GetPermissionsResponse - 57, // 57: tabletmanagerservice.TabletManager.SetReadOnly:output_type -> tabletmanagerdata.SetReadOnlyResponse - 58, // 58: tabletmanagerservice.TabletManager.SetReadWrite:output_type -> tabletmanagerdata.SetReadWriteResponse - 59, // 59: tabletmanagerservice.TabletManager.ChangeType:output_type -> tabletmanagerdata.ChangeTypeResponse - 60, // 60: tabletmanagerservice.TabletManager.RefreshState:output_type -> tabletmanagerdata.RefreshStateResponse - 61, // 61: tabletmanagerservice.TabletManager.RunHealthCheck:output_type -> tabletmanagerdata.RunHealthCheckResponse - 62, // 62: tabletmanagerservice.TabletManager.ReloadSchema:output_type -> tabletmanagerdata.ReloadSchemaResponse - 63, // 63: tabletmanagerservice.TabletManager.PreflightSchema:output_type -> tabletmanagerdata.PreflightSchemaResponse - 64, // 64: tabletmanagerservice.TabletManager.ApplySchema:output_type -> tabletmanagerdata.ApplySchemaResponse - 65, // 65: tabletmanagerservice.TabletManager.ResetSequences:output_type -> tabletmanagerdata.ResetSequencesResponse - 66, // 66: tabletmanagerservice.TabletManager.LockTables:output_type -> tabletmanagerdata.LockTablesResponse - 67, // 67: tabletmanagerservice.TabletManager.UnlockTables:output_type -> tabletmanagerdata.UnlockTablesResponse - 68, // 68: tabletmanagerservice.TabletManager.ExecuteQuery:output_type -> tabletmanagerdata.ExecuteQueryResponse - 69, // 69: tabletmanagerservice.TabletManager.ExecuteFetchAsDba:output_type -> tabletmanagerdata.ExecuteFetchAsDbaResponse - 70, // 70: tabletmanagerservice.TabletManager.ExecuteFetchAsAllPrivs:output_type -> tabletmanagerdata.ExecuteFetchAsAllPrivsResponse - 71, // 71: tabletmanagerservice.TabletManager.ExecuteFetchAsApp:output_type -> tabletmanagerdata.ExecuteFetchAsAppResponse - 72, // 72: tabletmanagerservice.TabletManager.ReplicationStatus:output_type -> tabletmanagerdata.ReplicationStatusResponse - 73, // 73: tabletmanagerservice.TabletManager.PrimaryStatus:output_type -> tabletmanagerdata.PrimaryStatusResponse - 74, // 74: tabletmanagerservice.TabletManager.PrimaryPosition:output_type -> tabletmanagerdata.PrimaryPositionResponse - 75, // 75: tabletmanagerservice.TabletManager.WaitForPosition:output_type -> tabletmanagerdata.WaitForPositionResponse - 76, // 76: tabletmanagerservice.TabletManager.StopReplication:output_type -> tabletmanagerdata.StopReplicationResponse - 77, // 77: tabletmanagerservice.TabletManager.StopReplicationMinimum:output_type -> tabletmanagerdata.StopReplicationMinimumResponse - 78, // 78: tabletmanagerservice.TabletManager.StartReplication:output_type -> tabletmanagerdata.StartReplicationResponse - 79, // 79: tabletmanagerservice.TabletManager.StartReplicationUntilAfter:output_type -> tabletmanagerdata.StartReplicationUntilAfterResponse - 80, // 80: tabletmanagerservice.TabletManager.GetReplicas:output_type -> tabletmanagerdata.GetReplicasResponse - 81, // 81: tabletmanagerservice.TabletManager.CreateVReplicationWorkflow:output_type -> tabletmanagerdata.CreateVReplicationWorkflowResponse - 82, // 82: tabletmanagerservice.TabletManager.DeleteVReplicationWorkflow:output_type -> tabletmanagerdata.DeleteVReplicationWorkflowResponse - 83, // 83: tabletmanagerservice.TabletManager.ReadVReplicationWorkflow:output_type -> tabletmanagerdata.ReadVReplicationWorkflowResponse - 84, // 84: tabletmanagerservice.TabletManager.VReplicationExec:output_type -> tabletmanagerdata.VReplicationExecResponse - 85, // 85: tabletmanagerservice.TabletManager.VReplicationWaitForPos:output_type -> tabletmanagerdata.VReplicationWaitForPosResponse - 86, // 86: tabletmanagerservice.TabletManager.UpdateVReplicationWorkflow:output_type -> tabletmanagerdata.UpdateVReplicationWorkflowResponse - 87, // 87: tabletmanagerservice.TabletManager.VDiff:output_type -> tabletmanagerdata.VDiffResponse - 88, // 88: tabletmanagerservice.TabletManager.ResetReplication:output_type -> tabletmanagerdata.ResetReplicationResponse - 89, // 89: tabletmanagerservice.TabletManager.InitPrimary:output_type -> tabletmanagerdata.InitPrimaryResponse - 90, // 90: tabletmanagerservice.TabletManager.PopulateReparentJournal:output_type -> tabletmanagerdata.PopulateReparentJournalResponse - 91, // 91: tabletmanagerservice.TabletManager.InitReplica:output_type -> tabletmanagerdata.InitReplicaResponse - 92, // 92: tabletmanagerservice.TabletManager.DemotePrimary:output_type -> tabletmanagerdata.DemotePrimaryResponse - 93, // 93: tabletmanagerservice.TabletManager.UndoDemotePrimary:output_type -> tabletmanagerdata.UndoDemotePrimaryResponse - 94, // 94: tabletmanagerservice.TabletManager.ReplicaWasPromoted:output_type -> tabletmanagerdata.ReplicaWasPromotedResponse - 95, // 95: tabletmanagerservice.TabletManager.ResetReplicationParameters:output_type -> tabletmanagerdata.ResetReplicationParametersResponse - 96, // 96: tabletmanagerservice.TabletManager.FullStatus:output_type -> tabletmanagerdata.FullStatusResponse - 97, // 97: tabletmanagerservice.TabletManager.SetReplicationSource:output_type -> tabletmanagerdata.SetReplicationSourceResponse - 98, // 98: tabletmanagerservice.TabletManager.ReplicaWasRestarted:output_type -> tabletmanagerdata.ReplicaWasRestartedResponse - 99, // 99: tabletmanagerservice.TabletManager.StopReplicationAndGetStatus:output_type -> tabletmanagerdata.StopReplicationAndGetStatusResponse - 100, // 100: tabletmanagerservice.TabletManager.PromoteReplica:output_type -> tabletmanagerdata.PromoteReplicaResponse - 101, // 101: tabletmanagerservice.TabletManager.Backup:output_type -> tabletmanagerdata.BackupResponse - 102, // 102: tabletmanagerservice.TabletManager.RestoreFromBackup:output_type -> tabletmanagerdata.RestoreFromBackupResponse - 103, // 103: tabletmanagerservice.TabletManager.CheckThrottler:output_type -> tabletmanagerdata.CheckThrottlerResponse - 52, // [52:104] is the sub-list for method output_type - 0, // [0:52] is the sub-list for method input_type + 31, // 31: tabletmanagerservice.TabletManager.HasVReplicationWorkflows:input_type -> tabletmanagerdata.HasVReplicationWorkflowsRequest + 32, // 32: tabletmanagerservice.TabletManager.ReadVReplicationWorkflow:input_type -> tabletmanagerdata.ReadVReplicationWorkflowRequest + 33, // 33: tabletmanagerservice.TabletManager.ReadVReplicationWorkflows:input_type -> tabletmanagerdata.ReadVReplicationWorkflowsRequest + 34, // 34: tabletmanagerservice.TabletManager.VReplicationExec:input_type -> tabletmanagerdata.VReplicationExecRequest + 35, // 35: tabletmanagerservice.TabletManager.VReplicationWaitForPos:input_type -> tabletmanagerdata.VReplicationWaitForPosRequest + 36, // 36: tabletmanagerservice.TabletManager.UpdateVReplicationWorkflow:input_type -> tabletmanagerdata.UpdateVReplicationWorkflowRequest + 37, // 37: tabletmanagerservice.TabletManager.UpdateVReplicationWorkflows:input_type -> tabletmanagerdata.UpdateVReplicationWorkflowsRequest + 38, // 38: tabletmanagerservice.TabletManager.VDiff:input_type -> tabletmanagerdata.VDiffRequest + 39, // 39: tabletmanagerservice.TabletManager.ResetReplication:input_type -> tabletmanagerdata.ResetReplicationRequest + 40, // 40: tabletmanagerservice.TabletManager.InitPrimary:input_type -> tabletmanagerdata.InitPrimaryRequest + 41, // 41: tabletmanagerservice.TabletManager.PopulateReparentJournal:input_type -> tabletmanagerdata.PopulateReparentJournalRequest + 42, // 42: tabletmanagerservice.TabletManager.InitReplica:input_type -> tabletmanagerdata.InitReplicaRequest + 43, // 43: tabletmanagerservice.TabletManager.DemotePrimary:input_type -> tabletmanagerdata.DemotePrimaryRequest + 44, // 44: tabletmanagerservice.TabletManager.UndoDemotePrimary:input_type -> tabletmanagerdata.UndoDemotePrimaryRequest + 45, // 45: tabletmanagerservice.TabletManager.ReplicaWasPromoted:input_type -> tabletmanagerdata.ReplicaWasPromotedRequest + 46, // 46: tabletmanagerservice.TabletManager.ResetReplicationParameters:input_type -> tabletmanagerdata.ResetReplicationParametersRequest + 47, // 47: tabletmanagerservice.TabletManager.FullStatus:input_type -> tabletmanagerdata.FullStatusRequest + 48, // 48: tabletmanagerservice.TabletManager.SetReplicationSource:input_type -> tabletmanagerdata.SetReplicationSourceRequest + 49, // 49: tabletmanagerservice.TabletManager.ReplicaWasRestarted:input_type -> tabletmanagerdata.ReplicaWasRestartedRequest + 50, // 50: tabletmanagerservice.TabletManager.StopReplicationAndGetStatus:input_type -> tabletmanagerdata.StopReplicationAndGetStatusRequest + 51, // 51: tabletmanagerservice.TabletManager.PromoteReplica:input_type -> tabletmanagerdata.PromoteReplicaRequest + 52, // 52: tabletmanagerservice.TabletManager.Backup:input_type -> tabletmanagerdata.BackupRequest + 53, // 53: tabletmanagerservice.TabletManager.RestoreFromBackup:input_type -> tabletmanagerdata.RestoreFromBackupRequest + 54, // 54: tabletmanagerservice.TabletManager.CheckThrottler:input_type -> tabletmanagerdata.CheckThrottlerRequest + 55, // 55: tabletmanagerservice.TabletManager.Ping:output_type -> tabletmanagerdata.PingResponse + 56, // 56: tabletmanagerservice.TabletManager.Sleep:output_type -> tabletmanagerdata.SleepResponse + 57, // 57: tabletmanagerservice.TabletManager.ExecuteHook:output_type -> tabletmanagerdata.ExecuteHookResponse + 58, // 58: tabletmanagerservice.TabletManager.GetSchema:output_type -> tabletmanagerdata.GetSchemaResponse + 59, // 59: tabletmanagerservice.TabletManager.GetPermissions:output_type -> tabletmanagerdata.GetPermissionsResponse + 60, // 60: tabletmanagerservice.TabletManager.SetReadOnly:output_type -> tabletmanagerdata.SetReadOnlyResponse + 61, // 61: tabletmanagerservice.TabletManager.SetReadWrite:output_type -> tabletmanagerdata.SetReadWriteResponse + 62, // 62: tabletmanagerservice.TabletManager.ChangeType:output_type -> tabletmanagerdata.ChangeTypeResponse + 63, // 63: tabletmanagerservice.TabletManager.RefreshState:output_type -> tabletmanagerdata.RefreshStateResponse + 64, // 64: tabletmanagerservice.TabletManager.RunHealthCheck:output_type -> tabletmanagerdata.RunHealthCheckResponse + 65, // 65: tabletmanagerservice.TabletManager.ReloadSchema:output_type -> tabletmanagerdata.ReloadSchemaResponse + 66, // 66: tabletmanagerservice.TabletManager.PreflightSchema:output_type -> tabletmanagerdata.PreflightSchemaResponse + 67, // 67: tabletmanagerservice.TabletManager.ApplySchema:output_type -> tabletmanagerdata.ApplySchemaResponse + 68, // 68: tabletmanagerservice.TabletManager.ResetSequences:output_type -> tabletmanagerdata.ResetSequencesResponse + 69, // 69: tabletmanagerservice.TabletManager.LockTables:output_type -> tabletmanagerdata.LockTablesResponse + 70, // 70: tabletmanagerservice.TabletManager.UnlockTables:output_type -> tabletmanagerdata.UnlockTablesResponse + 71, // 71: tabletmanagerservice.TabletManager.ExecuteQuery:output_type -> tabletmanagerdata.ExecuteQueryResponse + 72, // 72: tabletmanagerservice.TabletManager.ExecuteFetchAsDba:output_type -> tabletmanagerdata.ExecuteFetchAsDbaResponse + 73, // 73: tabletmanagerservice.TabletManager.ExecuteFetchAsAllPrivs:output_type -> tabletmanagerdata.ExecuteFetchAsAllPrivsResponse + 74, // 74: tabletmanagerservice.TabletManager.ExecuteFetchAsApp:output_type -> tabletmanagerdata.ExecuteFetchAsAppResponse + 75, // 75: tabletmanagerservice.TabletManager.ReplicationStatus:output_type -> tabletmanagerdata.ReplicationStatusResponse + 76, // 76: tabletmanagerservice.TabletManager.PrimaryStatus:output_type -> tabletmanagerdata.PrimaryStatusResponse + 77, // 77: tabletmanagerservice.TabletManager.PrimaryPosition:output_type -> tabletmanagerdata.PrimaryPositionResponse + 78, // 78: tabletmanagerservice.TabletManager.WaitForPosition:output_type -> tabletmanagerdata.WaitForPositionResponse + 79, // 79: tabletmanagerservice.TabletManager.StopReplication:output_type -> tabletmanagerdata.StopReplicationResponse + 80, // 80: tabletmanagerservice.TabletManager.StopReplicationMinimum:output_type -> tabletmanagerdata.StopReplicationMinimumResponse + 81, // 81: tabletmanagerservice.TabletManager.StartReplication:output_type -> tabletmanagerdata.StartReplicationResponse + 82, // 82: tabletmanagerservice.TabletManager.StartReplicationUntilAfter:output_type -> tabletmanagerdata.StartReplicationUntilAfterResponse + 83, // 83: tabletmanagerservice.TabletManager.GetReplicas:output_type -> tabletmanagerdata.GetReplicasResponse + 84, // 84: tabletmanagerservice.TabletManager.CreateVReplicationWorkflow:output_type -> tabletmanagerdata.CreateVReplicationWorkflowResponse + 85, // 85: tabletmanagerservice.TabletManager.DeleteVReplicationWorkflow:output_type -> tabletmanagerdata.DeleteVReplicationWorkflowResponse + 86, // 86: tabletmanagerservice.TabletManager.HasVReplicationWorkflows:output_type -> tabletmanagerdata.HasVReplicationWorkflowsResponse + 87, // 87: tabletmanagerservice.TabletManager.ReadVReplicationWorkflow:output_type -> tabletmanagerdata.ReadVReplicationWorkflowResponse + 88, // 88: tabletmanagerservice.TabletManager.ReadVReplicationWorkflows:output_type -> tabletmanagerdata.ReadVReplicationWorkflowsResponse + 89, // 89: tabletmanagerservice.TabletManager.VReplicationExec:output_type -> tabletmanagerdata.VReplicationExecResponse + 90, // 90: tabletmanagerservice.TabletManager.VReplicationWaitForPos:output_type -> tabletmanagerdata.VReplicationWaitForPosResponse + 91, // 91: tabletmanagerservice.TabletManager.UpdateVReplicationWorkflow:output_type -> tabletmanagerdata.UpdateVReplicationWorkflowResponse + 92, // 92: tabletmanagerservice.TabletManager.UpdateVReplicationWorkflows:output_type -> tabletmanagerdata.UpdateVReplicationWorkflowsResponse + 93, // 93: tabletmanagerservice.TabletManager.VDiff:output_type -> tabletmanagerdata.VDiffResponse + 94, // 94: tabletmanagerservice.TabletManager.ResetReplication:output_type -> tabletmanagerdata.ResetReplicationResponse + 95, // 95: tabletmanagerservice.TabletManager.InitPrimary:output_type -> tabletmanagerdata.InitPrimaryResponse + 96, // 96: tabletmanagerservice.TabletManager.PopulateReparentJournal:output_type -> tabletmanagerdata.PopulateReparentJournalResponse + 97, // 97: tabletmanagerservice.TabletManager.InitReplica:output_type -> tabletmanagerdata.InitReplicaResponse + 98, // 98: tabletmanagerservice.TabletManager.DemotePrimary:output_type -> tabletmanagerdata.DemotePrimaryResponse + 99, // 99: tabletmanagerservice.TabletManager.UndoDemotePrimary:output_type -> tabletmanagerdata.UndoDemotePrimaryResponse + 100, // 100: tabletmanagerservice.TabletManager.ReplicaWasPromoted:output_type -> tabletmanagerdata.ReplicaWasPromotedResponse + 101, // 101: tabletmanagerservice.TabletManager.ResetReplicationParameters:output_type -> tabletmanagerdata.ResetReplicationParametersResponse + 102, // 102: tabletmanagerservice.TabletManager.FullStatus:output_type -> tabletmanagerdata.FullStatusResponse + 103, // 103: tabletmanagerservice.TabletManager.SetReplicationSource:output_type -> tabletmanagerdata.SetReplicationSourceResponse + 104, // 104: tabletmanagerservice.TabletManager.ReplicaWasRestarted:output_type -> tabletmanagerdata.ReplicaWasRestartedResponse + 105, // 105: tabletmanagerservice.TabletManager.StopReplicationAndGetStatus:output_type -> tabletmanagerdata.StopReplicationAndGetStatusResponse + 106, // 106: tabletmanagerservice.TabletManager.PromoteReplica:output_type -> tabletmanagerdata.PromoteReplicaResponse + 107, // 107: tabletmanagerservice.TabletManager.Backup:output_type -> tabletmanagerdata.BackupResponse + 108, // 108: tabletmanagerservice.TabletManager.RestoreFromBackup:output_type -> tabletmanagerdata.RestoreFromBackupResponse + 109, // 109: tabletmanagerservice.TabletManager.CheckThrottler:output_type -> tabletmanagerdata.CheckThrottlerResponse + 55, // [55:110] is the sub-list for method output_type + 0, // [0:55] 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/tabletmanagerservice/tabletmanagerservice_grpc.pb.go b/go/vt/proto/tabletmanagerservice/tabletmanagerservice_grpc.pb.go index f0665947007..8319eec908a 100644 --- a/go/vt/proto/tabletmanagerservice/tabletmanagerservice_grpc.pb.go +++ b/go/vt/proto/tabletmanagerservice/tabletmanagerservice_grpc.pb.go @@ -72,10 +72,13 @@ type TabletManagerClient interface { // VReplication API CreateVReplicationWorkflow(ctx context.Context, in *tabletmanagerdata.CreateVReplicationWorkflowRequest, opts ...grpc.CallOption) (*tabletmanagerdata.CreateVReplicationWorkflowResponse, error) DeleteVReplicationWorkflow(ctx context.Context, in *tabletmanagerdata.DeleteVReplicationWorkflowRequest, opts ...grpc.CallOption) (*tabletmanagerdata.DeleteVReplicationWorkflowResponse, error) + HasVReplicationWorkflows(ctx context.Context, in *tabletmanagerdata.HasVReplicationWorkflowsRequest, opts ...grpc.CallOption) (*tabletmanagerdata.HasVReplicationWorkflowsResponse, error) ReadVReplicationWorkflow(ctx context.Context, in *tabletmanagerdata.ReadVReplicationWorkflowRequest, opts ...grpc.CallOption) (*tabletmanagerdata.ReadVReplicationWorkflowResponse, error) + ReadVReplicationWorkflows(ctx context.Context, in *tabletmanagerdata.ReadVReplicationWorkflowsRequest, opts ...grpc.CallOption) (*tabletmanagerdata.ReadVReplicationWorkflowsResponse, error) VReplicationExec(ctx context.Context, in *tabletmanagerdata.VReplicationExecRequest, opts ...grpc.CallOption) (*tabletmanagerdata.VReplicationExecResponse, error) VReplicationWaitForPos(ctx context.Context, in *tabletmanagerdata.VReplicationWaitForPosRequest, opts ...grpc.CallOption) (*tabletmanagerdata.VReplicationWaitForPosResponse, error) UpdateVReplicationWorkflow(ctx context.Context, in *tabletmanagerdata.UpdateVReplicationWorkflowRequest, opts ...grpc.CallOption) (*tabletmanagerdata.UpdateVReplicationWorkflowResponse, error) + UpdateVReplicationWorkflows(ctx context.Context, in *tabletmanagerdata.UpdateVReplicationWorkflowsRequest, opts ...grpc.CallOption) (*tabletmanagerdata.UpdateVReplicationWorkflowsResponse, error) // VDiff API VDiff(ctx context.Context, in *tabletmanagerdata.VDiffRequest, opts ...grpc.CallOption) (*tabletmanagerdata.VDiffResponse, error) // ResetReplication makes the target not replicating @@ -400,6 +403,15 @@ func (c *tabletManagerClient) DeleteVReplicationWorkflow(ctx context.Context, in return out, nil } +func (c *tabletManagerClient) HasVReplicationWorkflows(ctx context.Context, in *tabletmanagerdata.HasVReplicationWorkflowsRequest, opts ...grpc.CallOption) (*tabletmanagerdata.HasVReplicationWorkflowsResponse, error) { + out := new(tabletmanagerdata.HasVReplicationWorkflowsResponse) + err := c.cc.Invoke(ctx, "/tabletmanagerservice.TabletManager/HasVReplicationWorkflows", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *tabletManagerClient) ReadVReplicationWorkflow(ctx context.Context, in *tabletmanagerdata.ReadVReplicationWorkflowRequest, opts ...grpc.CallOption) (*tabletmanagerdata.ReadVReplicationWorkflowResponse, error) { out := new(tabletmanagerdata.ReadVReplicationWorkflowResponse) err := c.cc.Invoke(ctx, "/tabletmanagerservice.TabletManager/ReadVReplicationWorkflow", in, out, opts...) @@ -409,6 +421,15 @@ func (c *tabletManagerClient) ReadVReplicationWorkflow(ctx context.Context, in * return out, nil } +func (c *tabletManagerClient) ReadVReplicationWorkflows(ctx context.Context, in *tabletmanagerdata.ReadVReplicationWorkflowsRequest, opts ...grpc.CallOption) (*tabletmanagerdata.ReadVReplicationWorkflowsResponse, error) { + out := new(tabletmanagerdata.ReadVReplicationWorkflowsResponse) + err := c.cc.Invoke(ctx, "/tabletmanagerservice.TabletManager/ReadVReplicationWorkflows", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *tabletManagerClient) VReplicationExec(ctx context.Context, in *tabletmanagerdata.VReplicationExecRequest, opts ...grpc.CallOption) (*tabletmanagerdata.VReplicationExecResponse, error) { out := new(tabletmanagerdata.VReplicationExecResponse) err := c.cc.Invoke(ctx, "/tabletmanagerservice.TabletManager/VReplicationExec", in, out, opts...) @@ -436,6 +457,15 @@ func (c *tabletManagerClient) UpdateVReplicationWorkflow(ctx context.Context, in return out, nil } +func (c *tabletManagerClient) UpdateVReplicationWorkflows(ctx context.Context, in *tabletmanagerdata.UpdateVReplicationWorkflowsRequest, opts ...grpc.CallOption) (*tabletmanagerdata.UpdateVReplicationWorkflowsResponse, error) { + out := new(tabletmanagerdata.UpdateVReplicationWorkflowsResponse) + err := c.cc.Invoke(ctx, "/tabletmanagerservice.TabletManager/UpdateVReplicationWorkflows", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *tabletManagerClient) VDiff(ctx context.Context, in *tabletmanagerdata.VDiffRequest, opts ...grpc.CallOption) (*tabletmanagerdata.VDiffResponse, error) { out := new(tabletmanagerdata.VDiffResponse) err := c.cc.Invoke(ctx, "/tabletmanagerservice.TabletManager/VDiff", in, out, opts...) @@ -688,10 +718,13 @@ type TabletManagerServer interface { // VReplication API CreateVReplicationWorkflow(context.Context, *tabletmanagerdata.CreateVReplicationWorkflowRequest) (*tabletmanagerdata.CreateVReplicationWorkflowResponse, error) DeleteVReplicationWorkflow(context.Context, *tabletmanagerdata.DeleteVReplicationWorkflowRequest) (*tabletmanagerdata.DeleteVReplicationWorkflowResponse, error) + HasVReplicationWorkflows(context.Context, *tabletmanagerdata.HasVReplicationWorkflowsRequest) (*tabletmanagerdata.HasVReplicationWorkflowsResponse, error) ReadVReplicationWorkflow(context.Context, *tabletmanagerdata.ReadVReplicationWorkflowRequest) (*tabletmanagerdata.ReadVReplicationWorkflowResponse, error) + ReadVReplicationWorkflows(context.Context, *tabletmanagerdata.ReadVReplicationWorkflowsRequest) (*tabletmanagerdata.ReadVReplicationWorkflowsResponse, error) VReplicationExec(context.Context, *tabletmanagerdata.VReplicationExecRequest) (*tabletmanagerdata.VReplicationExecResponse, error) VReplicationWaitForPos(context.Context, *tabletmanagerdata.VReplicationWaitForPosRequest) (*tabletmanagerdata.VReplicationWaitForPosResponse, error) UpdateVReplicationWorkflow(context.Context, *tabletmanagerdata.UpdateVReplicationWorkflowRequest) (*tabletmanagerdata.UpdateVReplicationWorkflowResponse, error) + UpdateVReplicationWorkflows(context.Context, *tabletmanagerdata.UpdateVReplicationWorkflowsRequest) (*tabletmanagerdata.UpdateVReplicationWorkflowsResponse, error) // VDiff API VDiff(context.Context, *tabletmanagerdata.VDiffRequest) (*tabletmanagerdata.VDiffResponse, error) // ResetReplication makes the target not replicating @@ -827,9 +860,15 @@ func (UnimplementedTabletManagerServer) CreateVReplicationWorkflow(context.Conte func (UnimplementedTabletManagerServer) DeleteVReplicationWorkflow(context.Context, *tabletmanagerdata.DeleteVReplicationWorkflowRequest) (*tabletmanagerdata.DeleteVReplicationWorkflowResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteVReplicationWorkflow not implemented") } +func (UnimplementedTabletManagerServer) HasVReplicationWorkflows(context.Context, *tabletmanagerdata.HasVReplicationWorkflowsRequest) (*tabletmanagerdata.HasVReplicationWorkflowsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method HasVReplicationWorkflows not implemented") +} func (UnimplementedTabletManagerServer) ReadVReplicationWorkflow(context.Context, *tabletmanagerdata.ReadVReplicationWorkflowRequest) (*tabletmanagerdata.ReadVReplicationWorkflowResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ReadVReplicationWorkflow not implemented") } +func (UnimplementedTabletManagerServer) ReadVReplicationWorkflows(context.Context, *tabletmanagerdata.ReadVReplicationWorkflowsRequest) (*tabletmanagerdata.ReadVReplicationWorkflowsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReadVReplicationWorkflows not implemented") +} func (UnimplementedTabletManagerServer) VReplicationExec(context.Context, *tabletmanagerdata.VReplicationExecRequest) (*tabletmanagerdata.VReplicationExecResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method VReplicationExec not implemented") } @@ -839,6 +878,9 @@ func (UnimplementedTabletManagerServer) VReplicationWaitForPos(context.Context, func (UnimplementedTabletManagerServer) UpdateVReplicationWorkflow(context.Context, *tabletmanagerdata.UpdateVReplicationWorkflowRequest) (*tabletmanagerdata.UpdateVReplicationWorkflowResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateVReplicationWorkflow not implemented") } +func (UnimplementedTabletManagerServer) UpdateVReplicationWorkflows(context.Context, *tabletmanagerdata.UpdateVReplicationWorkflowsRequest) (*tabletmanagerdata.UpdateVReplicationWorkflowsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateVReplicationWorkflows not implemented") +} func (UnimplementedTabletManagerServer) VDiff(context.Context, *tabletmanagerdata.VDiffRequest) (*tabletmanagerdata.VDiffResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method VDiff not implemented") } @@ -1461,6 +1503,24 @@ func _TabletManager_DeleteVReplicationWorkflow_Handler(srv interface{}, ctx cont return interceptor(ctx, in, info, handler) } +func _TabletManager_HasVReplicationWorkflows_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(tabletmanagerdata.HasVReplicationWorkflowsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TabletManagerServer).HasVReplicationWorkflows(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tabletmanagerservice.TabletManager/HasVReplicationWorkflows", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TabletManagerServer).HasVReplicationWorkflows(ctx, req.(*tabletmanagerdata.HasVReplicationWorkflowsRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _TabletManager_ReadVReplicationWorkflow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(tabletmanagerdata.ReadVReplicationWorkflowRequest) if err := dec(in); err != nil { @@ -1479,6 +1539,24 @@ func _TabletManager_ReadVReplicationWorkflow_Handler(srv interface{}, ctx contex return interceptor(ctx, in, info, handler) } +func _TabletManager_ReadVReplicationWorkflows_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(tabletmanagerdata.ReadVReplicationWorkflowsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TabletManagerServer).ReadVReplicationWorkflows(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tabletmanagerservice.TabletManager/ReadVReplicationWorkflows", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TabletManagerServer).ReadVReplicationWorkflows(ctx, req.(*tabletmanagerdata.ReadVReplicationWorkflowsRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _TabletManager_VReplicationExec_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(tabletmanagerdata.VReplicationExecRequest) if err := dec(in); err != nil { @@ -1533,6 +1611,24 @@ func _TabletManager_UpdateVReplicationWorkflow_Handler(srv interface{}, ctx cont return interceptor(ctx, in, info, handler) } +func _TabletManager_UpdateVReplicationWorkflows_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(tabletmanagerdata.UpdateVReplicationWorkflowsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TabletManagerServer).UpdateVReplicationWorkflows(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tabletmanagerservice.TabletManager/UpdateVReplicationWorkflows", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TabletManagerServer).UpdateVReplicationWorkflows(ctx, req.(*tabletmanagerdata.UpdateVReplicationWorkflowsRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _TabletManager_VDiff_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(tabletmanagerdata.VDiffRequest) if err := dec(in); err != nil { @@ -1976,10 +2072,18 @@ var TabletManager_ServiceDesc = grpc.ServiceDesc{ MethodName: "DeleteVReplicationWorkflow", Handler: _TabletManager_DeleteVReplicationWorkflow_Handler, }, + { + MethodName: "HasVReplicationWorkflows", + Handler: _TabletManager_HasVReplicationWorkflows_Handler, + }, { MethodName: "ReadVReplicationWorkflow", Handler: _TabletManager_ReadVReplicationWorkflow_Handler, }, + { + MethodName: "ReadVReplicationWorkflows", + Handler: _TabletManager_ReadVReplicationWorkflows_Handler, + }, { MethodName: "VReplicationExec", Handler: _TabletManager_VReplicationExec_Handler, @@ -1992,6 +2096,10 @@ var TabletManager_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdateVReplicationWorkflow", Handler: _TabletManager_UpdateVReplicationWorkflow_Handler, }, + { + MethodName: "UpdateVReplicationWorkflows", + Handler: _TabletManager_UpdateVReplicationWorkflows_Handler, + }, { MethodName: "VDiff", Handler: _TabletManager_VDiff_Handler, diff --git a/go/vt/vtcombo/tablet_map.go b/go/vt/vtcombo/tablet_map.go index 25cc28d366d..a510c5889a4 100644 --- a/go/vt/vtcombo/tablet_map.go +++ b/go/vt/vtcombo/tablet_map.go @@ -873,6 +873,14 @@ func (itmc *internalTabletManagerClient) DeleteVReplicationWorkflow(context.Cont return nil, fmt.Errorf("not implemented in vtcombo") } +func (itmc *internalTabletManagerClient) HasVReplicationWorkflows(context.Context, *topodatapb.Tablet, *tabletmanagerdatapb.HasVReplicationWorkflowsRequest) (*tabletmanagerdatapb.HasVReplicationWorkflowsResponse, error) { + return nil, fmt.Errorf("not implemented in vtcombo") +} + +func (itmc *internalTabletManagerClient) ReadVReplicationWorkflows(context.Context, *topodatapb.Tablet, *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowsResponse, error) { + return nil, fmt.Errorf("not implemented in vtcombo") +} + func (itmc *internalTabletManagerClient) ReadVReplicationWorkflow(context.Context, *topodatapb.Tablet, *tabletmanagerdatapb.ReadVReplicationWorkflowRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowResponse, error) { return nil, fmt.Errorf("not implemented in vtcombo") } @@ -889,6 +897,10 @@ func (itmc *internalTabletManagerClient) UpdateVReplicationWorkflow(context.Cont return nil, fmt.Errorf("not implemented in vtcombo") } +func (itmc *internalTabletManagerClient) UpdateVReplicationWorkflows(context.Context, *topodatapb.Tablet, *tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsResponse, error) { + return nil, fmt.Errorf("not implemented in vtcombo") +} + func (itmc *internalTabletManagerClient) ResetReplication(context.Context, *topodatapb.Tablet) error { return fmt.Errorf("not implemented in vtcombo") } diff --git a/go/vt/vtctl/workflow/materializer.go b/go/vt/vtctl/workflow/materializer.go index 4812953f507..d4d3efa55e6 100644 --- a/go/vt/vtctl/workflow/materializer.go +++ b/go/vt/vtctl/workflow/materializer.go @@ -21,10 +21,10 @@ import ( "fmt" "strings" "sync" - "text/template" "time" "vitess.io/vitess/go/sqltypes" + "vitess.io/vitess/go/textutil" "vitess.io/vitess/go/vt/concurrency" "vitess.io/vitess/go/vt/key" "vitess.io/vitess/go/vt/log" @@ -41,6 +41,7 @@ import ( binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata" tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" + topodatapb "vitess.io/vitess/go/vt/proto/topodata" vschemapb "vitess.io/vitess/go/vt/proto/vschema" vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata" ) @@ -68,6 +69,19 @@ type materializer struct { env *vtenv.Environment } +func (mz *materializer) getWorkflowType() binlogdatapb.VReplicationWorkflowType { + var workflowType binlogdatapb.VReplicationWorkflowType + switch mz.ms.MaterializationIntent { + case vtctldatapb.MaterializationIntent_CUSTOM: + workflowType = binlogdatapb.VReplicationWorkflowType_Materialize + case vtctldatapb.MaterializationIntent_MOVETABLES: + workflowType = binlogdatapb.VReplicationWorkflowType_MoveTables + case vtctldatapb.MaterializationIntent_CREATELOOKUPINDEX: + workflowType = binlogdatapb.VReplicationWorkflowType_CreateLookupIndex + } + return workflowType +} + func (mz *materializer) getWorkflowSubType() (binlogdatapb.VReplicationWorkflowSubType, error) { switch { case mz.isPartial && mz.ms.AtomicCopy: @@ -82,7 +96,7 @@ func (mz *materializer) getWorkflowSubType() (binlogdatapb.VReplicationWorkflowS } } -func (mz *materializer) createMoveTablesStreams(req *vtctldatapb.MoveTablesCreateRequest) error { +func (mz *materializer) createWorkflowStreams(req *tabletmanagerdatapb.CreateVReplicationWorkflowRequest) error { if err := validateNewWorkflow(mz.ctx, mz.ts, mz.tmc, mz.ms.TargetKeyspace, mz.ms.Workflow); err != nil { return err } @@ -99,6 +113,7 @@ func (mz *materializer) createMoveTablesStreams(req *vtctldatapb.MoveTablesCreat if err != nil { return err } + req.WorkflowSubType = workflowSubType return mz.forAllTargets(func(target *topo.ShardInfo) error { targetPrimary, err := mz.ts.GetTablet(mz.ctx, target.PrimaryAlias) @@ -117,162 +132,17 @@ func (mz *materializer) createMoveTablesStreams(req *vtctldatapb.MoveTablesCreat if len(sourceShards) == 1 && key.KeyRangeEqual(sourceShards[0].KeyRange, target.KeyRange) { streamKeyRangesEqual = true } - blses, err := mz.generateBinlogSources(mz.ctx, target, sourceShards, streamKeyRangesEqual) + // Each tablet needs its own copy of the request as it will have a unique + // BinlogSource. + tabletReq := req.CloneVT() + tabletReq.BinlogSource, err = mz.generateBinlogSources(mz.ctx, target, sourceShards, streamKeyRangesEqual) if err != nil { return err } - _, err = mz.tmc.CreateVReplicationWorkflow(mz.ctx, targetPrimary.Tablet, &tabletmanagerdatapb.CreateVReplicationWorkflowRequest{ - Workflow: req.Workflow, - BinlogSource: blses, - Cells: req.Cells, - TabletTypes: req.TabletTypes, - TabletSelectionPreference: req.TabletSelectionPreference, - WorkflowType: mz.workflowType, - WorkflowSubType: workflowSubType, - DeferSecondaryKeys: req.DeferSecondaryKeys, - AutoStart: req.AutoStart, - StopAfterCopy: req.StopAfterCopy, - }) - return err - }) -} -// createMaterializerStreams creates the vreplication streams for Materialize -// and LookupVindex workflows. -func (mz *materializer) createMaterializerStreams() error { - if err := validateNewWorkflow(mz.ctx, mz.ts, mz.tmc, mz.ms.TargetKeyspace, mz.ms.Workflow); err != nil { + _, err = mz.tmc.CreateVReplicationWorkflow(mz.ctx, targetPrimary.Tablet, tabletReq) return err - } - err := mz.buildMaterializer() - if err != nil { - return err - } - if err := mz.deploySchema(); err != nil { - return err - } - insertMap := make(map[string]string, len(mz.targetShards)) - for _, targetShard := range mz.targetShards { - sourceShards := mz.filterSourceShards(targetShard) - // streamKeyRangesEqual allows us to optimize the stream for the cases - // where while the target keyspace may be sharded, the target shard has - // a single source shard to stream data from and the target and source - // shard have equal key ranges. This can be done, for example, when doing - // shard by shard migrations -- migrating a single shard at a time between - // sharded source and sharded target keyspaces. - streamKeyRangesEqual := false - if len(sourceShards) == 1 && key.KeyRangeEqual(sourceShards[0].KeyRange, targetShard.KeyRange) { - streamKeyRangesEqual = true - } - inserts, err := mz.generateInserts(mz.ctx, sourceShards, streamKeyRangesEqual) - if err != nil { - return err - } - insertMap[key.KeyRangeString(targetShard.KeyRange)] = inserts - } - if err := mz.createStreams(mz.ctx, insertMap); err != nil { - return err - } - return nil -} - -func (mz *materializer) generateInserts(ctx context.Context, sourceShards []*topo.ShardInfo, keyRangesEqual bool) (string, error) { - ig := vreplication.NewInsertGenerator(binlogdatapb.VReplicationWorkflowState_Stopped, "{{.dbname}}") - - for _, sourceShard := range sourceShards { - bls := &binlogdatapb.BinlogSource{ - Keyspace: mz.ms.SourceKeyspace, - Shard: sourceShard.ShardName(), - Filter: &binlogdatapb.Filter{}, - StopAfterCopy: mz.ms.StopAfterCopy, - ExternalCluster: mz.ms.ExternalCluster, - SourceTimeZone: mz.ms.SourceTimeZone, - TargetTimeZone: mz.ms.TargetTimeZone, - OnDdl: binlogdatapb.OnDDLAction(binlogdatapb.OnDDLAction_value[mz.ms.OnDdl]), - } - for _, ts := range mz.ms.TableSettings { - rule := &binlogdatapb.Rule{ - Match: ts.TargetTable, - } - - if ts.SourceExpression == "" { - bls.Filter.Rules = append(bls.Filter.Rules, rule) - continue - } - - // Validate non-empty query. - stmt, err := mz.env.Parser().Parse(ts.SourceExpression) - if err != nil { - return "", err - } - sel, ok := stmt.(*sqlparser.Select) - if !ok { - return "", fmt.Errorf("unrecognized statement: %s", ts.SourceExpression) - } - filter := ts.SourceExpression - if !keyRangesEqual && mz.targetVSchema.Keyspace.Sharded && mz.targetVSchema.Tables[ts.TargetTable].Type != vindexes.TypeReference { - cv, err := vindexes.FindBestColVindex(mz.targetVSchema.Tables[ts.TargetTable]) - if err != nil { - return "", err - } - mappedCols := make([]*sqlparser.ColName, 0, len(cv.Columns)) - for _, col := range cv.Columns { - colName, err := matchColInSelect(col, sel) - if err != nil { - return "", err - } - mappedCols = append(mappedCols, colName) - } - subExprs := make(sqlparser.Exprs, 0, len(mappedCols)+2) - for _, mappedCol := range mappedCols { - subExprs = append(subExprs, mappedCol) - } - vindexName := fmt.Sprintf("%s.%s", mz.ms.TargetKeyspace, cv.Name) - subExprs = append(subExprs, sqlparser.NewStrLiteral(vindexName)) - subExprs = append(subExprs, sqlparser.NewStrLiteral("{{.keyrange}}")) - inKeyRange := &sqlparser.FuncExpr{ - Name: sqlparser.NewIdentifierCI("in_keyrange"), - Exprs: subExprs, - } - if sel.Where != nil { - sel.Where = &sqlparser.Where{ - Type: sqlparser.WhereClause, - Expr: &sqlparser.AndExpr{ - Left: inKeyRange, - Right: sel.Where.Expr, - }, - } - } else { - sel.Where = &sqlparser.Where{ - Type: sqlparser.WhereClause, - Expr: inKeyRange, - } - } - - filter = sqlparser.String(sel) - } - - rule.Filter = filter - - bls.Filter.Rules = append(bls.Filter.Rules, rule) - } - workflowSubType := binlogdatapb.VReplicationWorkflowSubType_None - if mz.isPartial { - workflowSubType = binlogdatapb.VReplicationWorkflowSubType_Partial - } - var workflowType binlogdatapb.VReplicationWorkflowType - switch mz.ms.MaterializationIntent { - case vtctldatapb.MaterializationIntent_CUSTOM: - workflowType = binlogdatapb.VReplicationWorkflowType_Materialize - case vtctldatapb.MaterializationIntent_MOVETABLES: - workflowType = binlogdatapb.VReplicationWorkflowType_MoveTables - case vtctldatapb.MaterializationIntent_CREATELOOKUPINDEX: - workflowType = binlogdatapb.VReplicationWorkflowType_CreateLookupIndex - } - ig.AddRow(mz.ms.Workflow, bls, "", mz.ms.Cell, mz.ms.TabletTypes, - workflowType, - workflowSubType, mz.ms.DeferSecondaryKeys) - } - return ig.String(), nil + }) } func (mz *materializer) generateBinlogSources(ctx context.Context, targetShard *topo.ShardInfo, sourceShards []*topo.ShardInfo, keyRangesEqual bool) ([]*binlogdatapb.BinlogSource, error) { @@ -564,39 +434,23 @@ func (mz *materializer) buildMaterializer() error { return nil } -func (mz *materializer) createStreams(ctx context.Context, insertsMap map[string]string) error { - return forAllShards(mz.targetShards, func(target *topo.ShardInfo) error { - keyRange := key.KeyRangeString(target.KeyRange) - inserts := insertsMap[keyRange] - targetPrimary, err := mz.ts.GetTablet(ctx, target.PrimaryAlias) - if err != nil { - return vterrors.Wrapf(err, "GetTablet(%v) failed", target.PrimaryAlias) - } - buf := &strings.Builder{} - t := template.Must(template.New("").Parse(inserts)) - input := map[string]string{ - "keyrange": keyRange, - "dbname": targetPrimary.DbName(), - } - if err := t.Execute(buf, input); err != nil { - return err - } - if _, err := mz.tmc.VReplicationExec(ctx, targetPrimary.Tablet, buf.String()); err != nil { - return err - } - return nil - }) -} - func (mz *materializer) startStreams(ctx context.Context) error { return forAllShards(mz.targetShards, func(target *topo.ShardInfo) error { targetPrimary, err := mz.ts.GetTablet(ctx, target.PrimaryAlias) if err != nil { return vterrors.Wrapf(err, "GetTablet(%v) failed", target.PrimaryAlias) } - query := fmt.Sprintf("update _vt.vreplication set state='Running' where db_name=%s and workflow=%s", encodeString(targetPrimary.DbName()), encodeString(mz.ms.Workflow)) - if _, err := mz.tmc.VReplicationExec(ctx, targetPrimary.Tablet, query); err != nil { - return vterrors.Wrapf(err, "VReplicationExec(%v, %s)", targetPrimary.Tablet, query) + if _, err := mz.tmc.UpdateVReplicationWorkflow(ctx, targetPrimary.Tablet, &tabletmanagerdatapb.UpdateVReplicationWorkflowRequest{ + Workflow: mz.ms.Workflow, + State: binlogdatapb.VReplicationWorkflowState_Running, + // Don't change anything else, so pass simulated NULLs. + Cells: textutil.SimulatedNullStringSlice, + TabletTypes: []topodatapb.TabletType{ + topodatapb.TabletType(textutil.SimulatedNullInt), + }, + OnDdl: binlogdatapb.OnDDLAction(textutil.SimulatedNullInt), + }); err != nil { + return vterrors.Wrap(err, "failed to update workflow") } return nil }) diff --git a/go/vt/vtctl/workflow/materializer_env_test.go b/go/vt/vtctl/workflow/materializer_env_test.go index 452c5755a10..e841be49f0e 100644 --- a/go/vt/vtctl/workflow/materializer_env_test.go +++ b/go/vt/vtctl/workflow/materializer_env_test.go @@ -21,13 +21,14 @@ import ( "fmt" "os" "regexp" - "strconv" "strings" "sync" "testing" + "time" "google.golang.org/protobuf/proto" + "vitess.io/vitess/go/protoutil" "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/vt/mysqlctl/tmutils" "vitess.io/vitess/go/vt/topo" @@ -116,22 +117,9 @@ func newTestMaterializerEnv(t *testing.T, ctx context.Context, ms *vtctldatapb.M }}, } } - if ms.Workflow != "" { - env.expectValidation() - } return env } -func (env *testMaterializerEnv) expectValidation() { - for _, tablet := range env.tablets { - tabletID := int(tablet.Alias.Uid) - if tabletID < 200 { - continue - } - env.tmc.expectVRQuery(tabletID, fmt.Sprintf("select 1 from _vt.vreplication where db_name='vt_%s' and workflow='%s'", env.ms.TargetKeyspace, env.ms.Workflow), &sqltypes.Result{}) - } -} - func (env *testMaterializerEnv) close() { for _, t := range env.tablets { env.deleteTablet(t) @@ -184,8 +172,6 @@ type testMaterializerTMClient struct { mu sync.Mutex vrQueries map[int][]*queryResult createVReplicationWorkflowRequests map[uint32]*tabletmanagerdatapb.CreateVReplicationWorkflowRequest - getSchemaCounts map[string]int - muSchemaCount sync.Mutex // Used to confirm the number of times WorkflowDelete was called. workflowDeleteCalls int @@ -196,19 +182,6 @@ func newTestMaterializerTMClient() *testMaterializerTMClient { schema: make(map[string]*tabletmanagerdatapb.SchemaDefinition), vrQueries: make(map[int][]*queryResult), createVReplicationWorkflowRequests: make(map[uint32]*tabletmanagerdatapb.CreateVReplicationWorkflowRequest), - getSchemaCounts: make(map[string]int), - } -} - -func (tmc *testMaterializerTMClient) schemaRequested(uid uint32) { - tmc.muSchemaCount.Lock() - defer tmc.muSchemaCount.Unlock() - key := strconv.Itoa(int(uid)) - n, ok := tmc.getSchemaCounts[key] - if !ok { - tmc.getSchemaCounts[key] = 1 - } else { - tmc.getSchemaCounts[key] = n + 1 } } @@ -260,15 +233,7 @@ func (tmc *testMaterializerTMClient) DeleteVReplicationWorkflow(ctx context.Cont }, nil } -func (tmc *testMaterializerTMClient) getSchemaRequestCount(uid uint32) int { - tmc.muSchemaCount.Lock() - defer tmc.muSchemaCount.Unlock() - key := strconv.Itoa(int(uid)) - return tmc.getSchemaCounts[key] -} - func (tmc *testMaterializerTMClient) GetSchema(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.GetSchemaRequest) (*tabletmanagerdatapb.SchemaDefinition, error) { - tmc.schemaRequested(tablet.Alias.Uid) schemaDefn := &tabletmanagerdatapb.SchemaDefinition{} for _, table := range request.Tables { if table == "/.*/" { @@ -381,3 +346,58 @@ func (tmc *testMaterializerTMClient) VDiff(ctx context.Context, tablet *topodata }, }, nil } + +func (tmc *testMaterializerTMClient) HasVReplicationWorkflows(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.HasVReplicationWorkflowsRequest) (*tabletmanagerdatapb.HasVReplicationWorkflowsResponse, error) { + return &tabletmanagerdatapb.HasVReplicationWorkflowsResponse{ + Has: false, + }, nil +} + +func (tmc *testMaterializerTMClient) ReadVReplicationWorkflows(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowsResponse, error) { + workflowType := binlogdatapb.VReplicationWorkflowType_MoveTables + if len(req.IncludeWorkflows) > 0 { + for _, wf := range req.IncludeWorkflows { + if strings.Contains(wf, "lookup") { + workflowType = binlogdatapb.VReplicationWorkflowType_CreateLookupIndex + } + } + return &tabletmanagerdatapb.ReadVReplicationWorkflowsResponse{ + Workflows: []*tabletmanagerdatapb.ReadVReplicationWorkflowResponse{ + { + Workflow: req.IncludeWorkflows[0], + WorkflowType: workflowType, + Streams: []*tabletmanagerdatapb.ReadVReplicationWorkflowResponse_Stream{ + { + Id: 1, + State: binlogdatapb.VReplicationWorkflowState_Running, + Bls: &binlogdatapb.BinlogSource{ + Keyspace: "sourceks", + Shard: "0", + Filter: &binlogdatapb.Filter{ + Rules: []*binlogdatapb.Rule{ + { + Match: ".*", + }, + }, + }, + }, + Pos: "MySQL56/" + position, + TimeUpdated: protoutil.TimeToProto(time.Now()), + TimeHeartbeat: protoutil.TimeToProto(time.Now()), + }, + }, + }, + }, + }, nil + } else { + return &tabletmanagerdatapb.ReadVReplicationWorkflowsResponse{}, nil + } +} + +func (tmc *testMaterializerTMClient) UpdateVReplicationWorkflow(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.UpdateVReplicationWorkflowRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowResponse, error) { + return &tabletmanagerdatapb.UpdateVReplicationWorkflowResponse{ + Result: &querypb.QueryResult{ + RowsAffected: 1, + }, + }, nil +} diff --git a/go/vt/vtctl/workflow/materializer_test.go b/go/vt/vtctl/workflow/materializer_test.go index 82cc07fdf7f..4f26a2bf626 100644 --- a/go/vt/vtctl/workflow/materializer_test.go +++ b/go/vt/vtctl/workflow/materializer_test.go @@ -28,13 +28,11 @@ import ( "golang.org/x/exp/maps" "google.golang.org/protobuf/proto" - "vitess.io/vitess/go/vt/sqlparser" - "vitess.io/vitess/go/vt/vtenv" - "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/test/utils" + "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/topo/memorytopo" - "vitess.io/vitess/go/vt/topo/topoproto" + "vitess.io/vitess/go/vt/vtenv" "vitess.io/vitess/go/vt/vtgate/vindexes" binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata" @@ -45,42 +43,19 @@ import ( vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata" ) -const getWorkflowQuery = "select id from _vt.vreplication where db_name='vt_targetks' and workflow='workflow'" -const mzUpdateQuery = "update _vt.vreplication set state='Running' where db_name='vt_targetks' and workflow='workflow'" -const mzSelectFrozenQuery = "select 1 from _vt.vreplication where db_name='vt_targetks' and message='FROZEN' and workflow_sub_type != 1" -const mzCheckJournal = "/select val from _vt.resharding_journal where id=" -const mzGetWorkflowStatusQuery = "select id, workflow, source, pos, stop_pos, max_replication_lag, state, db_name, time_updated, transaction_timestamp, message, tags, workflow_type, workflow_sub_type, time_heartbeat, defer_secondary_keys, component_throttled, time_throttled, rows_copied, tablet_types, cell from _vt.vreplication where workflow = 'workflow' and db_name = 'vt_targetks'" -const mzGetCopyState = "select distinct table_name from _vt.copy_state cs, _vt.vreplication vr where vr.id = cs.vrepl_id and vr.id = 1" -const mzGetLatestCopyState = "select vrepl_id, table_name, lastpk from _vt.copy_state where vrepl_id in (1) and id in (select max(id) from _vt.copy_state where vrepl_id in (1) group by vrepl_id, table_name)" -const insertPrefix = `/insert into _vt.vreplication\(workflow, source, pos, max_tps, max_replication_lag, cell, tablet_types, time_updated, transaction_timestamp, state, db_name, workflow_type, workflow_sub_type, defer_secondary_keys\) values ` -const eol = "$" +const ( + position = "9d10e6ec-07a0-11ee-ae73-8e53f4cf3083:1-97" + mzUpdateQuery = "update _vt.vreplication set state='Running' where db_name='vt_targetks' and workflow='workflow'" + mzSelectFrozenQuery = "select 1 from _vt.vreplication where db_name='vt_targetks' and message='FROZEN' and workflow_sub_type != 1" + mzCheckJournal = "/select val from _vt.resharding_journal where id=" + mzGetCopyState = "select distinct table_name from _vt.copy_state cs, _vt.vreplication vr where vr.id = cs.vrepl_id and vr.id = 1" + mzGetLatestCopyState = "select vrepl_id, table_name, lastpk from _vt.copy_state where vrepl_id in (1) and id in (select max(id) from _vt.copy_state where vrepl_id in (1) group by vrepl_id, table_name)" + insertPrefix = `/insert into _vt.vreplication\(workflow, source, pos, max_tps, max_replication_lag, cell, tablet_types, time_updated, transaction_timestamp, state, db_name, workflow_type, workflow_sub_type, defer_secondary_keys\) values ` + eol = "$" +) var ( defaultOnDDL = binlogdatapb.OnDDLAction_IGNORE.String() - binlogSource = &binlogdatapb.BinlogSource{ - Keyspace: "sourceks", - Shard: "0", - Filter: &binlogdatapb.Filter{ - Rules: []*binlogdatapb.Rule{{ - Match: "t1", - Filter: "select * from t1", - }}, - }, - } - getWorkflowRes = sqltypes.MakeTestResult( - sqltypes.MakeTestFields( - "id|source|message|cell|tablet_types|workflow_type|workflow_sub_type|defer_secondary_keys", - "int64|blob|varchar|varchar|varchar|int64|int64|int64", - ), - fmt.Sprintf("1|%s||zone1|replica|1|0|1", binlogSource), - ) - getWorkflowStatusRes = sqltypes.MakeTestResult( - sqltypes.MakeTestFields( - "id|workflow|source|pos|stop_pos|max_replication_log|state|db_name|time_updated|transaction_timestamp|message|tags|workflow_type|workflow_sub_type|time_heartbeat|defer_secondary_keys|component_throttled|time_throttled|rows_copied", - "int64|varchar|blob|varchar|varchar|int64|varchar|varchar|int64|int64|varchar|varchar|int64|int64|int64|int64|varchar|int64|int64", - ), - fmt.Sprintf("1|wf1|%s|MySQL56/9d10e6ec-07a0-11ee-ae73-8e53f4cf3083:1-97|NULL|0|running|vt_ks|1686577659|0|||1|0|0|0||0|10", binlogSource), - ) ) func TestStripForeignKeys(t *testing.T) { @@ -450,11 +425,7 @@ func TestMigrateVSchema(t *testing.T) { defer env.close() env.tmc.expectVRQuery(100, mzCheckJournal, &sqltypes.Result{}) - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery(200, getWorkflowQuery, getWorkflowRes) - env.tmc.expectVRQuery(200, mzUpdateQuery, &sqltypes.Result{}) env.tmc.expectVRQuery(200, mzGetCopyState, &sqltypes.Result{}) - env.tmc.expectVRQuery(200, mzGetWorkflowStatusQuery, getWorkflowStatusRes) env.tmc.expectVRQuery(200, mzGetLatestCopyState, &sqltypes.Result{}) _, err := env.ws.MoveTablesCreate(ctx, &vtctldatapb.MoveTablesCreateRequest{ @@ -512,18 +483,15 @@ func TestMoveTablesDDLFlag(t *testing.T) { // a circular dependency. // The TabletManager portion is tested in rpc_vreplication_test.go. env.tmc.expectVRQuery(100, mzCheckJournal, &sqltypes.Result{}) - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery(200, getWorkflowQuery, getWorkflowRes) env.tmc.expectVRQuery(200, mzGetCopyState, &sqltypes.Result{}) - env.tmc.expectVRQuery(200, mzGetWorkflowStatusQuery, getWorkflowStatusRes) env.tmc.expectVRQuery(200, mzGetLatestCopyState, &sqltypes.Result{}) targetShard, err := env.topoServ.GetShardNames(ctx, ms.TargetKeyspace) require.NoError(t, err) sourceShard, err := env.topoServ.GetShardNames(ctx, ms.SourceKeyspace) require.NoError(t, err) - want := fmt.Sprintf("shard_streams:{key:\"%s/%s\" value:{streams:{id:1 tablet:{cell:\"%s\" uid:200} source_shard:\"%s/%s\" position:\"9d10e6ec-07a0-11ee-ae73-8e53f4cf3083:1-97\" status:\"running\" info:\"VStream Lag: 0s\"}}} traffic_state:\"Reads Not Switched. Writes Not Switched\"", - ms.TargetKeyspace, targetShard[0], env.cell, ms.SourceKeyspace, sourceShard[0]) + want := fmt.Sprintf("shard_streams:{key:\"%s/%s\" value:{streams:{id:1 tablet:{cell:\"%s\" uid:200} source_shard:\"%s/%s\" position:\"%s\" status:\"Running\" info:\"VStream Lag: 0s\"}}} traffic_state:\"Reads Not Switched. Writes Not Switched\"", + ms.TargetKeyspace, targetShard[0], env.cell, ms.SourceKeyspace, sourceShard[0], position) res, err := env.ws.MoveTablesCreate(ctx, &vtctldatapb.MoveTablesCreateRequest{ Workflow: ms.Workflow, @@ -564,18 +532,33 @@ func TestMoveTablesNoRoutingRules(t *testing.T) { // a circular dependency. // The TabletManager portion is tested in rpc_vreplication_test.go. env.tmc.expectVRQuery(100, mzCheckJournal, &sqltypes.Result{}) - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery(200, getWorkflowQuery, getWorkflowRes) env.tmc.expectVRQuery(200, mzGetCopyState, &sqltypes.Result{}) - env.tmc.expectVRQuery(200, mzGetWorkflowStatusQuery, getWorkflowStatusRes) env.tmc.expectVRQuery(200, mzGetLatestCopyState, &sqltypes.Result{}) targetShard, err := env.topoServ.GetShardNames(ctx, ms.TargetKeyspace) require.NoError(t, err) sourceShard, err := env.topoServ.GetShardNames(ctx, ms.SourceKeyspace) require.NoError(t, err) - want := fmt.Sprintf("shard_streams:{key:\"%s/%s\" value:{streams:{id:1 tablet:{cell:\"%s\" uid:200} source_shard:\"%s/%s\" position:\"9d10e6ec-07a0-11ee-ae73-8e53f4cf3083:1-97\" status:\"running\" info:\"VStream Lag: 0s\"}}} traffic_state:\"Reads Not Switched. Writes Not Switched\"", - ms.TargetKeyspace, targetShard[0], env.cell, ms.SourceKeyspace, sourceShard[0]) + want := &vtctldatapb.WorkflowStatusResponse{ + ShardStreams: map[string]*vtctldatapb.WorkflowStatusResponse_ShardStreams{ + fmt.Sprintf("%s/%s", ms.TargetKeyspace, targetShard[0]): { + Streams: []*vtctldatapb.WorkflowStatusResponse_ShardStreamState{ + { + Id: 1, + Tablet: &topodatapb.TabletAlias{ + Cell: env.cell, + Uid: 200, + }, + SourceShard: fmt.Sprintf("%s/%s", ms.SourceKeyspace, sourceShard[0]), + Position: position, + Status: binlogdatapb.VReplicationWorkflowState_Running.String(), + Info: "VStream Lag: 0s", + }, + }, + }, + }, + TrafficState: "Reads Not Switched. Writes Not Switched", + } res, err := env.ws.MoveTablesCreate(ctx, &vtctldatapb.MoveTablesCreateRequest{ Workflow: ms.Workflow, @@ -585,7 +568,7 @@ func TestMoveTablesNoRoutingRules(t *testing.T) { NoRoutingRules: true, }) require.NoError(t, err) - require.Equal(t, want, fmt.Sprintf("%+v", res)) + require.EqualValues(t, want, res, "got: %+v, want: %+v", res, want) rr, err := env.ws.ts.GetRoutingRules(ctx) require.NoError(t, err) require.Zerof(t, len(rr.Rules), "routing rules should be empty, found %+v", rr.Rules) @@ -667,8 +650,9 @@ func TestCreateLookupVindexFull(t *testing.T) { } env.tmc.expectVRQuery(100, mzCheckJournal, &sqltypes.Result{}) - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) env.tmc.expectVRQuery(200, "/CREATE TABLE `lookup`", &sqltypes.Result{}) + env.tmc.expectVRQuery(200, mzGetCopyState, &sqltypes.Result{}) + env.tmc.expectVRQuery(200, mzGetLatestCopyState, &sqltypes.Result{}) env.tmc.expectVRQuery(200, insertPrefix, &sqltypes.Result{}) env.tmc.expectVRQuery(200, "update _vt.vreplication set state='Running' where db_name='vt_targetks' and workflow='lookup'", &sqltypes.Result{}) @@ -2184,1299 +2168,192 @@ func TestCreateLookupVindexFailures(t *testing.T) { } } -func TestExternalizeLookupVindex(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - // Keyspace where the vindex is created. - SourceKeyspace: "sourceks", - // Keyspace where the lookup table and VReplication workflow is created. - TargetKeyspace: "targetks", - } - ctx, cancel := context.WithCancel(context.Background()) +// TestKeyRangesEqualOptimization tests that we optimize the source +// filtering when there's only one source shard for the stream and +// its keyrange is equal to the target shard for the stream. This +// means that even if the target keyspace is sharded, the source +// does not need to perform the in_keyrange filtering. +func TestKeyRangesEqualOptimization(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() - - env := newTestMaterializerEnv(t, ctx, ms, []string{"0"}, []string{"-80", "80-"}) - defer env.close() - - sourceVschema := &vschemapb.Keyspace{ - Sharded: false, + workflow := "testwf" + cells := []string{"cell"} + sourceKs := "sourceks" + targetKs := "targetks" + table := "t1" + tableSettings := []*vtctldatapb.TableMaterializeSettings{{ + TargetTable: table, + SourceExpression: fmt.Sprintf("select * from %s", table), + }} + targetVSchema := &vschemapb.Keyspace{ + Sharded: true, Vindexes: map[string]*vschemapb.Vindex{ "xxhash": { Type: "xxhash", }, - "owned_lookup": { - Type: "lookup_unique", - Params: map[string]string{ - "table": "targetks.owned_lookup", - "from": "c1", - "to": "c2", - "write_only": "true", - }, - Owner: "t1", - }, - "unowned_lookup": { - Type: "lookup_unique", - Params: map[string]string{ - "table": "targetks.unowned_lookup", - "from": "c1", - "to": "c2", - "write_only": "true", - }, - }, - "unqualified_lookup": { - Type: "lookup_unique", - Params: map[string]string{ - "table": "unqualified", - "from": "c1", - "to": "c2", - }, - }, }, Tables: map[string]*vschemapb.Table{ - "t1": { - ColumnVindexes: []*vschemapb.ColumnVindex{{ - Name: "xxhash", - Column: "col1", - }, { - Name: "owned_lookup", - Column: "col2", - }}, + table: { + ColumnVindexes: []*vschemapb.ColumnVindex{ + { + Column: "id", + Name: "xxhash", + }, + }, }, }, } - fields := sqltypes.MakeTestFields( - "id|state|message|source", - "int64|varbinary|varbinary|blob", - ) - ownedSourceStopAfterCopy := fmt.Sprintf(`keyspace:"%s",shard:"0",filter:{rules:{match:"owned_lookup" filter:"select * from t1 where in_keyrange(col1, '%s.xxhash', '-80')"}} stop_after_copy:true`, - ms.SourceKeyspace, ms.SourceKeyspace) - ownedSourceKeepRunningAfterCopy := fmt.Sprintf(`keyspace:"%s",shard:"0",filter:{rules:{match:"owned_lookup" filter:"select * from t1 where in_keyrange(col1, '%s.xxhash', '-80')"}}`, - ms.SourceKeyspace, ms.SourceKeyspace) - ownedRunning := sqltypes.MakeTestResult(fields, "1|Running|msg|"+ownedSourceKeepRunningAfterCopy) - ownedStopped := sqltypes.MakeTestResult(fields, "1|Stopped|Stopped after copy|"+ownedSourceStopAfterCopy) - unownedSourceStopAfterCopy := fmt.Sprintf(`keyspace:"%s",shard:"0",filter:{rules:{match:"unowned_lookup" filter:"select * from t1 where in_keyrange(col1, '%s.xxhash', '-80')"}} stop_after_copy:true`, - ms.SourceKeyspace, ms.SourceKeyspace) - unownedSourceKeepRunningAfterCopy := fmt.Sprintf(`keyspace:"%s",shard:"0",filter:{rules:{match:"unowned_lookup" filter:"select * from t1 where in_keyrange(col1, '%s.xxhash', '-80')"}}`, - ms.SourceKeyspace, ms.SourceKeyspace) - unownedRunning := sqltypes.MakeTestResult(fields, "2|Running|msg|"+unownedSourceKeepRunningAfterCopy) - unownedStopped := sqltypes.MakeTestResult(fields, "2|Stopped|Stopped after copy|"+unownedSourceStopAfterCopy) - testcases := []struct { - request *vtctldatapb.LookupVindexExternalizeRequest - vrResponse *sqltypes.Result - err string - expectedVschema *vschemapb.Keyspace - expectDelete bool + testCases := []struct { + name string + sourceShards []string + targetShards []string + moveTablesReq *vtctldatapb.MoveTablesCreateRequest + // Target Shards are in the order specifed in the targetShards slice + // with the UIDs starting at 200 and increasing by 10 for each tablet + // and shard since there's only a primary tablet per shard. + wantReqs map[uint32]*tabletmanagerdatapb.CreateVReplicationWorkflowRequest }{ { - request: &vtctldatapb.LookupVindexExternalizeRequest{ - Name: "owned_lookup", - Keyspace: ms.SourceKeyspace, - TableKeyspace: ms.TargetKeyspace, + name: "no in_keyrange filter -- partial, one equal shard", + moveTablesReq: &vtctldatapb.MoveTablesCreateRequest{ + Workflow: workflow, + TargetKeyspace: targetKs, + SourceKeyspace: sourceKs, + Cells: []string{"cell"}, + SourceShards: []string{"-80"}, // Partial MoveTables just for this shard + IncludeTables: []string{table}, }, - vrResponse: ownedStopped, - expectedVschema: &vschemapb.Keyspace{ - Vindexes: map[string]*vschemapb.Vindex{ - "owned_lookup": { - Type: "lookup_unique", - Params: map[string]string{ - "table": "targetks.owned_lookup", - "from": "c1", - "to": "c2", + sourceShards: []string{"-80", "80-"}, + targetShards: []string{"-80", "80-"}, + wantReqs: map[uint32]*tabletmanagerdatapb.CreateVReplicationWorkflowRequest{ + 200: { + Workflow: workflow, + WorkflowType: binlogdatapb.VReplicationWorkflowType_MoveTables, + WorkflowSubType: binlogdatapb.VReplicationWorkflowSubType_Partial, + Cells: cells, + BinlogSource: []*binlogdatapb.BinlogSource{ + { + Keyspace: sourceKs, + Shard: "-80", // Keyranges are equal between the source and target + Filter: &binlogdatapb.Filter{ + Rules: []*binlogdatapb.Rule{ + { + Match: table, + Filter: fmt.Sprintf("select * from %s", table), + }, + }, + }, }, - Owner: "t1", }, }, }, - expectDelete: true, }, { - request: &vtctldatapb.LookupVindexExternalizeRequest{ - Name: "unowned_lookup", - Keyspace: ms.SourceKeyspace, - TableKeyspace: ms.TargetKeyspace, + name: "in_keyrange filter -- unequal shards", + moveTablesReq: &vtctldatapb.MoveTablesCreateRequest{ + Workflow: workflow, + TargetKeyspace: targetKs, + SourceKeyspace: sourceKs, + Cells: []string{"cell"}, + IncludeTables: []string{table}, }, - vrResponse: unownedStopped, - expectedVschema: &vschemapb.Keyspace{ - Vindexes: map[string]*vschemapb.Vindex{ - "unowned_lookup": { - Type: "lookup_unique", - Params: map[string]string{ - "table": "targetks.unowned_lookup", - "from": "c1", - "to": "c2", + sourceShards: []string{"-"}, + targetShards: []string{"-80", "80-"}, + wantReqs: map[uint32]*tabletmanagerdatapb.CreateVReplicationWorkflowRequest{ + 200: { + Workflow: workflow, + WorkflowType: binlogdatapb.VReplicationWorkflowType_MoveTables, + Cells: cells, + BinlogSource: []*binlogdatapb.BinlogSource{ + { + Keyspace: sourceKs, + Shard: "-", + Filter: &binlogdatapb.Filter{ + Rules: []*binlogdatapb.Rule{ + { + Match: table, + Filter: fmt.Sprintf("select * from %s where in_keyrange(id, '%s.xxhash', '-80')", table, targetKs), + }, + }, + }, }, }, }, - }, - err: "is not in Running state", - }, - { - request: &vtctldatapb.LookupVindexExternalizeRequest{ - Name: "owned_lookup", - Keyspace: ms.SourceKeyspace, - TableKeyspace: ms.TargetKeyspace, - }, - vrResponse: ownedRunning, - expectedVschema: &vschemapb.Keyspace{ - Vindexes: map[string]*vschemapb.Vindex{ - "owned_lookup": { - Type: "lookup_unique", - Params: map[string]string{ - "table": "targetks.owned_lookup", - "from": "c1", - "to": "c2", + 210: { + Workflow: workflow, + WorkflowType: binlogdatapb.VReplicationWorkflowType_MoveTables, + Cells: cells, + BinlogSource: []*binlogdatapb.BinlogSource{ + { + Keyspace: sourceKs, + Shard: "-", + Filter: &binlogdatapb.Filter{ + Rules: []*binlogdatapb.Rule{ + { + Match: table, + Filter: fmt.Sprintf("select * from %s where in_keyrange(id, '%s.xxhash', '80-')", table, targetKs), + }, + }, + }, }, - Owner: "t1", }, }, }, - expectDelete: true, }, { - request: &vtctldatapb.LookupVindexExternalizeRequest{ - Name: "unowned_lookup", - Keyspace: ms.SourceKeyspace, - TableKeyspace: ms.TargetKeyspace, + name: "in_keyrange filter -- unequal shards on merge", + moveTablesReq: &vtctldatapb.MoveTablesCreateRequest{ + Workflow: workflow, + TargetKeyspace: targetKs, + SourceKeyspace: sourceKs, + Cells: []string{"cell"}, + IncludeTables: []string{table}, }, - vrResponse: unownedRunning, - expectedVschema: &vschemapb.Keyspace{ - Vindexes: map[string]*vschemapb.Vindex{ - "unowned_lookup": { - Type: "lookup_unique", - Params: map[string]string{ - "table": "targetks.unowned_lookup", - "from": "c1", - "to": "c2", + sourceShards: []string{"-80", "80-"}, + targetShards: []string{"-"}, + wantReqs: map[uint32]*tabletmanagerdatapb.CreateVReplicationWorkflowRequest{ + 200: { + Workflow: workflow, + WorkflowType: binlogdatapb.VReplicationWorkflowType_MoveTables, + Cells: cells, + BinlogSource: []*binlogdatapb.BinlogSource{ + { + Keyspace: sourceKs, + Shard: "-80", + Filter: &binlogdatapb.Filter{ + Rules: []*binlogdatapb.Rule{ + { + Match: table, + Filter: fmt.Sprintf("select * from %s where in_keyrange(id, '%s.xxhash', '-')", table, targetKs), + }, + }, + }, + }, + { + Keyspace: sourceKs, + Shard: "80-", + Filter: &binlogdatapb.Filter{ + Rules: []*binlogdatapb.Rule{ + { + Match: table, + Filter: fmt.Sprintf("select * from %s where in_keyrange(id, '%s.xxhash', '-')", table, targetKs), + }, + }, + }, }, }, }, }, }, { - request: &vtctldatapb.LookupVindexExternalizeRequest{ - Name: "absent_lookup", - Keyspace: ms.SourceKeyspace, - TableKeyspace: ms.TargetKeyspace, - }, - expectedVschema: &vschemapb.Keyspace{ - Vindexes: map[string]*vschemapb.Vindex{ - "absent_lookup": { - Type: "lookup_unique", - Params: map[string]string{ - "table": "targetks.absent_lookup", - "from": "c1", - "to": "c2", - }, - }, - }, - }, - err: "vindex absent_lookup not found in the sourceks keyspace", - }, - } - for _, tcase := range testcases { - t.Run(tcase.request.Name, func(t *testing.T) { - // Resave the source schema for every iteration. - err := env.topoServ.SaveVSchema(ctx, tcase.request.Keyspace, sourceVschema) - require.NoError(t, err) - err = env.topoServ.RebuildSrvVSchema(ctx, []string{env.cell}) - require.NoError(t, err) - - validationQuery := fmt.Sprintf("select id, state, message, source from _vt.vreplication where workflow='%s' and db_name='vt_%s'", - tcase.request.Name, ms.TargetKeyspace) - env.tmc.expectVRQuery(200, validationQuery, tcase.vrResponse) - env.tmc.expectVRQuery(210, validationQuery, tcase.vrResponse) - - preWorkflowDeleteCalls := env.tmc.workflowDeleteCalls - _, err = env.ws.LookupVindexExternalize(ctx, tcase.request) - if tcase.err != "" { - if err == nil || !strings.Contains(err.Error(), tcase.err) { - require.FailNow(t, "LookupVindexExternalize error", "ExternalizeVindex(%v) err: %v, must contain %v", tcase.request, err, tcase.err) - } - return - } - require.NoError(t, err) - expectedWorkflowDeleteCalls := preWorkflowDeleteCalls - if tcase.expectDelete { - // We expect the RPC to be called on each target shard. - expectedWorkflowDeleteCalls = preWorkflowDeleteCalls + (len(env.targets)) - } - require.Equal(t, expectedWorkflowDeleteCalls, env.tmc.workflowDeleteCalls) - - aftervschema, err := env.topoServ.GetVSchema(ctx, ms.SourceKeyspace) - require.NoError(t, err) - vindex := aftervschema.Vindexes[tcase.request.Name] - expectedVindex := tcase.expectedVschema.Vindexes[tcase.request.Name] - require.NotNil(t, vindex, "vindex %s not found in vschema", tcase.request.Name) - require.NotContains(t, vindex.Params, "write_only", tcase.request) - require.Equal(t, expectedVindex, vindex, "vindex mismatch. expected: %+v, got: %+v", expectedVindex, vindex) - }) - } -} - -func TestMaterializerOneToOne(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - Workflow: "workflow", - SourceKeyspace: "sourceks", - TargetKeyspace: "targetks", - TableSettings: []*vtctldatapb.TableMaterializeSettings{ - { - TargetTable: "t1", - SourceExpression: "select * from t1", - CreateDdl: "t1ddl", - }, - { - TargetTable: "t2", - SourceExpression: "select * from t3", - CreateDdl: "t2ddl", - }, - { - TargetTable: "t4", - SourceExpression: "", // empty - CreateDdl: "t4ddl", - }, - }, - Cell: "zone1", - TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ - topodatapb.TabletType_PRIMARY, - topodatapb.TabletType_RDONLY, - }), - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - env := newTestMaterializerEnv(t, ctx, ms, []string{"0"}, []string{"0"}) - defer env.close() - - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery( - 200, - insertPrefix+ - `\(`+ - `'workflow', `+ - (`'keyspace:\\"sourceks\\" shard:\\"0\\" `+ - `filter:{`+ - `rules:{match:\\"t1\\" filter:\\"select.*t1\\"} `+ - `rules:{match:\\"t2\\" filter:\\"select.*t3\\"} `+ - `rules:{match:\\"t4\\"}`+ - `}', `)+ - `'', [0-9]*, [0-9]*, 'zone1', 'primary,rdonly', [0-9]*, 0, 'Stopped', 'vt_targetks', 0, 0, false`+ - `\)`+eol, - &sqltypes.Result{}, - ) - env.tmc.expectVRQuery(200, mzUpdateQuery, &sqltypes.Result{}) - - err := env.ws.Materialize(ctx, ms) - require.NoError(t, err) - env.tmc.verifyQueries(t) -} - -func TestMaterializerManyToOne(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - Workflow: "workflow", - SourceKeyspace: "sourceks", - TargetKeyspace: "targetks", - TableSettings: []*vtctldatapb.TableMaterializeSettings{{ - TargetTable: "t1", - SourceExpression: "select * from t1", - CreateDdl: "t1ddl", - }, { - TargetTable: "t2", - SourceExpression: "select * from t3", - CreateDdl: "t2ddl", - }}, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - env := newTestMaterializerEnv(t, ctx, ms, []string{"-80", "80-"}, []string{"0"}) - defer env.close() - - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery( - 200, - insertPrefix+ - `\('workflow', 'keyspace:\\"sourceks\\" shard:\\"-80\\" filter:{rules:{match:\\"t1\\" filter:\\"select.*t1\\"} rules:{match:\\"t2\\" filter:\\"select.*t3\\"}}', '', [0-9]*, [0-9]*, '', '', [0-9]*, 0, 'Stopped', 'vt_targetks', 0, 0, false\)`+ - `, `+ - `\('workflow', 'keyspace:\\"sourceks\\" shard:\\"80-\\" filter:{rules:{match:\\"t1\\" filter:\\"select.*t1\\"} rules:{match:\\"t2\\" filter:\\"select.*t3\\"}}', '', [0-9]*, [0-9]*, '', '', [0-9]*, 0, 'Stopped', 'vt_targetks', 0, 0, false\)`+ - eol, - &sqltypes.Result{}, - ) - env.tmc.expectVRQuery(200, mzUpdateQuery, &sqltypes.Result{}) - - err := env.ws.Materialize(ctx, ms) - require.NoError(t, err) - env.tmc.verifyQueries(t) -} - -func TestMaterializerOneToMany(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - Workflow: "workflow", - SourceKeyspace: "sourceks", - TargetKeyspace: "targetks", - TableSettings: []*vtctldatapb.TableMaterializeSettings{{ - TargetTable: "t1", - SourceExpression: "select * from t1", - CreateDdl: "t1ddl", - }}, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - env := newTestMaterializerEnv(t, ctx, ms, []string{"0"}, []string{"-80", "80-"}) - defer env.close() - - vs := &vschemapb.Keyspace{ - Sharded: true, - Vindexes: map[string]*vschemapb.Vindex{ - "xxhash": { - Type: "xxhash", - }, - }, - Tables: map[string]*vschemapb.Table{ - "t1": { - ColumnVindexes: []*vschemapb.ColumnVindex{{ - Column: "c1", - Name: "xxhash", - }}, - }, - }, - } - - if err := env.topoServ.SaveVSchema(context.Background(), "targetks", vs); err != nil { - t.Fatal(err) - } - - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery(210, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery( - 200, - insertPrefix+ - `.*shard:\\"0\\" filter:{rules:{match:\\"t1\\" filter:\\"select.*t1 where in_keyrange\(c1.*targetks\.xxhash.*-80.*`, - &sqltypes.Result{}, - ) - env.tmc.expectVRQuery( - 210, - insertPrefix+ - `.*shard:\\"0\\" filter:{rules:{match:\\"t1\\" filter:\\"select.*t1 where in_keyrange\(c1.*targetks\.xxhash.*80-.*`, - &sqltypes.Result{}, - ) - env.tmc.expectVRQuery(200, mzUpdateQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery(210, mzUpdateQuery, &sqltypes.Result{}) - - err := env.ws.Materialize(ctx, ms) - require.NoError(t, err) - env.tmc.verifyQueries(t) -} - -func TestMaterializerManyToMany(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - Workflow: "workflow", - SourceKeyspace: "sourceks", - TargetKeyspace: "targetks", - TableSettings: []*vtctldatapb.TableMaterializeSettings{{ - TargetTable: "t1", - SourceExpression: "select * from t1", - CreateDdl: "t1ddl", - }}, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - env := newTestMaterializerEnv(t, ctx, ms, []string{"-40", "40-"}, []string{"-80", "80-"}) - defer env.close() - - vs := &vschemapb.Keyspace{ - Sharded: true, - Vindexes: map[string]*vschemapb.Vindex{ - "xxhash": { - Type: "xxhash", - }, - }, - Tables: map[string]*vschemapb.Table{ - "t1": { - ColumnVindexes: []*vschemapb.ColumnVindex{{ - Column: "c1", - Name: "xxhash", - }}, - }, - }, - } - - if err := env.topoServ.SaveVSchema(context.Background(), "targetks", vs); err != nil { - t.Fatal(err) - } - - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery(210, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery( - 200, - insertPrefix+ - `.*shard:\\"-40\\" filter:{rules:{match:\\"t1\\" filter:\\"select.*t1 where in_keyrange\(c1.*targetks\.xxhash.*-80.*`+ - `.*shard:\\"40-\\" filter:{rules:{match:\\"t1\\" filter:\\"select.*t1 where in_keyrange\(c1.*targetks\.xxhash.*-80.*`, - &sqltypes.Result{}, - ) - env.tmc.expectVRQuery( - 210, - insertPrefix+ - `.*shard:\\"-40\\" filter:{rules:{match:\\"t1\\" filter:\\"select.*t1 where in_keyrange\(c1.*targetks\.xxhash.*80-.*`+ - `.*shard:\\"40-\\" filter:{rules:{match:\\"t1\\" filter:\\"select.*t1 where in_keyrange\(c1.*targetks\.xxhash.*80-.*`, - &sqltypes.Result{}, - ) - env.tmc.expectVRQuery(200, mzUpdateQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery(210, mzUpdateQuery, &sqltypes.Result{}) - err := env.ws.Materialize(ctx, ms) - require.NoError(t, err) - env.tmc.verifyQueries(t) -} - -func TestMaterializerMulticolumnVindex(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - Workflow: "workflow", - SourceKeyspace: "sourceks", - TargetKeyspace: "targetks", - TableSettings: []*vtctldatapb.TableMaterializeSettings{{ - TargetTable: "t1", - SourceExpression: "select * from t1", - CreateDdl: "t1ddl", - }}, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - env := newTestMaterializerEnv(t, ctx, ms, []string{"0"}, []string{"-80", "80-"}) - defer env.close() - - vs := &vschemapb.Keyspace{ - Sharded: true, - Vindexes: map[string]*vschemapb.Vindex{ - "region": { - Type: "region_experimental", - Params: map[string]string{ - "region_bytes": "1", - }, - }, - }, - Tables: map[string]*vschemapb.Table{ - "t1": { - ColumnVindexes: []*vschemapb.ColumnVindex{{ - Columns: []string{"c1", "c2"}, - Name: "region", - }}, - }, - }, - } - - if err := env.topoServ.SaveVSchema(context.Background(), "targetks", vs); err != nil { - t.Fatal(err) - } - - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery(210, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery( - 200, - insertPrefix+ - `.*shard:\\"0\\" filter:{rules:{match:\\"t1\\" filter:\\"select.*t1 where in_keyrange\(c1, c2.*targetks\.region.*-80.*`, - &sqltypes.Result{}, - ) - env.tmc.expectVRQuery( - 210, - insertPrefix+ - `.*shard:\\"0\\" filter:{rules:{match:\\"t1\\" filter:\\"select.*t1 where in_keyrange\(c1, c2.*targetks\.region.*80-.*`, - &sqltypes.Result{}, - ) - env.tmc.expectVRQuery(200, mzUpdateQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery(210, mzUpdateQuery, &sqltypes.Result{}) - - err := env.ws.Materialize(ctx, ms) - require.NoError(t, err) - env.tmc.verifyQueries(t) -} - -func TestMaterializerDeploySchema(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - Workflow: "workflow", - SourceKeyspace: "sourceks", - TargetKeyspace: "targetks", - TableSettings: []*vtctldatapb.TableMaterializeSettings{{ - TargetTable: "t1", - SourceExpression: "select * from t1", - CreateDdl: "t1ddl", - }, { - TargetTable: "t2", - SourceExpression: "select * from t3", - CreateDdl: "t2ddl", - }}, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - env := newTestMaterializerEnv(t, ctx, ms, []string{"0"}, []string{"0"}) - defer env.close() - - delete(env.tmc.schema, "targetks.t2") - - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery(200, `t2ddl`, &sqltypes.Result{}) - env.tmc.expectVRQuery( - 200, - insertPrefix+ - `\('workflow', 'keyspace:\\"sourceks\\" shard:\\"0\\" filter:{rules:{match:\\"t1\\" filter:\\"select.*t1\\"} rules:{match:\\"t2\\" filter:\\"select.*t3\\"}}', '', [0-9]*, [0-9]*, '', '', [0-9]*, 0, 'Stopped', 'vt_targetks', 0, 0, false\)`+ - eol, - &sqltypes.Result{}, - ) - env.tmc.expectVRQuery(200, mzUpdateQuery, &sqltypes.Result{}) - - err := env.ws.Materialize(ctx, ms) - require.NoError(t, err) - env.tmc.verifyQueries(t) - require.Equal(t, env.tmc.getSchemaRequestCount(100), 1) - require.Equal(t, env.tmc.getSchemaRequestCount(200), 1) -} - -func TestMaterializerCopySchema(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - Workflow: "workflow", - SourceKeyspace: "sourceks", - TargetKeyspace: "targetks", - TableSettings: []*vtctldatapb.TableMaterializeSettings{{ - TargetTable: "t1", - SourceExpression: "select * from t1", - CreateDdl: "copy", - }, { - TargetTable: "t2", - SourceExpression: "select * from t3", - CreateDdl: "t2ddl", - }}, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - env := newTestMaterializerEnv(t, ctx, ms, []string{"0"}, []string{"0"}) - defer env.close() - - delete(env.tmc.schema, "targetks.t1") - - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery(200, `t1_schema`, &sqltypes.Result{}) - env.tmc.expectVRQuery( - 200, - insertPrefix+ - `\('workflow', 'keyspace:\\"sourceks\\" shard:\\"0\\" filter:{rules:{match:\\"t1\\" filter:\\"select.*t1\\"} rules:{match:\\"t2\\" filter:\\"select.*t3\\"}}', '', [0-9]*, [0-9]*, '', '', [0-9]*, 0, 'Stopped', 'vt_targetks', 0, 0, false\)`+ - eol, - &sqltypes.Result{}, - ) - env.tmc.expectVRQuery(200, mzUpdateQuery, &sqltypes.Result{}) - - err := env.ws.Materialize(ctx, ms) - require.NoError(t, err) - env.tmc.verifyQueries(t) - require.Equal(t, env.tmc.getSchemaRequestCount(100), 1) - require.Equal(t, env.tmc.getSchemaRequestCount(200), 1) - -} - -func TestMaterializerExplicitColumns(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - Workflow: "workflow", - SourceKeyspace: "sourceks", - TargetKeyspace: "targetks", - TableSettings: []*vtctldatapb.TableMaterializeSettings{{ - TargetTable: "t1", - SourceExpression: "select c1, c1+c2, c2 from t1", - CreateDdl: "t1ddl", - }}, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - env := newTestMaterializerEnv(t, ctx, ms, []string{"0"}, []string{"-80", "80-"}) - defer env.close() - - vs := &vschemapb.Keyspace{ - Sharded: true, - Vindexes: map[string]*vschemapb.Vindex{ - "region": { - Type: "region_experimental", - Params: map[string]string{ - "region_bytes": "1", - }, - }, - }, - Tables: map[string]*vschemapb.Table{ - "t1": { - ColumnVindexes: []*vschemapb.ColumnVindex{{ - Columns: []string{"c1", "c2"}, - Name: "region", - }}, - }, - }, - } - - if err := env.topoServ.SaveVSchema(context.Background(), "targetks", vs); err != nil { - t.Fatal(err) - } - - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery(210, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery( - 200, - insertPrefix+ - `.*shard:\\"0\\" filter:{rules:{match:\\"t1\\" filter:\\"select.*t1 where in_keyrange\(c1, c2.*targetks\.region.*-80.*`, - &sqltypes.Result{}, - ) - env.tmc.expectVRQuery( - 210, - insertPrefix+ - `.*shard:\\"0\\" filter:{rules:{match:\\"t1\\" filter:\\"select.*t1 where in_keyrange\(c1, c2.*targetks\.region.*80-.*`, - &sqltypes.Result{}, - ) - env.tmc.expectVRQuery(200, mzUpdateQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery(210, mzUpdateQuery, &sqltypes.Result{}) - - err := env.ws.Materialize(ctx, ms) - require.NoError(t, err) - env.tmc.verifyQueries(t) -} - -func TestMaterializerRenamedColumns(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - Workflow: "workflow", - SourceKeyspace: "sourceks", - TargetKeyspace: "targetks", - TableSettings: []*vtctldatapb.TableMaterializeSettings{{ - TargetTable: "t1", - SourceExpression: "select c3 as c1, c1+c2, c4 as c2 from t1", - CreateDdl: "t1ddl", - }}, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - env := newTestMaterializerEnv(t, ctx, ms, []string{"0"}, []string{"-80", "80-"}) - defer env.close() - - vs := &vschemapb.Keyspace{ - Sharded: true, - Vindexes: map[string]*vschemapb.Vindex{ - "region": { - Type: "region_experimental", - Params: map[string]string{ - "region_bytes": "1", - }, - }, - }, - Tables: map[string]*vschemapb.Table{ - "t1": { - ColumnVindexes: []*vschemapb.ColumnVindex{{ - Columns: []string{"c1", "c2"}, - Name: "region", - }}, - }, - }, - } - - if err := env.topoServ.SaveVSchema(context.Background(), "targetks", vs); err != nil { - t.Fatal(err) - } - - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery(210, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery( - 200, - insertPrefix+ - `.*shard:\\"0\\" filter:{rules:{match:\\"t1\\" filter:\\"select.*t1 where in_keyrange\(c3, c4.*targetks\.region.*-80.*`, - &sqltypes.Result{}, - ) - env.tmc.expectVRQuery( - 210, - insertPrefix+ - `.*shard:\\"0\\" filter:{rules:{match:\\"t1\\" filter:\\"select.*t1 where in_keyrange\(c3, c4.*targetks\.region.*80-.*`, - &sqltypes.Result{}, - ) - env.tmc.expectVRQuery(200, mzUpdateQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery(210, mzUpdateQuery, &sqltypes.Result{}) - - err := env.ws.Materialize(ctx, ms) - require.NoError(t, err) - env.tmc.verifyQueries(t) -} - -func TestMaterializerStopAfterCopy(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - Workflow: "workflow", - SourceKeyspace: "sourceks", - TargetKeyspace: "targetks", - StopAfterCopy: true, - TableSettings: []*vtctldatapb.TableMaterializeSettings{{ - TargetTable: "t1", - SourceExpression: "select * from t1", - CreateDdl: "t1ddl", - }, { - TargetTable: "t2", - SourceExpression: "select * from t3", - CreateDdl: "t2ddl", - }}, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - env := newTestMaterializerEnv(t, ctx, ms, []string{"0"}, []string{"0"}) - defer env.close() - - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery(200, insertPrefix+`.*stop_after_copy:true`, &sqltypes.Result{}) - env.tmc.expectVRQuery(200, mzUpdateQuery, &sqltypes.Result{}) - - err := env.ws.Materialize(ctx, ms) - require.NoError(t, err) - env.tmc.verifyQueries(t) -} - -func TestMaterializerNoTargetVSchema(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - Workflow: "workflow", - SourceKeyspace: "sourceks", - TargetKeyspace: "targetks", - TableSettings: []*vtctldatapb.TableMaterializeSettings{{ - TargetTable: "t1", - SourceExpression: "select * from t1", - CreateDdl: "t1ddl", - }}, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - env := newTestMaterializerEnv(t, ctx, ms, []string{"0"}, []string{"-80", "80-"}) - defer env.close() - - vs := &vschemapb.Keyspace{ - Sharded: true, - } - - if err := env.topoServ.SaveVSchema(context.Background(), "targetks", vs); err != nil { - t.Fatal(err) - } - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery(210, mzSelectFrozenQuery, &sqltypes.Result{}) - err := env.ws.Materialize(ctx, ms) - require.EqualError(t, err, "table t1 not found in vschema for keyspace targetks") -} - -func TestMaterializerNoDDL(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - Workflow: "workflow", - SourceKeyspace: "sourceks", - TargetKeyspace: "targetks", - TableSettings: []*vtctldatapb.TableMaterializeSettings{{ - TargetTable: "t1", - SourceExpression: "select * from t1", - CreateDdl: "", - }}, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - env := newTestMaterializerEnv(t, ctx, ms, []string{"0"}, []string{"0"}) - defer env.close() - - delete(env.tmc.schema, "targetks.t1") - - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - err := env.ws.Materialize(ctx, ms) - require.EqualError(t, err, "target table t1 does not exist and there is no create ddl defined") - require.Equal(t, env.tmc.getSchemaRequestCount(100), 0) - require.Equal(t, env.tmc.getSchemaRequestCount(200), 1) - -} - -func TestMaterializerNoSourcePrimary(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - Workflow: "workflow", - SourceKeyspace: "sourceks", - TargetKeyspace: "targetks", - TableSettings: []*vtctldatapb.TableMaterializeSettings{{ - TargetTable: "t1", - SourceExpression: "select * from t1", - CreateDdl: "copy", - }}, - } - sources := []string{"0"} - targets := []string{"0"} - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - // Copied from newTestMaterializerEnv - env := &testMaterializerEnv{ - ms: ms, - sources: sources, - targets: targets, - tablets: make(map[int]*topodatapb.Tablet), - topoServ: memorytopo.NewServer(ctx, "cell"), - cell: "cell", - tmc: newTestMaterializerTMClient(), - } - env.ws = NewServer(vtenv.NewTestEnv(), env.topoServ, env.tmc) - defer env.close() - - tabletID := 100 - for _, shard := range sources { - _ = env.addTablet(tabletID, env.ms.SourceKeyspace, shard, topodatapb.TabletType_REPLICA) - tabletID += 10 - } - tabletID = 200 - for _, shard := range targets { - _ = env.addTablet(tabletID, env.ms.TargetKeyspace, shard, topodatapb.TabletType_PRIMARY) - tabletID += 10 - } - - // Skip the schema creation part. - - env.expectValidation() - - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - err := env.ws.Materialize(ctx, ms) - require.EqualError(t, err, "shard must have a primary for copying schema: 0") -} - -func TestMaterializerTableMismatchNonCopy(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - Workflow: "workflow", - SourceKeyspace: "sourceks", - TargetKeyspace: "targetks", - TableSettings: []*vtctldatapb.TableMaterializeSettings{{ - TargetTable: "t1", - SourceExpression: "select * from t2", - CreateDdl: "", - }}, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - env := newTestMaterializerEnv(t, ctx, ms, []string{"0"}, []string{"0"}) - defer env.close() - - delete(env.tmc.schema, "targetks.t1") - - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - err := env.ws.Materialize(ctx, ms) - require.EqualError(t, err, "target table t1 does not exist and there is no create ddl defined") -} - -func TestMaterializerTableMismatchCopy(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - Workflow: "workflow", - SourceKeyspace: "sourceks", - TargetKeyspace: "targetks", - TableSettings: []*vtctldatapb.TableMaterializeSettings{{ - TargetTable: "t1", - SourceExpression: "select * from t2", - CreateDdl: "copy", - }}, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - env := newTestMaterializerEnv(t, ctx, ms, []string{"0"}, []string{"0"}) - defer env.close() - - delete(env.tmc.schema, "targetks.t1") - - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - err := env.ws.Materialize(ctx, ms) - require.EqualError(t, err, "source and target table names must match for copying schema: t2 vs t1") -} - -func TestMaterializerNoSourceTable(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - Workflow: "workflow", - SourceKeyspace: "sourceks", - TargetKeyspace: "targetks", - TableSettings: []*vtctldatapb.TableMaterializeSettings{{ - TargetTable: "t1", - SourceExpression: "select * from t1", - CreateDdl: "copy", - }}, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - env := newTestMaterializerEnv(t, ctx, ms, []string{"0"}, []string{"0"}) - defer env.close() - - delete(env.tmc.schema, "targetks.t1") - delete(env.tmc.schema, "sourceks.t1") - - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - err := env.ws.Materialize(ctx, ms) - require.EqualError(t, err, "source table t1 does not exist") -} - -func TestMaterializerSyntaxError(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - Workflow: "workflow", - SourceKeyspace: "sourceks", - TargetKeyspace: "targetks", - TableSettings: []*vtctldatapb.TableMaterializeSettings{{ - TargetTable: "t1", - SourceExpression: "bad query", - CreateDdl: "t1ddl", - }}, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - env := newTestMaterializerEnv(t, ctx, ms, []string{"0"}, []string{"0"}) - defer env.close() - - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - err := env.ws.Materialize(ctx, ms) - require.EqualError(t, err, "syntax error at position 4 near 'bad'") -} - -func TestMaterializerNotASelect(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - Workflow: "workflow", - SourceKeyspace: "sourceks", - TargetKeyspace: "targetks", - TableSettings: []*vtctldatapb.TableMaterializeSettings{{ - TargetTable: "t1", - SourceExpression: "update t1 set val=1", - CreateDdl: "t1ddl", - }}, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - env := newTestMaterializerEnv(t, ctx, ms, []string{"0"}, []string{"0"}) - defer env.close() - - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - err := env.ws.Materialize(ctx, ms) - require.EqualError(t, err, "unrecognized statement: update t1 set val=1") -} - -func TestMaterializerNoGoodVindex(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - Workflow: "workflow", - SourceKeyspace: "sourceks", - TargetKeyspace: "targetks", - TableSettings: []*vtctldatapb.TableMaterializeSettings{{ - TargetTable: "t1", - SourceExpression: "select * from t1", - CreateDdl: "t1ddl", - }}, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - env := newTestMaterializerEnv(t, ctx, ms, []string{"0"}, []string{"-80", "80-"}) - defer env.close() - - vs := &vschemapb.Keyspace{ - Sharded: true, - Vindexes: map[string]*vschemapb.Vindex{ - "lookup_unique": { - Type: "lookup_unique", - Params: map[string]string{ - "table": "t1", - "from": "c1", - "to": "c2", - }, - }, - }, - Tables: map[string]*vschemapb.Table{ - "t1": { - ColumnVindexes: []*vschemapb.ColumnVindex{{ - Column: "c1", - Name: "lookup_unique", - }}, - }, - }, - } - - if err := env.topoServ.SaveVSchema(context.Background(), "targetks", vs); err != nil { - t.Fatal(err) - } - - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery(210, mzSelectFrozenQuery, &sqltypes.Result{}) - err := env.ws.Materialize(ctx, ms) - require.EqualError(t, err, "could not find a vindex to compute keyspace id for table t1") -} - -func TestMaterializerComplexVindexExpression(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - Workflow: "workflow", - SourceKeyspace: "sourceks", - TargetKeyspace: "targetks", - TableSettings: []*vtctldatapb.TableMaterializeSettings{{ - TargetTable: "t1", - SourceExpression: "select a+b as c1 from t1", - CreateDdl: "t1ddl", - }}, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - env := newTestMaterializerEnv(t, ctx, ms, []string{"0"}, []string{"-80", "80-"}) - defer env.close() - - vs := &vschemapb.Keyspace{ - Sharded: true, - Vindexes: map[string]*vschemapb.Vindex{ - "xxhash": { - Type: "xxhash", - }, - }, - Tables: map[string]*vschemapb.Table{ - "t1": { - ColumnVindexes: []*vschemapb.ColumnVindex{{ - Column: "c1", - Name: "xxhash", - }}, - }, - }, - } - - if err := env.topoServ.SaveVSchema(context.Background(), "targetks", vs); err != nil { - t.Fatal(err) - } - - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery(210, mzSelectFrozenQuery, &sqltypes.Result{}) - err := env.ws.Materialize(ctx, ms) - require.EqualError(t, err, "vindex column cannot be a complex expression: a + b as c1") -} - -func TestMaterializerNoVindexInExpression(t *testing.T) { - ms := &vtctldatapb.MaterializeSettings{ - Workflow: "workflow", - SourceKeyspace: "sourceks", - TargetKeyspace: "targetks", - TableSettings: []*vtctldatapb.TableMaterializeSettings{{ - TargetTable: "t1", - SourceExpression: "select c2 from t1", - CreateDdl: "t1ddl", - }}, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - env := newTestMaterializerEnv(t, ctx, ms, []string{"0"}, []string{"-80", "80-"}) - defer env.close() - - vs := &vschemapb.Keyspace{ - Sharded: true, - Vindexes: map[string]*vschemapb.Vindex{ - "xxhash": { - Type: "xxhash", - }, - }, - Tables: map[string]*vschemapb.Table{ - "t1": { - ColumnVindexes: []*vschemapb.ColumnVindex{{ - Column: "c1", - Name: "xxhash", - }}, - }, - }, - } - - if err := env.topoServ.SaveVSchema(context.Background(), "targetks", vs); err != nil { - t.Fatal(err) - } - - env.tmc.expectVRQuery(200, mzSelectFrozenQuery, &sqltypes.Result{}) - env.tmc.expectVRQuery(210, mzSelectFrozenQuery, &sqltypes.Result{}) - err := env.ws.Materialize(ctx, ms) - require.EqualError(t, err, "could not find vindex column c1") -} - -// TestKeyRangesEqualOptimization tests that we optimize the source -// filtering when there's only one source shard for the stream and -// its keyrange is equal to the target shard for the stream. This -// means that even if the target keyspace is sharded, the source -// does not need to perform the in_keyrange filtering. -func TestKeyRangesEqualOptimization(t *testing.T) { - ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) - defer cancel() - workflow := "testwf" - cells := []string{"cell"} - sourceKs := "sourceks" - targetKs := "targetks" - table := "t1" - tableSettings := []*vtctldatapb.TableMaterializeSettings{{ - TargetTable: table, - SourceExpression: fmt.Sprintf("select * from %s", table), - }} - targetVSchema := &vschemapb.Keyspace{ - Sharded: true, - Vindexes: map[string]*vschemapb.Vindex{ - "xxhash": { - Type: "xxhash", - }, - }, - Tables: map[string]*vschemapb.Table{ - table: { - ColumnVindexes: []*vschemapb.ColumnVindex{ - { - Column: "id", - Name: "xxhash", - }, - }, - }, - }, - } - - testCases := []struct { - name string - sourceShards []string - targetShards []string - moveTablesReq *vtctldatapb.MoveTablesCreateRequest - // Target Shards are in the order specifed in the targetShards slice - // with the UIDs starting at 200 and increasing by 10 for each tablet - // and shard since there's only a primary tablet per shard. - wantReqs map[uint32]*tabletmanagerdatapb.CreateVReplicationWorkflowRequest - }{ - { - name: "no in_keyrange filter -- partial, one equal shard", - moveTablesReq: &vtctldatapb.MoveTablesCreateRequest{ - Workflow: workflow, - TargetKeyspace: targetKs, - SourceKeyspace: sourceKs, - Cells: []string{"cell"}, - SourceShards: []string{"-80"}, // Partial MoveTables just for this shard - IncludeTables: []string{table}, - }, - sourceShards: []string{"-80", "80-"}, - targetShards: []string{"-80", "80-"}, - wantReqs: map[uint32]*tabletmanagerdatapb.CreateVReplicationWorkflowRequest{ - 200: { - Workflow: workflow, - WorkflowType: binlogdatapb.VReplicationWorkflowType_MoveTables, - WorkflowSubType: binlogdatapb.VReplicationWorkflowSubType_Partial, - Cells: cells, - BinlogSource: []*binlogdatapb.BinlogSource{ - { - Keyspace: sourceKs, - Shard: "-80", // Keyranges are equal between the source and target - Filter: &binlogdatapb.Filter{ - Rules: []*binlogdatapb.Rule{ - { - Match: table, - Filter: fmt.Sprintf("select * from %s", table), - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "in_keyrange filter -- unequal shards", - moveTablesReq: &vtctldatapb.MoveTablesCreateRequest{ - Workflow: workflow, - TargetKeyspace: targetKs, - SourceKeyspace: sourceKs, - Cells: []string{"cell"}, - IncludeTables: []string{table}, - }, - sourceShards: []string{"-"}, - targetShards: []string{"-80", "80-"}, - wantReqs: map[uint32]*tabletmanagerdatapb.CreateVReplicationWorkflowRequest{ - 200: { - Workflow: workflow, - WorkflowType: binlogdatapb.VReplicationWorkflowType_MoveTables, - Cells: cells, - BinlogSource: []*binlogdatapb.BinlogSource{ - { - Keyspace: sourceKs, - Shard: "-", - Filter: &binlogdatapb.Filter{ - Rules: []*binlogdatapb.Rule{ - { - Match: table, - Filter: fmt.Sprintf("select * from %s where in_keyrange(id, '%s.xxhash', '-80')", table, targetKs), - }, - }, - }, - }, - }, - }, - 210: { - Workflow: workflow, - WorkflowType: binlogdatapb.VReplicationWorkflowType_MoveTables, - Cells: cells, - BinlogSource: []*binlogdatapb.BinlogSource{ - { - Keyspace: sourceKs, - Shard: "-", - Filter: &binlogdatapb.Filter{ - Rules: []*binlogdatapb.Rule{ - { - Match: table, - Filter: fmt.Sprintf("select * from %s where in_keyrange(id, '%s.xxhash', '80-')", table, targetKs), - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "in_keyrange filter -- unequal shards on merge", - moveTablesReq: &vtctldatapb.MoveTablesCreateRequest{ - Workflow: workflow, - TargetKeyspace: targetKs, - SourceKeyspace: sourceKs, - Cells: []string{"cell"}, - IncludeTables: []string{table}, - }, - sourceShards: []string{"-80", "80-"}, - targetShards: []string{"-"}, - wantReqs: map[uint32]*tabletmanagerdatapb.CreateVReplicationWorkflowRequest{ - 200: { - Workflow: workflow, - WorkflowType: binlogdatapb.VReplicationWorkflowType_MoveTables, - Cells: cells, - BinlogSource: []*binlogdatapb.BinlogSource{ - { - Keyspace: sourceKs, - Shard: "-80", - Filter: &binlogdatapb.Filter{ - Rules: []*binlogdatapb.Rule{ - { - Match: table, - Filter: fmt.Sprintf("select * from %s where in_keyrange(id, '%s.xxhash', '-')", table, targetKs), - }, - }, - }, - }, - { - Keyspace: sourceKs, - Shard: "80-", - Filter: &binlogdatapb.Filter{ - Rules: []*binlogdatapb.Rule{ - { - Match: table, - Filter: fmt.Sprintf("select * from %s where in_keyrange(id, '%s.xxhash', '-')", table, targetKs), - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "no in_keyrange filter -- all equal shards", - moveTablesReq: &vtctldatapb.MoveTablesCreateRequest{ - Workflow: workflow, - TargetKeyspace: targetKs, - SourceKeyspace: sourceKs, - Cells: []string{"cell"}, - IncludeTables: []string{table}, + name: "no in_keyrange filter -- all equal shards", + moveTablesReq: &vtctldatapb.MoveTablesCreateRequest{ + Workflow: workflow, + TargetKeyspace: targetKs, + SourceKeyspace: sourceKs, + Cells: []string{"cell"}, + IncludeTables: []string{table}, }, sourceShards: []string{"-80", "80-"}, targetShards: []string{"-80", "80-"}, @@ -3568,8 +2445,17 @@ func TestKeyRangesEqualOptimization(t *testing.T) { workflowType: workflowType, env: vtenv.NewTestEnv(), } - err = mz.createMoveTablesStreams(tc.moveTablesReq) - require.NoError(t, err, "createMoveTablesStreams failed: %v", err) + err = mz.createWorkflowStreams(&tabletmanagerdatapb.CreateVReplicationWorkflowRequest{ + Workflow: tc.moveTablesReq.Workflow, + Cells: tc.moveTablesReq.Cells, + TabletTypes: tc.moveTablesReq.TabletTypes, + TabletSelectionPreference: tc.moveTablesReq.TabletSelectionPreference, + WorkflowType: workflowType, + DeferSecondaryKeys: tc.moveTablesReq.DeferSecondaryKeys, + AutoStart: tc.moveTablesReq.AutoStart, + StopAfterCopy: tc.moveTablesReq.StopAfterCopy, + }) + require.NoError(t, err, "createWorkflowStreams failed: %v", err) }) } } diff --git a/go/vt/vtctl/workflow/resharder.go b/go/vt/vtctl/workflow/resharder.go index 18f10f25319..95fcea3a2a9 100644 --- a/go/vt/vtctl/workflow/resharder.go +++ b/go/vt/vtctl/workflow/resharder.go @@ -19,16 +19,14 @@ package workflow import ( "context" - "errors" "fmt" "slices" "sync" "time" - "google.golang.org/protobuf/encoding/prototext" - - "vitess.io/vitess/go/sqltypes" + "vitess.io/vitess/go/textutil" "vitess.io/vitess/go/vt/concurrency" + "vitess.io/vitess/go/vt/discovery" "vitess.io/vitess/go/vt/key" "vitess.io/vitess/go/vt/schema" "vitess.io/vitess/go/vt/topo" @@ -38,7 +36,9 @@ import ( "vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication" binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" vschemapb "vitess.io/vitess/go/vt/proto/vschema" + vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" ) type resharder struct { @@ -61,14 +61,15 @@ type resharder struct { } type refStream struct { - workflow string - bls *binlogdatapb.BinlogSource - cell string - tabletTypes string + workflow string + bls *binlogdatapb.BinlogSource + cell string + tabletTypes string + workflowType binlogdatapb.VReplicationWorkflowType + workflowSubType binlogdatapb.VReplicationWorkflowSubType } func (s *Server) buildResharder(ctx context.Context, keyspace, workflow string, sources, targets []string, cell, tabletTypes string) (*resharder, error) { - ts := s.ts rs := &resharder{ s: s, keyspace: keyspace, @@ -79,7 +80,7 @@ func (s *Server) buildResharder(ctx context.Context, keyspace, workflow string, tabletTypes: tabletTypes, } for _, shard := range sources { - si, err := ts.GetShard(ctx, keyspace, shard) + si, err := s.ts.GetShard(ctx, keyspace, shard) if err != nil { return nil, vterrors.Wrapf(err, "GetShard(%s) failed", shard) } @@ -87,14 +88,14 @@ func (s *Server) buildResharder(ctx context.Context, keyspace, workflow string, return nil, fmt.Errorf("source shard %v is not in serving state", shard) } rs.sourceShards = append(rs.sourceShards, si) - primary, err := ts.GetTablet(ctx, si.PrimaryAlias) + primary, err := s.ts.GetTablet(ctx, si.PrimaryAlias) if err != nil { return nil, vterrors.Wrapf(err, "GetTablet(%s) failed", si.PrimaryAlias) } rs.sourcePrimaries[si.ShardName()] = primary } for _, shard := range targets { - si, err := ts.GetShard(ctx, keyspace, shard) + si, err := s.ts.GetShard(ctx, keyspace, shard) if err != nil { return nil, vterrors.Wrapf(err, "GetShard(%s) failed", shard) } @@ -102,7 +103,7 @@ func (s *Server) buildResharder(ctx context.Context, keyspace, workflow string, return nil, fmt.Errorf("target shard %v is in serving state", shard) } rs.targetShards = append(rs.targetShards, si) - primary, err := ts.GetTablet(ctx, si.PrimaryAlias) + primary, err := s.ts.GetTablet(ctx, si.PrimaryAlias) if err != nil { return nil, vterrors.Wrapf(err, "GetTablet(%s) failed", si.PrimaryAlias) } @@ -115,7 +116,7 @@ func (s *Server) buildResharder(ctx context.Context, keyspace, workflow string, return nil, vterrors.Wrap(err, "validateTargets") } - vschema, err := ts.GetVSchema(ctx, keyspace) + vschema, err := s.ts.GetVSchema(ctx, keyspace) if err != nil { return nil, vterrors.Wrap(err, "GetVSchema") } @@ -133,13 +134,12 @@ func (s *Server) buildResharder(ctx context.Context, keyspace, workflow string, func (rs *resharder) validateTargets(ctx context.Context) error { err := rs.forAll(rs.targetShards, func(target *topo.ShardInfo) error { targetPrimary := rs.targetPrimaries[target.ShardName()] - query := fmt.Sprintf("select 1 from _vt.vreplication where db_name=%s", encodeString(targetPrimary.DbName())) - p3qr, err := rs.s.tmc.VReplicationExec(ctx, targetPrimary.Tablet, query) + res, err := rs.s.tmc.HasVReplicationWorkflows(ctx, targetPrimary.Tablet, &tabletmanagerdatapb.HasVReplicationWorkflowsRequest{}) if err != nil { - return vterrors.Wrapf(err, "VReplicationExec(%v, %s)", targetPrimary.Tablet, query) + return vterrors.Wrapf(err, "HasVReplicationWorkflows(%v)", targetPrimary.Tablet) } - if len(p3qr.Rows) != 0 { - return errors.New("some streams already exist in the target shards, please clean them up and retry the command") + if res.Has { + return vterrors.New(vtrpcpb.Code_FAILED_PRECONDITION, "some streams already exist in the target shards, please clean them up and retry the command") } return nil }) @@ -151,12 +151,13 @@ func (rs *resharder) readRefStreams(ctx context.Context) error { err := rs.forAll(rs.sourceShards, func(source *topo.ShardInfo) error { sourcePrimary := rs.sourcePrimaries[source.ShardName()] - query := fmt.Sprintf("select workflow, source, cell, tablet_types from _vt.vreplication where db_name=%s and message != 'FROZEN'", encodeString(sourcePrimary.DbName())) - p3qr, err := rs.s.tmc.VReplicationExec(ctx, sourcePrimary.Tablet, query) + req := &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ + ExcludeFrozen: true, + } + res, err := rs.s.tmc.ReadVReplicationWorkflows(ctx, sourcePrimary.Tablet, req) if err != nil { - return vterrors.Wrapf(err, "VReplicationExec(%v, %s)", sourcePrimary.Tablet, query) + return vterrors.Wrapf(err, "ReadVReplicationWorkflows(%v, %+v)", sourcePrimary.Tablet, req) } - qr := sqltypes.Proto3ToResult(p3qr) mu.Lock() defer mu.Unlock() @@ -173,44 +174,39 @@ func (rs *resharder) readRefStreams(ctx context.Context) error { ref[k] = true } } - for _, row := range qr.Rows { - - workflow := row[0].ToString() - if workflow == "" { + for _, workflow := range res.Workflows { + if workflow.Workflow == "" { return fmt.Errorf("VReplication streams must have named workflows for migration: shard: %s:%s", source.Keyspace(), source.ShardName()) } - var bls binlogdatapb.BinlogSource - rowBytes, err := row[1].ToBytes() - if err != nil { - return err - } - if err := prototext.Unmarshal(rowBytes, &bls); err != nil { - return vterrors.Wrapf(err, "prototext.Unmarshal: %v", row) - } - isReference, err := rs.blsIsReference(&bls) - if err != nil { - return vterrors.Wrap(err, "blsIsReference") - } - if !isReference { - continue - } - refKey := fmt.Sprintf("%s:%s:%s", workflow, bls.Keyspace, bls.Shard) - if mustCreate { - rs.refStreams[refKey] = &refStream{ - workflow: workflow, - bls: &bls, - cell: row[2].ToString(), - tabletTypes: row[3].ToString(), + for _, stream := range workflow.Streams { + bls := stream.Bls + isReference, err := rs.blsIsReference(bls) + if err != nil { + return vterrors.Wrap(err, "blsIsReference") + } + if !isReference { + continue } - } else { - if !ref[refKey] { - return fmt.Errorf("streams are mismatched across source shards for workflow: %s", workflow) + refKey := fmt.Sprintf("%s:%s:%s", workflow.Workflow, bls.Keyspace, bls.Shard) + if mustCreate { + rs.refStreams[refKey] = &refStream{ + workflow: workflow.Workflow, + bls: bls, + cell: workflow.Cells, + tabletTypes: discovery.BuildTabletTypesString(workflow.TabletTypes, workflow.TabletSelectionPreference), + workflowType: workflow.WorkflowType, + workflowSubType: workflow.WorkflowSubType, + } + } else { + if !ref[refKey] { + return fmt.Errorf("streams are mismatched across source shards for workflow: %s", workflow) + } + delete(ref, refKey) } - delete(ref, refKey) } - } - if len(ref) != 0 { - return fmt.Errorf("streams are mismatched across source shards: %v", ref) + if len(ref) != 0 { + return fmt.Errorf("streams are mismatched across source shards: %v", ref) + } } return nil }) @@ -309,9 +305,8 @@ func (rs *resharder) createStreams(ctx context.Context) error { for _, rstream := range rs.refStreams { ig.AddRow(rstream.workflow, rstream.bls, "", rstream.cell, rstream.tabletTypes, - // TODO: fix based on original stream. - binlogdatapb.VReplicationWorkflowType_Reshard, - binlogdatapb.VReplicationWorkflowSubType_None, + rstream.workflowType, + rstream.workflowSubType, rs.deferSecondaryKeys) } query := ig.String() @@ -331,12 +326,16 @@ func (rs *resharder) startStreams(ctx context.Context) error { // because we've already confirmed that there were no existing workflows // on the shards when we started, and we want to start all of the ones // that we've created on the new shards as we're migrating them. - // We use the comment directive to indicate that this is intentional - // and OK. - query := fmt.Sprintf("update /*vt+ %s */ _vt.vreplication set state='Running' where db_name=%s", - vreplication.AllowUnsafeWriteCommentDirective, encodeString(targetPrimary.DbName())) - if _, err := rs.s.tmc.VReplicationExec(ctx, targetPrimary.Tablet, query); err != nil { - return vterrors.Wrapf(err, "VReplicationExec(%v, %s)", targetPrimary.Tablet, query) + req := &tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest{ + AllWorkflows: true, + State: binlogdatapb.VReplicationWorkflowState_Running, + // We don't want to update anything else so use simulated NULLs. + Message: textutil.SimulatedNullString, + StopPosition: textutil.SimulatedNullString, + } + if _, err := rs.s.tmc.UpdateVReplicationWorkflows(ctx, targetPrimary.Tablet, req); err != nil { + return vterrors.Wrapf(err, "UpdateVReplicationWorkflows(%v, 'state='%s')", + targetPrimary.Tablet, binlogdatapb.VReplicationWorkflowState_Running.String()) } return nil }) diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index 41873a5533c..33d2a9869ab 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -54,6 +54,7 @@ import ( "vitess.io/vitess/go/vt/topo/topoproto" "vitess.io/vitess/go/vt/topotools" "vitess.io/vitess/go/vt/vtctl/schematools" + "vitess.io/vitess/go/vt/vtctl/workflow/common" "vitess.io/vitess/go/vt/vtctl/workflow/vexec" "vitess.io/vitess/go/vt/vtenv" "vitess.io/vitess/go/vt/vterrors" @@ -355,6 +356,9 @@ func (s *Server) GetWorkflow(ctx context.Context, keyspace, workflow string, inc if err != nil { return nil, err } + if res == nil { + return nil, vterrors.Errorf(vtrpcpb.Code_NOT_FOUND, "%s workflow not found in the %s keyspace", workflow, keyspace) + } if len(res.Workflows) != 1 { return nil, vterrors.Errorf(vtrpcpb.Code_INTERNAL, "unexpected number of workflows returned for %s.%s; expected 1, got %d", keyspace, workflow, len(res.Workflows)) @@ -374,63 +378,62 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows defer span.Finish() span.Annotate("keyspace", req.Keyspace) + span.Annotate("workflow", req.Workflow) span.Annotate("active_only", req.ActiveOnly) span.Annotate("include_logs", req.IncludeLogs) span.Annotate("shards", req.Shards) - where := "" - predicates := []string{} + readReq := &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ + IncludeWorkflows: []string{req.Workflow}, + } if req.ActiveOnly { - predicates = append(predicates, "state <> 'Stopped'") - } - if req.Workflow != "" { - predicates = append(predicates, fmt.Sprintf("workflow = '%s'", req.Workflow)) - } - if len(predicates) > 0 { - where = fmt.Sprintf("WHERE %s", strings.Join(predicates, " AND ")) - } - - query := fmt.Sprintf(` - SELECT - id, - workflow, - source, - pos, - stop_pos, - max_replication_lag, - state, - db_name, - time_updated, - transaction_timestamp, - message, - tags, - workflow_type, - workflow_sub_type, - time_heartbeat, - defer_secondary_keys, - component_throttled, - time_throttled, - rows_copied, - tablet_types, - cell - FROM - _vt.vreplication - %s`, - where, - ) + readReq.ExcludeStates = []binlogdatapb.VReplicationWorkflowState{binlogdatapb.VReplicationWorkflowState_Stopped} + } - vx := vexec.NewVExec(req.Keyspace, "", s.ts, s.tmc, s.env.Parser()) - vx.SetShardSubset(req.Shards) - results, err := vx.QueryContext(ctx, query) + // Guards access to the maps used throughout. + m := sync.Mutex{} + + shards, err := common.GetShards(ctx, s.ts, req.Keyspace, req.Shards) if err != nil { return nil, err } - - m := sync.Mutex{} // guards access to the following maps during concurrent calls to fetchCopyStates and scanWorkflow + results := make(map[*topo.TabletInfo]*tabletmanagerdatapb.ReadVReplicationWorkflowsResponse, len(shards)) + readWorkflowsEg, readWorkflowsCtx := errgroup.WithContext(ctx) + for _, shard := range shards { + readWorkflowsEg.Go(func() error { + si, err := s.ts.GetShard(readWorkflowsCtx, req.Keyspace, shard) + if err != nil { + return err + } + if si.PrimaryAlias == nil { + return fmt.Errorf("%w %s/%s", vexec.ErrNoShardPrimary, req.Keyspace, shard) + } + primary, err := s.ts.GetTablet(readWorkflowsCtx, si.PrimaryAlias) + if err != nil { + return err + } + if primary == nil { + return fmt.Errorf("%w %s/%s: tablet %v not found", vexec.ErrNoShardPrimary, req.Keyspace, shard, topoproto.TabletAliasString(si.PrimaryAlias)) + } + // Clone the request so that we can set the correct DB name for tablet. + req := readReq.CloneVT() + wres, err := s.tmc.ReadVReplicationWorkflows(readWorkflowsCtx, primary.Tablet, req) + if err != nil { + return err + } + m.Lock() + defer m.Unlock() + results[primary] = wres + return nil + }) + } + if readWorkflowsEg.Wait() != nil { + return nil, err + } copyStatesByShardStreamId := make(map[string][]*vtctldatapb.Workflow_Stream_CopyState, len(results)) - fetchCopyStates := func(ctx context.Context, tablet *topo.TabletInfo, streamIds []int64) error { + fetchCopyStates := func(ctx context.Context, tablet *topo.TabletInfo, streamIds []int32) error { span, ctx := trace.NewSpan(ctx, "workflow.Server.fetchCopyStates") defer span.Finish() @@ -458,18 +461,14 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows } fetchCopyStatesEg, fetchCopyStatesCtx := errgroup.WithContext(ctx) - for tablet, result := range results { - qr := sqltypes.Proto3ToResult(result) tablet := tablet // loop closure - streamIds := make([]int64, 0, len(qr.Rows)) - for _, row := range qr.Named().Rows { - streamId, err := row.ToInt64("id") - if err != nil { - return nil, err + streamIds := make([]int32, 0, len(result.Workflows)) + for _, wf := range result.Workflows { + for _, stream := range wf.Streams { + streamIds = append(streamIds, stream.Id) } - streamIds = append(streamIds, streamId) } if len(streamIds) == 0 { @@ -500,246 +499,168 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows // - sourceShardsByWorkflow[workflow.Name] != nil // - targetShardsByWorkflow[workflow.Name] != nil // - workflow.ShardStatuses != nil - scanWorkflow := func(ctx context.Context, workflow *vtctldatapb.Workflow, row sqltypes.RowNamedValues, tablet *topo.TabletInfo) error { - span, ctx := trace.NewSpan(ctx, "workflow.Server.scanWorkflow") - defer span.Finish() - - span.Annotate("keyspace", req.Keyspace) - span.Annotate("shard", tablet.Shard) - span.Annotate("active_only", req.ActiveOnly) - span.Annotate("workflow", workflow.Name) - span.Annotate("tablet_alias", tablet.AliasString()) - - id, err := row["id"].ToCastInt64() - if err != nil { - return err - } - - var bls binlogdatapb.BinlogSource - rowBytes, err := row["source"].ToBytes() - if err != nil { - return err - } - if err := prototext.Unmarshal(rowBytes, &bls); err != nil { - return err - } - // The value in the pos column can be compressed and thus not - // have a valid GTID consisting of valid UTF-8 characters so we - // have to decode it so that it's properly decompressed first - // when needed. - pos, err := row.ToString("pos") - if err != nil { - return err - } - if pos != "" { - mpos, err := binlogplayer.DecodePosition(pos) - if err != nil { - return err + scanWorkflow := func(ctx context.Context, workflow *vtctldatapb.Workflow, res *tabletmanagerdatapb.ReadVReplicationWorkflowResponse, tablet *topo.TabletInfo) error { + // This is not called concurrently, but we still protect the maps to ensure + // that we're concurrency-safe in the face of future changes (e.g. where other + // things are running concurrently with this which also access these maps). + m.Lock() + defer m.Unlock() + for _, rstream := range res.Streams { + // The value in the pos column can be compressed and thus not + // have a valid GTID consisting of valid UTF-8 characters so we + // have to decode it so that it's properly decompressed first + // when needed. + pos := rstream.Pos + if pos != "" { + mpos, err := binlogplayer.DecodePosition(pos) + if err != nil { + return err + } + pos = mpos.String() + } + + cells := strings.Split(res.Cells, ",") + for i := range cells { + cells[i] = strings.TrimSpace(cells[i]) + } + + stream := &vtctldatapb.Workflow_Stream{ + Id: int64(rstream.Id), + Shard: tablet.Shard, + Tablet: tablet.Alias, + BinlogSource: rstream.Bls, + Position: pos, + StopPosition: rstream.StopPos, + State: rstream.State.String(), + DbName: tablet.DbName(), + TabletTypes: res.TabletTypes, + TabletSelectionPreference: res.TabletSelectionPreference, + Cells: cells, + TransactionTimestamp: rstream.TransactionTimestamp, + TimeUpdated: rstream.TimeUpdated, + Message: rstream.Message, + Tags: strings.Split(res.Tags, ","), + RowsCopied: rstream.RowsCopied, + ThrottlerStatus: &vtctldatapb.Workflow_Stream_ThrottlerStatus{ + ComponentThrottled: rstream.ComponentThrottled, + TimeThrottled: rstream.TimeThrottled, + }, } - pos = mpos.String() - } - - stopPos := row["stop_pos"].ToString() - state := row["state"].ToString() - dbName := row["db_name"].ToString() - - timeUpdatedSeconds, err := row["time_updated"].ToCastInt64() - if err != nil { - return err - } - - transactionTimeSeconds, err := row["transaction_timestamp"].ToCastInt64() - if err != nil { - return err - } - message := row["message"].ToString() - - tags := row["tags"].ToString() - var tagArray []string - if tags != "" { - tagArray = strings.Split(tags, ",") - } + // Merge in copy states, which we've already fetched. + shardStreamId := fmt.Sprintf("%s/%d", tablet.Shard, stream.Id) + if copyState, ok := copyStatesByShardStreamId[shardStreamId]; ok { + stream.CopyStates = copyState + } - workflowType, _ := row["workflow_type"].ToInt32() - workflowSubType, _ := row["workflow_sub_type"].ToInt32() + if rstream.TimeUpdated == nil { + rstream.TimeUpdated = &vttimepb.Time{} + } - timeHeartbeat, err := row["time_heartbeat"].ToCastInt64() - if err != nil { - return err - } + switch { + case strings.Contains(strings.ToLower(stream.Message), "error"): + stream.State = binlogdatapb.VReplicationWorkflowState_Error.String() + case stream.State == binlogdatapb.VReplicationWorkflowState_Running.String() && len(stream.CopyStates) > 0: + stream.State = binlogdatapb.VReplicationWorkflowState_Copying.String() + case stream.State == binlogdatapb.VReplicationWorkflowState_Running.String() && int64(time.Now().Second())-rstream.TimeUpdated.Seconds > 10: + stream.State = binlogdatapb.VReplicationWorkflowState_Lagging.String() + } - componentThrottled := row["component_throttled"].ToString() - timeThrottled, err := row["time_throttled"].ToCastInt64() - if err != nil { - return err - } + shardStreamKey := fmt.Sprintf("%s/%s", tablet.Shard, tablet.AliasString()) + shardStream, ok := workflow.ShardStreams[shardStreamKey] + if !ok { + ctx, cancel := context.WithTimeout(ctx, topo.RemoteOperationTimeout) + defer cancel() - deferSecondaryKeys, err := row["defer_secondary_keys"].ToBool() - if err != nil { - return err - } + si, err := s.ts.GetShard(ctx, req.Keyspace, tablet.Shard) + if err != nil { + return err + } - rowsCopied, err := row["rows_copied"].ToCastInt64() - if err != nil { - return err - } + shardStream = &vtctldatapb.Workflow_ShardStream{ + Streams: nil, + TabletControls: si.TabletControls, + IsPrimaryServing: si.IsPrimaryServing, + } - tabletTypes, inOrder, err := discovery.ParseTabletTypesAndOrder(row["tablet_types"].ToString()) - if err != nil { - return err - } - tsp := tabletmanagerdatapb.TabletSelectionPreference_ANY - if inOrder { - tsp = tabletmanagerdatapb.TabletSelectionPreference_INORDER - } - cells := strings.Split(row["cell"].ToString(), ",") - for i, cell := range cells { - cells[i] = strings.TrimSpace(cell) - } - - stream := &vtctldatapb.Workflow_Stream{ - Id: id, - Shard: tablet.Shard, - Tablet: tablet.Alias, - BinlogSource: &bls, - Position: pos, - StopPosition: stopPos, - State: state, - DbName: dbName, - TabletTypes: tabletTypes, - TabletSelectionPreference: tsp, - Cells: cells, - TransactionTimestamp: &vttimepb.Time{ - Seconds: transactionTimeSeconds, - }, - TimeUpdated: &vttimepb.Time{ - Seconds: timeUpdatedSeconds, - }, - Message: message, - Tags: tagArray, - RowsCopied: rowsCopied, - ThrottlerStatus: &vtctldatapb.Workflow_Stream_ThrottlerStatus{ - ComponentThrottled: componentThrottled, - TimeThrottled: &vttimepb.Time{ - Seconds: timeThrottled, - }, - }, - } + workflow.ShardStreams[shardStreamKey] = shardStream + } - // Merge in copy states, which we've already fetched. - shardStreamId := fmt.Sprintf("%s/%d", tablet.Shard, id) - if copyState, ok := copyStatesByShardStreamId[shardStreamId]; ok { - stream.CopyStates = copyState - } + shardStream.Streams = append(shardStream.Streams, stream) + sourceShardsByWorkflow[workflow.Name].Insert(stream.BinlogSource.Shard) + targetShardsByWorkflow[workflow.Name].Insert(tablet.Shard) - // At this point, we're going to start modifying the maps defined - // outside this function, as well as fields on the passed-in Workflow - // pointer. Since we're running concurrently, take the lock. - m.Lock() - defer m.Unlock() + if ks, ok := sourceKeyspaceByWorkflow[workflow.Name]; ok && ks != stream.BinlogSource.Keyspace { + return vterrors.Wrapf(ErrMultipleSourceKeyspaces, "workflow = %v, ks1 = %v, ks2 = %v", workflow.Name, ks, stream.BinlogSource.Keyspace) + } - workflow.WorkflowType = binlogdatapb.VReplicationWorkflowType_name[workflowType] - workflow.WorkflowSubType = binlogdatapb.VReplicationWorkflowSubType_name[workflowSubType] - workflow.DeferSecondaryKeys = deferSecondaryKeys + sourceKeyspaceByWorkflow[workflow.Name] = stream.BinlogSource.Keyspace - switch { - case strings.Contains(strings.ToLower(stream.Message), "error"): - stream.State = binlogdatapb.VReplicationWorkflowState_Error.String() - case stream.State == binlogdatapb.VReplicationWorkflowState_Running.String() && len(stream.CopyStates) > 0: - stream.State = binlogdatapb.VReplicationWorkflowState_Copying.String() - case stream.State == binlogdatapb.VReplicationWorkflowState_Running.String() && int64(time.Now().Second())-timeUpdatedSeconds > 10: - stream.State = binlogdatapb.VReplicationWorkflowState_Lagging.String() - } + if ks, ok := targetKeyspaceByWorkflow[workflow.Name]; ok && ks != tablet.Keyspace { + return vterrors.Wrapf(ErrMultipleTargetKeyspaces, "workflow = %v, ks1 = %v, ks2 = %v", workflow.Name, ks, tablet.Keyspace) + } - shardStreamKey := fmt.Sprintf("%s/%s", tablet.Shard, tablet.AliasString()) - shardStream, ok := workflow.ShardStreams[shardStreamKey] - if !ok { - ctx, cancel := context.WithTimeout(ctx, topo.RemoteOperationTimeout) - defer cancel() + targetKeyspaceByWorkflow[workflow.Name] = tablet.Keyspace - si, err := s.ts.GetShard(ctx, req.Keyspace, tablet.Shard) - if err != nil { - return err + if stream.TimeUpdated == nil { + stream.TimeUpdated = &vttimepb.Time{} } + timeUpdated := time.Unix(stream.TimeUpdated.Seconds, 0) + vreplicationLag := time.Since(timeUpdated) - shardStream = &vtctldatapb.Workflow_ShardStream{ - Streams: nil, - TabletControls: si.TabletControls, - IsPrimaryServing: si.IsPrimaryServing, + // MaxVReplicationLag represents the time since we last processed any event + // in the workflow. + if currentMaxLag, ok := maxVReplicationLagByWorkflow[workflow.Name]; ok { + if vreplicationLag.Seconds() > currentMaxLag { + maxVReplicationLagByWorkflow[workflow.Name] = vreplicationLag.Seconds() + } + } else { + maxVReplicationLagByWorkflow[workflow.Name] = vreplicationLag.Seconds() } - workflow.ShardStreams[shardStreamKey] = shardStream - } - - shardStream.Streams = append(shardStream.Streams, stream) - sourceShardsByWorkflow[workflow.Name].Insert(stream.BinlogSource.Shard) - targetShardsByWorkflow[workflow.Name].Insert(tablet.Shard) - - if ks, ok := sourceKeyspaceByWorkflow[workflow.Name]; ok && ks != stream.BinlogSource.Keyspace { - return vterrors.Wrapf(ErrMultipleSourceKeyspaces, "workflow = %v, ks1 = %v, ks2 = %v", workflow.Name, ks, stream.BinlogSource.Keyspace) - } - - sourceKeyspaceByWorkflow[workflow.Name] = stream.BinlogSource.Keyspace + workflow.WorkflowType = res.WorkflowType.String() + workflow.WorkflowSubType = res.WorkflowSubType.String() + workflow.DeferSecondaryKeys = res.DeferSecondaryKeys - if ks, ok := targetKeyspaceByWorkflow[workflow.Name]; ok && ks != tablet.Keyspace { - return vterrors.Wrapf(ErrMultipleTargetKeyspaces, "workflow = %v, ks1 = %v, ks2 = %v", workflow.Name, ks, tablet.Keyspace) - } - - targetKeyspaceByWorkflow[workflow.Name] = tablet.Keyspace - - timeUpdated := time.Unix(timeUpdatedSeconds, 0) - vreplicationLag := time.Since(timeUpdated) - - // MaxVReplicationLag represents the time since we last processed any event - // in the workflow. - if currentMaxLag, ok := maxVReplicationLagByWorkflow[workflow.Name]; ok { - if vreplicationLag.Seconds() > currentMaxLag { - maxVReplicationLagByWorkflow[workflow.Name] = vreplicationLag.Seconds() + // MaxVReplicationTransactionLag estimates the actual statement processing lag + // between the source and the target. If we are still processing source events it + // is the difference b/w current time and the timestamp of the last event. If + // heartbeats are more recent than the last event, then the lag is the time since + // the last heartbeat as there can be an actual event immediately after the + // heartbeat, but which has not yet been processed on the target. + // We don't allow switching during the copy phase, so in that case we just return + // a large lag. All timestamps are in seconds since epoch. + if _, ok := maxVReplicationTransactionLagByWorkflow[workflow.Name]; !ok { + maxVReplicationTransactionLagByWorkflow[workflow.Name] = 0 } - } else { - maxVReplicationLagByWorkflow[workflow.Name] = vreplicationLag.Seconds() - } - - // MaxVReplicationTransactionLag estimates the actual statement processing lag - // between the source and the target. If we are still processing source events it - // is the difference b/w current time and the timestamp of the last event. If - // heartbeats are more recent than the last event, then the lag is the time since - // the last heartbeat as there can be an actual event immediately after the - // heartbeat, but which has not yet been processed on the target. - // We don't allow switching during the copy phase, so in that case we just return - // a large lag. All timestamps are in seconds since epoch. - if _, ok := maxVReplicationTransactionLagByWorkflow[workflow.Name]; !ok { - maxVReplicationTransactionLagByWorkflow[workflow.Name] = 0 - } - lastTransactionTime := transactionTimeSeconds - lastHeartbeatTime := timeHeartbeat - if stream.State == binlogdatapb.VReplicationWorkflowState_Copying.String() { - maxVReplicationTransactionLagByWorkflow[workflow.Name] = math.MaxInt64 - } else { - if lastTransactionTime == 0 /* no new events after copy */ || - lastHeartbeatTime > lastTransactionTime /* no recent transactions, so all caught up */ { - - lastTransactionTime = lastHeartbeatTime + if rstream.TransactionTimestamp == nil { + rstream.TransactionTimestamp = &vttimepb.Time{} } - now := time.Now().Unix() /* seconds since epoch */ - transactionReplicationLag := float64(now - lastTransactionTime) - if transactionReplicationLag > maxVReplicationTransactionLagByWorkflow[workflow.Name] { - maxVReplicationTransactionLagByWorkflow[workflow.Name] = transactionReplicationLag + lastTransactionTime := rstream.TransactionTimestamp.Seconds + if rstream.TimeHeartbeat == nil { + rstream.TimeHeartbeat = &vttimepb.Time{} + } + lastHeartbeatTime := rstream.TimeHeartbeat.Seconds + if stream.State == binlogdatapb.VReplicationWorkflowState_Copying.String() { + maxVReplicationTransactionLagByWorkflow[workflow.Name] = math.MaxInt64 + } else { + if lastTransactionTime == 0 /* no new events after copy */ || + lastHeartbeatTime > lastTransactionTime /* no recent transactions, so all caught up */ { + + lastTransactionTime = lastHeartbeatTime + } + now := time.Now().Unix() /* seconds since epoch */ + transactionReplicationLag := float64(now - lastTransactionTime) + if transactionReplicationLag > maxVReplicationTransactionLagByWorkflow[workflow.Name] { + maxVReplicationTransactionLagByWorkflow[workflow.Name] = transactionReplicationLag + } } } return nil } - var ( - scanWorkflowWg sync.WaitGroup - scanWorkflowErrors concurrency.FirstErrorRecorder - ) - for tablet, result := range results { - qr := sqltypes.Proto3ToResult(result) - // In the old implementation, we knew we had at most one (0 <= N <= 1) // workflow for each shard primary we queried. There might be multiple // rows (streams) comprising that workflow, so we would aggregate the @@ -751,8 +672,8 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows // to a workflow we're already aggregating, or if it's a workflow we // haven't seen yet for that shard primary. We use the workflow name to // dedupe for this. - for _, row := range qr.Named().Rows { - workflowName := row["workflow"].ToString() + for _, wfres := range result.Workflows { + workflowName := wfres.Workflow workflow, ok := workflowsMap[workflowName] if !ok { workflow = &vtctldatapb.Workflow{ @@ -765,21 +686,12 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows targetShardsByWorkflow[workflowName] = sets.New[string]() } - scanWorkflowWg.Add(1) - go func(ctx context.Context, workflow *vtctldatapb.Workflow, row sqltypes.RowNamedValues, tablet *topo.TabletInfo) { - defer scanWorkflowWg.Done() - if err := scanWorkflow(ctx, workflow, row, tablet); err != nil { - scanWorkflowErrors.RecordError(err) - } - }(ctx, workflow, row, tablet) + if err := scanWorkflow(ctx, workflow, wfres, tablet); err != nil { + return nil, err + } } } - scanWorkflowWg.Wait() - if scanWorkflowErrors.HasErrors() { - return nil, scanWorkflowErrors.Error() - } - var ( fetchLogsWG sync.WaitGroup vrepLogQuery = strings.TrimSpace(` @@ -824,7 +736,8 @@ ORDER BY return } - results, err := vx.WithWorkflow(workflow.Name).QueryContext(ctx, query) + vx := vexec.NewVExec(req.Keyspace, workflow.Name, s.ts, s.tmc, s.SQLParser()) + results, err := vx.QueryContext(ctx, query) if err != nil { // Note that we do not return here. If there are any query results // in the map (i.e. some tablets returned successfully), we will @@ -1130,7 +1043,7 @@ func (s *Server) getWorkflowState(ctx context.Context, targetKeyspace, workflowN return ts, state, nil } -func (s *Server) getWorkflowCopyStates(ctx context.Context, tablet *topo.TabletInfo, streamIds []int64) ([]*vtctldatapb.Workflow_Stream_CopyState, error) { +func (s *Server) getWorkflowCopyStates(ctx context.Context, tablet *topo.TabletInfo, streamIds []int32) ([]*vtctldatapb.Workflow_Stream_CopyState, error) { span, ctx := trace.NewSpan(ctx, "workflow.Server.getWorkflowCopyStates") defer span.Finish() @@ -1260,42 +1173,29 @@ func (s *Server) LookupVindexExternalize(ctx context.Context, req *vtctldatapb.L if err != nil { return err } - p3qr, err := s.tmc.VReplicationExec(ctx, targetPrimary.Tablet, fmt.Sprintf("select id, state, message, source from _vt.vreplication where workflow=%s and db_name=%s", encodeString(req.Name), encodeString(targetPrimary.DbName()))) + res, err := s.tmc.ReadVReplicationWorkflow(ctx, targetPrimary.Tablet, &tabletmanagerdatapb.ReadVReplicationWorkflowRequest{ + Workflow: req.Name, + }) if err != nil { return err } - qr := sqltypes.Proto3ToResult(p3qr) - if qr == nil || len(qr.Rows) == 0 { + if res == nil { return vterrors.Errorf(vtrpcpb.Code_NOT_FOUND, "workflow %s not found on %v", req.Name, targetPrimary.Alias) } - for _, row := range qr.Rows { - id, err := row[0].ToCastInt64() - if err != nil { - return err - } - state := binlogdatapb.VReplicationWorkflowState(binlogdatapb.VReplicationWorkflowState_value[row[1].ToString()]) - message := row[2].ToString() - var bls binlogdatapb.BinlogSource - sourceBytes, err := row[3].ToBytes() - if err != nil { - return err - } - if err := prototext.Unmarshal(sourceBytes, &bls); err != nil { - return err - } - if bls.Filter == nil || len(bls.Filter.Rules) != 1 { + for _, stream := range res.Streams { + if stream.Bls.Filter == nil || len(stream.Bls.Filter.Rules) != 1 { return vterrors.Errorf(vtrpcpb.Code_INTERNAL, "invalid binlog source") } - if vindex.Owner == "" || !bls.StopAfterCopy { + if vindex.Owner == "" || !stream.Bls.StopAfterCopy { // If there's no owner or we've requested that the workflow NOT be stopped // after the copy phase completes, then all streams need to be running. - if state != binlogdatapb.VReplicationWorkflowState_Running { - return vterrors.Errorf(vtrpcpb.Code_FAILED_PRECONDITION, "stream %d for %v.%v is not in Running state: %v", id, targetShard.Keyspace(), targetShard.ShardName(), state) + if stream.State != binlogdatapb.VReplicationWorkflowState_Running { + return vterrors.Errorf(vtrpcpb.Code_FAILED_PRECONDITION, "stream %d for %v.%v is not in Running state: %v", stream.Id, targetShard.Keyspace(), targetShard.ShardName(), stream.State) } } else { // If there is an owner, all streams need to be stopped after copy. - if state != binlogdatapb.VReplicationWorkflowState_Stopped || !strings.Contains(message, "Stopped after copy") { - return vterrors.Errorf(vtrpcpb.Code_FAILED_PRECONDITION, "stream %d for %v.%v is not in Stopped after copy state: %v, %v", id, targetShard.Keyspace(), targetShard.ShardName(), state, message) + if stream.State != binlogdatapb.VReplicationWorkflowState_Stopped || !strings.Contains(stream.Message, "Stopped after copy") { + return vterrors.Errorf(vtrpcpb.Code_FAILED_PRECONDITION, "stream %d for %v.%v is not in Stopped after copy state: %v, %v", stream.Id, targetShard.Keyspace(), targetShard.ShardName(), stream.State, stream.Message) } } } @@ -1342,7 +1242,26 @@ func (s *Server) Materialize(ctx context.Context, ms *vtctldatapb.MaterializeSet env: s.env, } - err := mz.createMaterializerStreams() + tt, err := topoproto.ParseTabletTypes(ms.TabletTypes) + if err != nil { + return err + } + + cells := strings.Split(ms.Cell, ",") + for i := range cells { + cells[i] = strings.TrimSpace(cells[i]) + } + + err = mz.createWorkflowStreams(&tabletmanagerdatapb.CreateVReplicationWorkflowRequest{ + Workflow: ms.Workflow, + Cells: strings.Split(ms.Cell, ","), + TabletTypes: tt, + TabletSelectionPreference: ms.TabletSelectionPreference, + WorkflowType: mz.getWorkflowType(), + DeferSecondaryKeys: ms.DeferSecondaryKeys, + AutoStart: true, + StopAfterCopy: ms.StopAfterCopy, + }) if err != nil { return err } @@ -1359,11 +1278,12 @@ func (s *Server) MoveTablesCreate(ctx context.Context, req *vtctldatapb.MoveTabl func (s *Server) moveTablesCreate(ctx context.Context, req *vtctldatapb.MoveTablesCreateRequest, workflowType binlogdatapb.VReplicationWorkflowType, ) (res *vtctldatapb.WorkflowStatusResponse, err error) { - span, ctx := trace.NewSpan(ctx, "workflow.Server.MoveTablesCreate") + span, ctx := trace.NewSpan(ctx, "workflow.Server.moveTablesCreate") defer span.Finish() span.Annotate("keyspace", req.TargetKeyspace) span.Annotate("workflow", req.Workflow) + span.Annotate("workflow_type", workflowType) span.Annotate("cells", req.Cells) span.Annotate("tablet_types", req.TabletTypes) span.Annotate("on_ddl", req.OnDdl) @@ -1480,7 +1400,16 @@ func (s *Server) moveTablesCreate(ctx context.Context, req *vtctldatapb.MoveTabl workflowType: workflowType, env: s.env, } - err = mz.createMoveTablesStreams(req) + err = mz.createWorkflowStreams(&tabletmanagerdatapb.CreateVReplicationWorkflowRequest{ + Workflow: req.Workflow, + Cells: req.Cells, + TabletTypes: req.TabletTypes, + TabletSelectionPreference: req.TabletSelectionPreference, + WorkflowType: mz.workflowType, + DeferSecondaryKeys: req.DeferSecondaryKeys, + AutoStart: req.AutoStart, + StopAfterCopy: req.StopAfterCopy, + }) if err != nil { return nil, err } @@ -1673,10 +1602,7 @@ func (s *Server) ReshardCreate(ctx context.Context, req *vtctldatapb.ReshardCrea log.Errorf("%w", err2) return nil, err } - tabletTypesStr := topoproto.MakeStringTypeCSV(req.TabletTypes) - if req.TabletSelectionPreference == tabletmanagerdatapb.TabletSelectionPreference_INORDER { - tabletTypesStr = discovery.InOrderHint + tabletTypesStr - } + tabletTypesStr := discovery.BuildTabletTypesString(req.TabletTypes, req.TabletSelectionPreference) rs, err := s.buildResharder(ctx, keyspace, req.Workflow, req.SourceShards, req.TargetShards, strings.Join(cells, ","), tabletTypesStr) if err != nil { return nil, vterrors.Wrap(err, "buildResharder") @@ -1701,7 +1627,7 @@ func (s *Server) ReshardCreate(ctx context.Context, req *vtctldatapb.ReshardCrea log.Warningf("Streams will not be started since --auto-start is set to false") } return s.WorkflowStatus(ctx, &vtctldatapb.WorkflowStatusRequest{ - Keyspace: keyspace, + Keyspace: req.Keyspace, Workflow: req.Workflow, }) } @@ -1723,10 +1649,7 @@ func (s *Server) VDiffCreate(ctx context.Context, req *vtctldatapb.VDiffCreateRe span.Annotate("auto_retry", req.AutoRetry) span.Annotate("max_diff_duration", req.MaxDiffDuration) - tabletTypesStr := topoproto.MakeStringTypeCSV(req.TabletTypes) - if req.TabletSelectionPreference == tabletmanagerdatapb.TabletSelectionPreference_INORDER { - tabletTypesStr = discovery.InOrderHint + tabletTypesStr - } + tabletTypesStr := discovery.BuildTabletTypesString(req.TabletTypes, req.TabletSelectionPreference) // This is a pointer so there's no ZeroValue in the message // and an older v18 client will not provide it. @@ -2073,6 +1996,9 @@ func (s *Server) WorkflowStatus(ctx context.Context, req *vtctldatapb.WorkflowSt if updateLag > 0*1e9 { info = append(info, "VStream may not be running") } + if st.TransactionTimestamp == nil { + st.TransactionTimestamp = &vttimepb.Time{} + } txLag := int64(now) - st.TransactionTimestamp.Seconds info = append(info, fmt.Sprintf("VStream Lag: %ds", txLag/1e9)) if st.TransactionTimestamp.Seconds > 0 { // if no events occur after copy phase, TransactionTimeStamp can be 0 @@ -2338,25 +2264,20 @@ func (s *Server) collectTargetStreams(ctx context.Context, mz *materializer) ([] var shardTablets []string var mu sync.Mutex err := mz.forAllTargets(func(target *topo.ShardInfo) error { - var qrproto *querypb.QueryResult - var id int64 var err error targetPrimary, err := s.ts.GetTablet(ctx, target.PrimaryAlias) if err != nil { return vterrors.Wrapf(err, "GetTablet(%v) failed", target.PrimaryAlias) } - query := fmt.Sprintf("select id from _vt.vreplication where db_name=%s and workflow=%s", encodeString(targetPrimary.DbName()), encodeString(mz.ms.Workflow)) - if qrproto, err = s.tmc.VReplicationExec(ctx, targetPrimary.Tablet, query); err != nil { - return vterrors.Wrapf(err, "VReplicationExec(%v, %s)", targetPrimary.Tablet, query) + res, err := s.tmc.ReadVReplicationWorkflow(ctx, targetPrimary.Tablet, &tabletmanagerdatapb.ReadVReplicationWorkflowRequest{ + Workflow: mz.ms.Workflow, + }) + if err != nil { + return vterrors.Wrapf(err, "failed to read vreplication workflow on %+v", targetPrimary.Tablet) } - qr := sqltypes.Proto3ToResult(qrproto) - for i := 0; i < len(qr.Rows); i++ { - id, err = qr.Rows[i][0].ToCastInt64() - if err != nil { - return err - } + for _, stream := range res.Streams { mu.Lock() - shardTablets = append(shardTablets, fmt.Sprintf("%s:%d", target.ShardName(), id)) + shardTablets = append(shardTablets, fmt.Sprintf("%s:%d", target.ShardName(), stream.Id)) mu.Unlock() } return nil diff --git a/go/vt/vtctl/workflow/stream_migrator.go b/go/vt/vtctl/workflow/stream_migrator.go index 751ad5c49dd..06cee856319 100644 --- a/go/vt/vtctl/workflow/stream_migrator.go +++ b/go/vt/vtctl/workflow/stream_migrator.go @@ -38,6 +38,7 @@ import ( "vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication" binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" ) /* @@ -107,6 +108,42 @@ func BuildStreamMigrator(ctx context.Context, ts ITrafficSwitcher, cancelMigrate return sm, nil } +// BuildLegacyStreamMigrator creates a new StreamMigrator based on the given +// TrafficSwitcher using the legacy VReplicationExec method. +// Note: this should be removed along with the vtctl client code / wrangler. +func BuildLegacyStreamMigrator(ctx context.Context, ts ITrafficSwitcher, cancelMigrate bool, parser *sqlparser.Parser) (*StreamMigrator, error) { + sm := &StreamMigrator{ + ts: ts, + logger: ts.Logger(), + parser: parser, + } + + if sm.ts.MigrationType() == binlogdatapb.MigrationType_TABLES { + // Source streams should be stopped only for shard migrations. + return sm, nil + } + + var err error + + sm.streams, err = sm.legacyReadSourceStreams(ctx, cancelMigrate) + if err != nil { + return nil, err + } + + // Loop executes only once. + for _, tabletStreams := range sm.streams { + tmpl, err := sm.templatize(ctx, tabletStreams) + if err != nil { + return nil, err + } + + sm.workflows = VReplicationStreams(tmpl).Workflows() + break + } + + return sm, nil +} + // StreamMigratorFinalize finalizes the stream migration. // // (TODO:@ajm88) in the original implementation, "it's a standalone function @@ -193,6 +230,25 @@ func (sm *StreamMigrator) MigrateStreams(ctx context.Context) error { return sm.createTargetStreams(ctx, sm.templates) } +// LegacyStopStreams stops streams using the legacy VReplicationExec method. +// Note: this should be removed along with the vtctl client code / wrangler. +func (sm *StreamMigrator) LegacyStopStreams(ctx context.Context) ([]string, error) { + if sm.streams == nil { + return nil, nil + } + + if err := sm.legacyStopSourceStreams(ctx); err != nil { + return nil, err + } + + positions, err := sm.syncSourceStreams(ctx) + if err != nil { + return nil, err + } + + return sm.legacyVerifyStreamPositions(ctx, positions) +} + // StopStreams stops streams func (sm *StreamMigrator) StopStreams(ctx context.Context) ([]string, error) { if sm.streams == nil { @@ -214,8 +270,10 @@ func (sm *StreamMigrator) StopStreams(ctx context.Context) ([]string, error) { /* tablet streams */ // readTabletStreams reads all of the VReplication workflow streams *except* -// the Reshard workflow's reverse variant. -func (sm *StreamMigrator) readTabletStreams(ctx context.Context, ti *topo.TabletInfo, constraint string) ([]*VReplicationStream, error) { +// the Reshard workflow's reverse variant using the legacy VReplicationExec +// method. +// Note: this should be removed along with the vtctl client code / wrangler. +func (sm *StreamMigrator) legacyReadTabletStreams(ctx context.Context, ti *topo.TabletInfo, constraint string) ([]*VReplicationStream, error) { query := fmt.Sprintf("select id, workflow, source, pos, workflow_type, workflow_sub_type, defer_secondary_keys from _vt.vreplication where db_name=%s and workflow != %s", encodeString(ti.DbName()), encodeString(sm.ts.ReverseWorkflowName())) if constraint != "" { @@ -297,8 +355,174 @@ func (sm *StreamMigrator) readTabletStreams(ctx context.Context, ti *topo.Tablet return tabletStreams, nil } +// readTabletStreams reads all of the VReplication workflow streams *except* +// the Reshard workflow's reverse variant. +func (sm *StreamMigrator) readTabletStreams(ctx context.Context, ti *topo.TabletInfo, ids []int32, states []binlogdatapb.VReplicationWorkflowState, excludeFrozen bool) ([]*VReplicationStream, error) { + req := &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ + ExcludeWorkflows: []string{sm.ts.ReverseWorkflowName()}, + IncludeIds: ids, + IncludeStates: states, + ExcludeFrozen: excludeFrozen, + } + + res, err := sm.ts.TabletManagerClient().ReadVReplicationWorkflows(ctx, ti.Tablet, req) + if err != nil { + return nil, err + } + + tabletStreams := make([]*VReplicationStream, 0, len(res.Workflows)) + + for _, workflow := range res.Workflows { + switch workflow.Workflow { + case "": + return nil, fmt.Errorf("VReplication streams must have named workflows for migration: shard: %s:%s", + ti.Keyspace, ti.Shard) + case sm.ts.WorkflowName(): + return nil, fmt.Errorf("VReplication stream has the same workflow name as the resharding workflow: shard: %s:%s", + ti.Keyspace, ti.Shard) + } + + for _, stream := range workflow.Streams { + isReference, err := sm.blsIsReference(stream.Bls) + if err != nil { + return nil, vterrors.Wrap(err, "blsIsReference") + } + + if isReference { + sm.ts.Logger().Infof("readTabletStreams: ignoring reference table %+v", stream.Bls) + continue + } + + pos, err := replication.DecodePosition(stream.Pos) + if err != nil { + return nil, err + } + + tabletStreams = append(tabletStreams, &VReplicationStream{ + ID: stream.Id, + Workflow: workflow.Workflow, + BinlogSource: stream.Bls, + Position: pos, + WorkflowType: workflow.WorkflowType, + WorkflowSubType: workflow.WorkflowSubType, + DeferSecondaryKeys: workflow.DeferSecondaryKeys, + }) + } + } + return tabletStreams, nil +} + /* source streams */ +// legacyReadSourceStreams reads all of the VReplication workflow source streams using +// the legacy VReplicationExec method. +// Note: this should be removed along with the vtctl client code / wrangler. +func (sm *StreamMigrator) legacyReadSourceStreams(ctx context.Context, cancelMigrate bool) (map[string][]*VReplicationStream, error) { + var ( + mu sync.Mutex + streams = make(map[string][]*VReplicationStream) + ) + + err := sm.ts.ForAllSources(func(source *MigrationSource) error { + if !cancelMigrate { + // This flow protects us from the following scenario: When we create streams, + // we always do it in two phases. We start them off as Stopped, and then + // update them to Running. If such an operation fails, we may be left with + // lingering Stopped streams. They should actually be cleaned up by the user. + // In the current workflow, we stop streams and restart them. + // Once existing streams are stopped, there will be confusion about which of + // them can be restarted because they will be no different from the lingering streams. + // To prevent this confusion, we first check if there are any stopped streams. + // If so, we request the operator to clean them up, or restart them before going ahead. + // This allows us to assume that all stopped streams can be safely restarted + // if we cancel the operation. + stoppedStreams, err := sm.legacyReadTabletStreams(ctx, source.GetPrimary(), "state = 'Stopped' and message != 'FROZEN'") + if err != nil { + return err + } + + if len(stoppedStreams) != 0 { + return fmt.Errorf("cannot migrate until all streams are running: %s: %d", source.GetShard().ShardName(), source.GetPrimary().Alias.Uid) + } + } + + tabletStreams, err := sm.legacyReadTabletStreams(ctx, source.GetPrimary(), "") + if err != nil { + return err + } + + if len(tabletStreams) == 0 { + // No VReplication is running. So, we have no work to do. + return nil + } + + query := fmt.Sprintf("select distinct vrepl_id from _vt.copy_state where vrepl_id in %s", VReplicationStreams(tabletStreams).Values()) + p3qr, err := sm.ts.TabletManagerClient().VReplicationExec(ctx, source.GetPrimary().Tablet, query) + switch { + case err != nil: + return err + case len(p3qr.Rows) != 0: + return fmt.Errorf("cannot migrate while vreplication streams in source shards are still copying: %s", source.GetShard().ShardName()) + } + + mu.Lock() + defer mu.Unlock() + streams[source.GetShard().ShardName()] = tabletStreams + return nil + }) + + if err != nil { + return nil, err + } + + // Validate that streams match across source shards. + var ( + reference []*VReplicationStream + refshard string + streams2 = make(map[string][]*VReplicationStream) + ) + + for k, v := range streams { + if reference == nil { + refshard = k + reference = v + continue + } + + streams2[k] = append([]*VReplicationStream(nil), v...) + } + + for shard, tabletStreams := range streams2 { + for _, refStream := range reference { + err := func() error { + for i := 0; i < len(tabletStreams); i++ { + vrs := tabletStreams[i] + + if refStream.Workflow == vrs.Workflow && + refStream.BinlogSource.Keyspace == vrs.BinlogSource.Keyspace && + refStream.BinlogSource.Shard == vrs.BinlogSource.Shard { + // Delete the matched item and scan for the next stream. + tabletStreams = append(tabletStreams[:i], tabletStreams[i+1:]...) + return nil + } + } + + return fmt.Errorf("streams are mismatched across source shards: %s vs %s", refshard, shard) + }() + + if err != nil { + return nil, err + } + } + + if len(tabletStreams) != 0 { + return nil, fmt.Errorf("streams are mismatched across source shards: %s vs %s", refshard, shard) + } + } + + return streams, nil +} + func (sm *StreamMigrator) readSourceStreams(ctx context.Context, cancelMigrate bool) (map[string][]*VReplicationStream, error) { var ( mu sync.Mutex @@ -318,7 +542,8 @@ func (sm *StreamMigrator) readSourceStreams(ctx context.Context, cancelMigrate b // If so, we request the operator to clean them up, or restart them before going ahead. // This allows us to assume that all stopped streams can be safely restarted // if we cancel the operation. - stoppedStreams, err := sm.readTabletStreams(ctx, source.GetPrimary(), "state = 'Stopped' and message != 'FROZEN'") + stoppedStreams, err := sm.readTabletStreams(ctx, source.GetPrimary(), nil, + []binlogdatapb.VReplicationWorkflowState{binlogdatapb.VReplicationWorkflowState_Stopped}, true) if err != nil { return err } @@ -328,7 +553,7 @@ func (sm *StreamMigrator) readSourceStreams(ctx context.Context, cancelMigrate b } } - tabletStreams, err := sm.readTabletStreams(ctx, source.GetPrimary(), "") + tabletStreams, err := sm.readTabletStreams(ctx, source.GetPrimary(), nil, nil, false) if err != nil { return err } @@ -405,6 +630,47 @@ func (sm *StreamMigrator) readSourceStreams(ctx context.Context, cancelMigrate b return streams, nil } +// legacyStopSourceStreams stops the source streams using the legacy VReplicationExec +// method. +// Note: this should be removed along with the vtctl client code / wrangler. +func (sm *StreamMigrator) legacyStopSourceStreams(ctx context.Context) error { + var ( + mu sync.Mutex + stoppedStreams = make(map[string][]*VReplicationStream) + ) + + err := sm.ts.ForAllSources(func(source *MigrationSource) error { + tabletStreams := sm.streams[source.GetShard().ShardName()] + if len(tabletStreams) == 0 { + return nil + } + + query := fmt.Sprintf("update _vt.vreplication set state='Stopped', message='for cutover' where id in %s", VReplicationStreams(tabletStreams).Values()) + _, err := sm.ts.TabletManagerClient().VReplicationExec(ctx, source.GetPrimary().Tablet, query) + if err != nil { + return err + } + + tabletStreams, err = sm.legacyReadTabletStreams(ctx, source.GetPrimary(), fmt.Sprintf("id in %s", VReplicationStreams(tabletStreams).Values())) + if err != nil { + return err + } + + mu.Lock() + defer mu.Unlock() + stoppedStreams[source.GetShard().ShardName()] = tabletStreams + + return nil + }) + + if err != nil { + return err + } + + sm.streams = stoppedStreams + return nil +} + func (sm *StreamMigrator) stopSourceStreams(ctx context.Context) error { var ( mu sync.Mutex @@ -423,7 +689,7 @@ func (sm *StreamMigrator) stopSourceStreams(ctx context.Context) error { return err } - tabletStreams, err = sm.readTabletStreams(ctx, source.GetPrimary(), fmt.Sprintf("id in %s", VReplicationStreams(tabletStreams).Values())) + tabletStreams, err = sm.readTabletStreams(ctx, source.GetPrimary(), VReplicationStreams(tabletStreams).IDs(), nil, false) if err != nil { return err } @@ -510,6 +776,72 @@ func (sm *StreamMigrator) syncSourceStreams(ctx context.Context) (map[string]rep return stopPositions, allErrors.AggrError(vterrors.Aggregate) } +// legacyVerifyStreamPositions verifies the stream positions using the legacy +// VReplicationExec method. +// Note: this should be removed along with the vtctl client code / wrangler. +func (sm *StreamMigrator) legacyVerifyStreamPositions(ctx context.Context, stopPositions map[string]replication.Position) ([]string, error) { + var ( + mu sync.Mutex + stoppedStreams = make(map[string][]*VReplicationStream) + ) + + err := sm.ts.ForAllSources(func(source *MigrationSource) error { + tabletStreams := sm.streams[source.GetShard().ShardName()] + if len(tabletStreams) == 0 { + return nil + } + + tabletStreams, err := sm.legacyReadTabletStreams(ctx, source.GetPrimary(), fmt.Sprintf("id in %s", VReplicationStreams(tabletStreams).Values())) + if err != nil { + return err + } + + mu.Lock() + defer mu.Unlock() + stoppedStreams[source.GetShard().ShardName()] = tabletStreams + + return nil + }) + + if err != nil { + return nil, err + } + + // This is not really required because it's not used later. + // But we keep it up-to-date for good measure. + sm.streams = stoppedStreams + + var ( + oneSet []*VReplicationStream + allErrors concurrency.AllErrorRecorder + ) + + for _, tabletStreams := range stoppedStreams { + if oneSet == nil { + oneSet = tabletStreams + } + + for _, vrs := range tabletStreams { + key := fmt.Sprintf("%s:%s", vrs.BinlogSource.Keyspace, vrs.BinlogSource.Shard) + if pos := stopPositions[key]; !vrs.Position.Equal(pos) { + allErrors.RecordError(fmt.Errorf("%s: stream %d position: %s does not match %s", key, vrs.ID, replication.EncodePosition(vrs.Position), replication.EncodePosition(pos))) + } + } + } + + if allErrors.HasErrors() { + return nil, allErrors.AggrError(vterrors.Aggregate) + } + + sm.templates, err = sm.templatize(ctx, oneSet) + if err != nil { + // Unreachable: we've already templatized this before. + return nil, err + } + + return VReplicationStreams(sm.templates).Workflows(), allErrors.AggrError(vterrors.Aggregate) +} + func (sm *StreamMigrator) verifyStreamPositions(ctx context.Context, stopPositions map[string]replication.Position) ([]string, error) { var ( mu sync.Mutex @@ -522,7 +854,7 @@ func (sm *StreamMigrator) verifyStreamPositions(ctx context.Context, stopPositio return nil } - tabletStreams, err := sm.readTabletStreams(ctx, source.GetPrimary(), fmt.Sprintf("id in %s", VReplicationStreams(tabletStreams).Values())) + tabletStreams, err := sm.readTabletStreams(ctx, source.GetPrimary(), VReplicationStreams(tabletStreams).IDs(), nil, false) if err != nil { return err } diff --git a/go/vt/vtctl/workflow/utils.go b/go/vt/vtctl/workflow/utils.go index 80b981026d8..aef80d91c18 100644 --- a/go/vt/vtctl/workflow/utils.go +++ b/go/vt/vtctl/workflow/utils.go @@ -106,26 +106,25 @@ func validateNewWorkflow(ctx context.Context, ts *topo.Server, tmc tmclient.Tabl allErrors.RecordError(vterrors.Wrap(err, "validateWorkflowName.GetTablet")) return } - validations := []struct { - query string - msg string - }{{ - fmt.Sprintf("select 1 from _vt.vreplication where db_name=%s and workflow=%s", encodeString(primary.DbName()), encodeString(workflow)), - fmt.Sprintf("workflow %s already exists in keyspace %s on tablet %v", workflow, keyspace, primary.Alias), - }, { - fmt.Sprintf("select 1 from _vt.vreplication where db_name=%s and message='FROZEN' and workflow_sub_type != %d", encodeString(primary.DbName()), binlogdatapb.VReplicationWorkflowSubType_Partial), - fmt.Sprintf("found previous frozen workflow on tablet %v, please review and delete it first before creating a new workflow", - primary.Alias), - }} - for _, validation := range validations { - p3qr, err := tmc.VReplicationExec(ctx, primary.Tablet, validation.query) - if err != nil { - allErrors.RecordError(vterrors.Wrap(err, "validateWorkflowName.VReplicationExec")) + res, err := tmc.ReadVReplicationWorkflows(ctx, primary.Tablet, &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{}) + if err != nil { + allErrors.RecordError(vterrors.Wrap(err, "validateWorkflowName.ReadVReplicationWorkflows")) + return + } + if res == nil { + // There are no workflows on this tablet. + return + } + for _, wf := range res.Workflows { + if wf.Workflow == workflow { + allErrors.RecordError(fmt.Errorf("workflow %s already exists in keyspace %s on tablet %v", workflow, keyspace, primary.Alias)) return } - if p3qr != nil && len(p3qr.Rows) != 0 { - allErrors.RecordError(vterrors.Wrap(fmt.Errorf(validation.msg), "validateWorkflowName.VReplicationExec")) - return + for _, stream := range wf.Streams { + if stream.Message == Frozen && wf.WorkflowSubType != binlogdatapb.VReplicationWorkflowSubType_Partial { + allErrors.RecordError(fmt.Errorf("found previous frozen workflow on tablet %v, please review and delete it first before creating a new workflow", primary.Alias)) + return + } } } }(si) @@ -362,7 +361,7 @@ func BuildTargets(ctx context.Context, ts *topo.Server, tmc tmclient.TabletManag return nil, err } - if len(wf.Streams) < 1 { + if wf == nil || len(wf.Streams) < 1 { continue } @@ -526,12 +525,20 @@ func doValidateWorkflowHasCompleted(ctx context.Context, ts *trafficSwitcher) er } else { _ = ts.ForAllTargets(func(target *MigrationTarget) error { wg.Add(1) - query := fmt.Sprintf("select 1 from _vt.vreplication where db_name='%s' and workflow='%s' and message!='FROZEN'", target.GetPrimary().DbName(), ts.WorkflowName()) - rs, _ := ts.VReplicationExec(ctx, target.GetPrimary().Alias, query) - if len(rs.Rows) > 0 { - rec.RecordError(fmt.Errorf("vreplication streams are not frozen on tablet %d", target.GetPrimary().Alias.Uid)) + defer wg.Done() + res, err := ts.ws.tmc.ReadVReplicationWorkflow(ctx, target.GetPrimary().Tablet, &tabletmanagerdatapb.ReadVReplicationWorkflowRequest{ + Workflow: ts.WorkflowName(), + }) + if err != nil { + rec.RecordError(err) + return nil + } + for _, stream := range res.Streams { + if stream.Message != Frozen { + rec.RecordError(fmt.Errorf("vreplication streams are not frozen on tablet %d", target.GetPrimary().Alias.Uid)) + return nil + } } - wg.Done() return nil }) } diff --git a/go/vt/vtctl/workflow/vreplication_stream.go b/go/vt/vtctl/workflow/vreplication_stream.go index 980d686bae9..db294333de4 100644 --- a/go/vt/vtctl/workflow/vreplication_stream.go +++ b/go/vt/vtctl/workflow/vreplication_stream.go @@ -41,6 +41,15 @@ type VReplicationStream struct { // some aggregate functionality. type VReplicationStreams []*VReplicationStream +// IDs returns the IDs of the VReplicationStreams. +func (streams VReplicationStreams) IDs() []int32 { + ids := make([]int32, len(streams)) + for i := range streams { + ids[i] = streams[i].ID + } + return ids +} + // Values returns a string representing the IDs of the VReplicationStreams for // use in an IN clause. // diff --git a/go/vt/vttablet/faketmclient/fake_client.go b/go/vt/vttablet/faketmclient/fake_client.go index e8747b98fcc..e595a4edeea 100644 --- a/go/vt/vttablet/faketmclient/fake_client.go +++ b/go/vt/vttablet/faketmclient/fake_client.go @@ -70,6 +70,14 @@ func (client *FakeTabletManagerClient) DeleteVReplicationWorkflow(ctx context.Co return nil, nil } +func (client *FakeTabletManagerClient) HasVReplicationWorkflows(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.HasVReplicationWorkflowsRequest) (*tabletmanagerdatapb.HasVReplicationWorkflowsResponse, error) { + return nil, nil +} + +func (client *FakeTabletManagerClient) ReadVReplicationWorkflows(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowsResponse, error) { + return nil, nil +} + func (client *FakeTabletManagerClient) ReadVReplicationWorkflow(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.ReadVReplicationWorkflowRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowResponse, error) { return nil, nil } @@ -82,6 +90,10 @@ func (client *FakeTabletManagerClient) UpdateVReplicationWorkflow(ctx context.Co return nil, nil } +func (client *FakeTabletManagerClient) UpdateVReplicationWorkflows(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsResponse, error) { + return nil, nil +} + func (client *FakeTabletManagerClient) VDiff(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.VDiffRequest) (*tabletmanagerdatapb.VDiffResponse, error) { return nil, nil } diff --git a/go/vt/vttablet/grpctmclient/client.go b/go/vt/vttablet/grpctmclient/client.go index 69c80932657..efd6ebdcc61 100644 --- a/go/vt/vttablet/grpctmclient/client.go +++ b/go/vt/vttablet/grpctmclient/client.go @@ -737,6 +737,32 @@ func (client *Client) DeleteVReplicationWorkflow(ctx context.Context, tablet *to return response, nil } +func (client *Client) HasVReplicationWorkflows(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.HasVReplicationWorkflowsRequest) (*tabletmanagerdatapb.HasVReplicationWorkflowsResponse, error) { + c, closer, err := client.dialer.dial(ctx, tablet) + if err != nil { + return nil, err + } + defer closer.Close() + response, err := c.HasVReplicationWorkflows(ctx, request) + if err != nil { + return nil, err + } + return response, nil +} + +func (client *Client) ReadVReplicationWorkflows(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowsResponse, error) { + c, closer, err := client.dialer.dial(ctx, tablet) + if err != nil { + return nil, err + } + defer closer.Close() + response, err := c.ReadVReplicationWorkflows(ctx, request) + if err != nil { + return nil, err + } + return response, nil +} + func (client *Client) ReadVReplicationWorkflow(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.ReadVReplicationWorkflowRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowResponse, error) { c, closer, err := client.dialer.dial(ctx, tablet) if err != nil { @@ -790,6 +816,19 @@ func (client *Client) UpdateVReplicationWorkflow(ctx context.Context, tablet *to return response, nil } +func (client *Client) UpdateVReplicationWorkflows(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsResponse, error) { + c, closer, err := client.dialer.dial(ctx, tablet) + if err != nil { + return nil, err + } + defer closer.Close() + response, err := c.UpdateVReplicationWorkflows(ctx, request) + if err != nil { + return nil, err + } + return response, nil +} + // VDiff is part of the tmclient.TabletManagerClient interface. func (client *Client) VDiff(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.VDiffRequest) (*tabletmanagerdatapb.VDiffResponse, error) { log.Infof("VDiff for tablet %s, request %+v", tablet.Alias.String(), req) diff --git a/go/vt/vttablet/grpctmserver/server.go b/go/vt/vttablet/grpctmserver/server.go index d7d70194cec..c521d00d683 100644 --- a/go/vt/vttablet/grpctmserver/server.go +++ b/go/vt/vttablet/grpctmserver/server.go @@ -367,6 +367,20 @@ func (s *server) DeleteVReplicationWorkflow(ctx context.Context, request *tablet return s.tm.DeleteVReplicationWorkflow(ctx, request) } +func (s *server) HasVReplicationWorkflows(ctx context.Context, request *tabletmanagerdatapb.HasVReplicationWorkflowsRequest) (response *tabletmanagerdatapb.HasVReplicationWorkflowsResponse, err error) { + defer s.tm.HandleRPCPanic(ctx, "HasVReplicationWorkflows", request, response, true /*verbose*/, &err) + ctx = callinfo.GRPCCallInfo(ctx) + response = &tabletmanagerdatapb.HasVReplicationWorkflowsResponse{} + return s.tm.HasVReplicationWorkflows(ctx, request) +} + +func (s *server) ReadVReplicationWorkflows(ctx context.Context, request *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest) (response *tabletmanagerdatapb.ReadVReplicationWorkflowsResponse, err error) { + defer s.tm.HandleRPCPanic(ctx, "ReadVReplicationWorkflows", request, response, true /*verbose*/, &err) + ctx = callinfo.GRPCCallInfo(ctx) + response = &tabletmanagerdatapb.ReadVReplicationWorkflowsResponse{} + return s.tm.ReadVReplicationWorkflows(ctx, request) +} + func (s *server) ReadVReplicationWorkflow(ctx context.Context, request *tabletmanagerdatapb.ReadVReplicationWorkflowRequest) (response *tabletmanagerdatapb.ReadVReplicationWorkflowResponse, err error) { defer s.tm.HandleRPCPanic(ctx, "ReadVReplicationWorkflow", request, response, true /*verbose*/, &err) ctx = callinfo.GRPCCallInfo(ctx) @@ -396,6 +410,13 @@ func (s *server) UpdateVReplicationWorkflow(ctx context.Context, request *tablet return s.tm.UpdateVReplicationWorkflow(ctx, request) } +func (s *server) UpdateVReplicationWorkflows(ctx context.Context, request *tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest) (response *tabletmanagerdatapb.UpdateVReplicationWorkflowsResponse, err error) { + defer s.tm.HandleRPCPanic(ctx, "UpdateVReplicationWorkflows", request, response, true /*verbose*/, &err) + ctx = callinfo.GRPCCallInfo(ctx) + response = &tabletmanagerdatapb.UpdateVReplicationWorkflowsResponse{} + return s.tm.UpdateVReplicationWorkflows(ctx, request) +} + func (s *server) VDiff(ctx context.Context, request *tabletmanagerdatapb.VDiffRequest) (response *tabletmanagerdatapb.VDiffResponse, err error) { defer s.tm.HandleRPCPanic(ctx, "VDiff", request, response, true /*verbose*/, &err) ctx = callinfo.GRPCCallInfo(ctx) diff --git a/go/vt/vttablet/tabletmanager/framework_test.go b/go/vt/vttablet/tabletmanager/framework_test.go index 4734ab9ee96..2d606d81597 100644 --- a/go/vt/vttablet/tabletmanager/framework_test.go +++ b/go/vt/vttablet/tabletmanager/framework_test.go @@ -20,6 +20,7 @@ import ( "context" "fmt" "regexp" + "strconv" "strings" "sync" "testing" @@ -33,6 +34,7 @@ import ( "vitess.io/vitess/go/vt/dbconfigs" "vitess.io/vitess/go/vt/grpcclient" "vitess.io/vitess/go/vt/mysqlctl" + "vitess.io/vitess/go/vt/mysqlctl/tmutils" "vitess.io/vitess/go/vt/topo" "vitess.io/vitess/go/vt/topo/memorytopo" "vitess.io/vitess/go/vt/vttablet/queryservice" @@ -376,18 +378,70 @@ type fakeTMClient struct { sourceShards []string tablets map[int]*fakeTabletConn schema *tabletmanagerdatapb.SchemaDefinition + tabletSchemas map[int]*tabletmanagerdatapb.SchemaDefinition vreQueries map[int]map[string]*querypb.QueryResult + + mu sync.Mutex + // Keep track of how many times GetSchema is called per tablet. + getSchemaCounts map[string]int + // Used to confirm the number of times WorkflowDelete was called. + workflowDeleteCalls int } func newFakeTMClient() *fakeTMClient { return &fakeTMClient{ - tablets: make(map[int]*fakeTabletConn), - vreQueries: make(map[int]map[string]*querypb.QueryResult), - schema: &tabletmanagerdatapb.SchemaDefinition{}, + tablets: make(map[int]*fakeTabletConn), + vreQueries: make(map[int]map[string]*querypb.QueryResult), + schema: &tabletmanagerdatapb.SchemaDefinition{}, + tabletSchemas: make(map[int]*tabletmanagerdatapb.SchemaDefinition), // If we need to override the global schema for a tablet + getSchemaCounts: make(map[string]int), + } +} + +// Note: ONLY breaks up change.SQL into individual statements and executes it. Does NOT fully implement ApplySchema. +func (tmc *fakeTMClient) ApplySchema(ctx context.Context, tablet *topodatapb.Tablet, change *tmutils.SchemaChange) (*tabletmanagerdatapb.SchemaChangeResult, error) { + stmts := strings.Split(change.SQL, ";") + + for _, stmt := range stmts { + _, err := tmc.ExecuteFetchAsDba(ctx, tablet, false, &tabletmanagerdatapb.ExecuteFetchAsDbaRequest{ + Query: []byte(stmt), + MaxRows: 0, + ReloadSchema: true, + }) + if err != nil { + return nil, err + } + } + + return nil, nil +} + +func (tmc *fakeTMClient) schemaRequested(uid int) { + tmc.mu.Lock() + defer tmc.mu.Unlock() + key := strconv.Itoa(int(uid)) + n, ok := tmc.getSchemaCounts[key] + if !ok { + tmc.getSchemaCounts[key] = 1 + } else { + tmc.getSchemaCounts[key] = n + 1 } } +func (tmc *fakeTMClient) getSchemaRequestCount(uid int) int { + tmc.mu.Lock() + defer tmc.mu.Unlock() + key := strconv.Itoa(int(uid)) + return tmc.getSchemaCounts[key] +} + func (tmc *fakeTMClient) GetSchema(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.GetSchemaRequest) (*tabletmanagerdatapb.SchemaDefinition, error) { + tmc.schemaRequested(int(tablet.Alias.Uid)) + // Return the schema for the tablet if it exists. + if schema, ok := tmc.tabletSchemas[int(tablet.Alias.Uid)]; ok { + return schema, nil + } + // Otherwise use the global one. return tmc.schema, nil } @@ -432,41 +486,6 @@ func (tmc *fakeTMClient) VReplicationExec(ctx context.Context, tablet *topodatap return nil, fmt.Errorf("query %q not found for tablet %d", query, tablet.Alias.Uid) } -func (tmc *fakeTMClient) CreateVReplicationWorkflow(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.CreateVReplicationWorkflowRequest) (*tabletmanagerdatapb.CreateVReplicationWorkflowResponse, error) { - return tmc.tablets[int(tablet.Alias.Uid)].tm.CreateVReplicationWorkflow(ctx, req) -} - -func (tmc *fakeTMClient) ReadVReplicationWorkflow(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.ReadVReplicationWorkflowRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowResponse, error) { - resp := &tabletmanagerdatapb.ReadVReplicationWorkflowResponse{ - Workflow: req.Workflow, - WorkflowSubType: binlogdatapb.VReplicationWorkflowSubType_None, - WorkflowType: binlogdatapb.VReplicationWorkflowType_MoveTables, - TabletTypes: []topodatapb.TabletType{topodatapb.TabletType_PRIMARY}, - Streams: make([]*tabletmanagerdatapb.ReadVReplicationWorkflowResponse_Stream, len(tmc.sourceShards)), - } - rules := make([]*binlogdatapb.Rule, len(defaultSchema.TableDefinitions)) - for i, table := range defaultSchema.TableDefinitions { - rules[i] = &binlogdatapb.Rule{ - Match: table.Name, - Filter: tablet.Shard, - } - } - for i, shard := range tmc.sourceShards { - resp.Streams[i] = &tabletmanagerdatapb.ReadVReplicationWorkflowResponse_Stream{ - Id: int32(i + 1), - Bls: &binlogdatapb.BinlogSource{ - Keyspace: tmc.sourceKeyspace, - Shard: shard, - Filter: &binlogdatapb.Filter{ - Rules: rules, - }, - }, - } - } - - return resp, nil -} - func (tmc *fakeTMClient) PrimaryPosition(ctx context.Context, tablet *topodatapb.Tablet) (string, error) { return fmt.Sprintf("%s/%s", gtidFlavor, gtidPosition), nil } @@ -490,3 +509,34 @@ func (tmc *fakeTMClient) VDiff(ctx context.Context, tablet *topodatapb.Tablet, r }, }, nil } + +func (tmc *fakeTMClient) CreateVReplicationWorkflow(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.CreateVReplicationWorkflowRequest) (*tabletmanagerdatapb.CreateVReplicationWorkflowResponse, error) { + return tmc.tablets[int(tablet.Alias.Uid)].tm.CreateVReplicationWorkflow(ctx, req) +} + +func (tmc *fakeTMClient) DeleteVReplicationWorkflow(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.DeleteVReplicationWorkflowRequest) (response *tabletmanagerdatapb.DeleteVReplicationWorkflowResponse, err error) { + tmc.mu.Lock() + defer tmc.mu.Unlock() + tmc.workflowDeleteCalls++ + return &tabletmanagerdatapb.DeleteVReplicationWorkflowResponse{ + Result: &querypb.QueryResult{ + RowsAffected: 1, + }, + }, nil +} + +func (tmc *fakeTMClient) HasVReplicationWorkflows(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.HasVReplicationWorkflowsRequest) (*tabletmanagerdatapb.HasVReplicationWorkflowsResponse, error) { + return tmc.tablets[int(tablet.Alias.Uid)].tm.HasVReplicationWorkflows(ctx, req) +} + +func (tmc *fakeTMClient) ReadVReplicationWorkflow(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.ReadVReplicationWorkflowRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowResponse, error) { + return tmc.tablets[int(tablet.Alias.Uid)].tm.ReadVReplicationWorkflow(ctx, req) +} + +func (tmc *fakeTMClient) ReadVReplicationWorkflows(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowsResponse, error) { + return tmc.tablets[int(tablet.Alias.Uid)].tm.ReadVReplicationWorkflows(ctx, req) +} + +func (tmc *fakeTMClient) UpdateVReplicationWorkflow(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.UpdateVReplicationWorkflowRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowResponse, error) { + return tmc.tablets[int(tablet.Alias.Uid)].tm.UpdateVReplicationWorkflow(ctx, req) +} diff --git a/go/vt/vttablet/tabletmanager/rpc_agent.go b/go/vt/vttablet/tabletmanager/rpc_agent.go index 06c0e5cda94..b49dddf026b 100644 --- a/go/vt/vttablet/tabletmanager/rpc_agent.go +++ b/go/vt/vttablet/tabletmanager/rpc_agent.go @@ -101,10 +101,13 @@ type RPCTM interface { // VReplication API CreateVReplicationWorkflow(ctx context.Context, req *tabletmanagerdatapb.CreateVReplicationWorkflowRequest) (*tabletmanagerdatapb.CreateVReplicationWorkflowResponse, error) DeleteVReplicationWorkflow(ctx context.Context, req *tabletmanagerdatapb.DeleteVReplicationWorkflowRequest) (*tabletmanagerdatapb.DeleteVReplicationWorkflowResponse, error) + HasVReplicationWorkflows(ctx context.Context, req *tabletmanagerdatapb.HasVReplicationWorkflowsRequest) (*tabletmanagerdatapb.HasVReplicationWorkflowsResponse, error) + ReadVReplicationWorkflows(ctx context.Context, req *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowsResponse, error) ReadVReplicationWorkflow(ctx context.Context, req *tabletmanagerdatapb.ReadVReplicationWorkflowRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowResponse, error) VReplicationExec(ctx context.Context, query string) (*querypb.QueryResult, error) VReplicationWaitForPos(ctx context.Context, id int32, pos string) error UpdateVReplicationWorkflow(ctx context.Context, req *tabletmanagerdatapb.UpdateVReplicationWorkflowRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowResponse, error) + UpdateVReplicationWorkflows(ctx context.Context, req *tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsResponse, error) // VDiff API VDiff(ctx context.Context, req *tabletmanagerdatapb.VDiffRequest) (*tabletmanagerdatapb.VDiffResponse, error) diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication.go b/go/vt/vttablet/tabletmanager/rpc_vreplication.go index ee1907005a8..1489d6eccb7 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -18,8 +18,10 @@ package tabletmanager import ( "context" + "fmt" "strings" + "golang.org/x/exp/maps" "google.golang.org/protobuf/encoding/prototext" "vitess.io/vitess/go/constants/sidecar" @@ -42,6 +44,10 @@ import ( const ( // Create a new VReplication workflow record. sqlCreateVReplicationWorkflow = "insert into %s.vreplication (workflow, source, pos, max_tps, max_replication_lag, cell, tablet_types, time_updated, transaction_timestamp, state, db_name, workflow_type, workflow_sub_type, defer_secondary_keys) values (%a, %a, '', 0, 0, %a, %a, now(), 0, %a, %a, %a, %a, %a)" + sqlHasVReplicationWorkflows = "select if(count(*) > 0, 1, 0) as has_workflows from %s.vreplication where db_name = %a" + // Read all VReplication workflows. The final format specifier is used to + // optionally add any additional predicates to the query. + sqlReadVReplicationWorkflows = "select workflow, id, source, pos, stop_pos, max_tps, max_replication_lag, cell, tablet_types, time_updated, transaction_timestamp, state, message, db_name, rows_copied, tags, time_heartbeat, workflow_type, time_throttled, component_throttled, workflow_sub_type, defer_secondary_keys from %s.vreplication where db_name = %a%s group by workflow, id order by workflow, id" // Read a VReplication workflow. sqlReadVReplicationWorkflow = "select id, source, pos, stop_pos, max_tps, max_replication_lag, cell, tablet_types, time_updated, transaction_timestamp, state, message, db_name, rows_copied, tags, time_heartbeat, workflow_type, time_throttled, component_throttled, workflow_sub_type, defer_secondary_keys from %s.vreplication where workflow = %a and db_name = %a" // Delete VReplication records for the given workflow. @@ -50,6 +56,14 @@ const ( sqlSelectVReplicationWorkflowConfig = "select id, source, cell, tablet_types, state, message from %s.vreplication where workflow = %a" // Update the configuration values for a workflow's vreplication stream. sqlUpdateVReplicationWorkflowStreamConfig = "update %s.vreplication set state = %a, source = %a, cell = %a, tablet_types = %a where id = %a" + // Update field values for multiple workflows. The final format specifier is + // used to optionally add any additional predicates to the query. + sqlUpdateVReplicationWorkflows = "update /*vt+ ALLOW_UNSAFE_VREPLICATION_WRITE */ %s.vreplication set%s where db_name = '%s'%s" +) + +var ( + errNoFieldsToUpdate = vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "no field values provided to update") + errAllWithIncludeExcludeWorkflows = vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "cannot specify all workflows along with either of include or exclude workflows") ) func (tm *TabletManager) CreateVReplicationWorkflow(ctx context.Context, req *tabletmanagerdatapb.CreateVReplicationWorkflowRequest) (*tabletmanagerdatapb.CreateVReplicationWorkflowResponse, error) { @@ -124,6 +138,140 @@ func (tm *TabletManager) DeleteVReplicationWorkflow(ctx context.Context, req *ta return &tabletmanagerdatapb.DeleteVReplicationWorkflowResponse{Result: sqltypes.ResultToProto3(res)}, nil } +func (tm *TabletManager) HasVReplicationWorkflows(ctx context.Context, req *tabletmanagerdatapb.HasVReplicationWorkflowsRequest) (*tabletmanagerdatapb.HasVReplicationWorkflowsResponse, error) { + bindVars := map[string]*querypb.BindVariable{ + "db": sqltypes.StringBindVariable(tm.DBConfigs.DBName), + } + parsed := sqlparser.BuildParsedQuery(sqlHasVReplicationWorkflows, sidecar.GetIdentifier(), ":db") + stmt, err := parsed.GenerateQuery(bindVars, nil) + if err != nil { + return nil, err + } + res, err := tm.VREngine.Exec(stmt) + if err != nil { + return nil, err + } + // This should never occur. Let the caller decide how to treat it. + if res == nil || len(res.Rows) == 0 { + return nil, nil + } + if len(res.Rows) != 1 || len(res.Rows[0]) != 1 { + return nil, vterrors.Errorf(vtrpcpb.Code_INTERNAL, "unexpected response to query %q: expected 1 row with 1 column but got %d row(s) with %d column(s)", + parsed.Query, len(res.Rows), len(res.Rows[0])) + } + has, err := res.Rows[0][0].ToBool() + if err != nil { + return nil, vterrors.Errorf(vtrpcpb.Code_INTERNAL, "unexpected response to query %q: could not convert %q to boolean", + parsed.Query, res.Rows[0][0].ToString()) + } + + return &tabletmanagerdatapb.HasVReplicationWorkflowsResponse{Has: has}, nil +} + +func (tm *TabletManager) ReadVReplicationWorkflows(ctx context.Context, req *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowsResponse, error) { + query, err := tm.buildReadVReplicationWorkflowsQuery(req) + if err != nil { + return nil, err + } + res, err := tm.VREngine.Exec(query) + if err != nil { + return nil, err + } + resp := &tabletmanagerdatapb.ReadVReplicationWorkflowsResponse{} + if res == nil || len(res.Rows) == 0 { + return resp, nil + } + rows := res.Named().Rows + workflows := make(map[string]*tabletmanagerdatapb.ReadVReplicationWorkflowResponse, len(rows)) + + for _, row := range rows { + workflow := row["workflow"].ToString() + if workflows[workflow] == nil { + workflows[workflow] = &tabletmanagerdatapb.ReadVReplicationWorkflowResponse{Workflow: workflow} + } + workflows[workflow].Cells = row["cell"].ToString() + tabletTypes, inorder, err := discovery.ParseTabletTypesAndOrder(row["tablet_types"].ToString()) + if err != nil { + return nil, vterrors.Wrap(err, "error parsing the tablet_types field from vreplication table record") + } + workflows[workflow].TabletTypes = tabletTypes + workflows[workflow].TabletSelectionPreference = tabletmanagerdatapb.TabletSelectionPreference_ANY + if inorder { + workflows[workflow].TabletSelectionPreference = tabletmanagerdatapb.TabletSelectionPreference_INORDER + } + workflows[workflow].DbName = row["db_name"].ToString() + workflows[workflow].Tags = row["tags"].ToString() + wft, err := row["workflow_type"].ToInt32() + if err != nil { + return nil, vterrors.Wrap(err, "error parsing workflow_type field from vreplication table record") + } + workflows[workflow].WorkflowType = binlogdatapb.VReplicationWorkflowType(wft) + wfst, err := row["workflow_sub_type"].ToInt32() + if err != nil { + return nil, vterrors.Wrap(err, "error parsing workflow_sub_type field from vreplication table record") + } + workflows[workflow].WorkflowSubType = binlogdatapb.VReplicationWorkflowSubType(wfst) + workflows[workflow].DeferSecondaryKeys = row["defer_secondary_keys"].ToString() == "1" + + // Now the individual streams (there can be more than 1 with shard merges). + if workflows[workflow].Streams == nil { + workflows[workflow].Streams = make([]*tabletmanagerdatapb.ReadVReplicationWorkflowResponse_Stream, 0, 1) + } + stream := &tabletmanagerdatapb.ReadVReplicationWorkflowResponse_Stream{} + if stream.Id, err = row["id"].ToInt32(); err != nil { + return nil, vterrors.Wrap(err, "error parsing id field from vreplication table record") + } + srcBytes, err := row["source"].ToBytes() + if err != nil { + return nil, vterrors.Wrap(err, "error parsing binlog_source field from vreplication table record") + } + bls := &binlogdatapb.BinlogSource{} + err = prototext.Unmarshal(srcBytes, bls) + if err != nil { + return nil, vterrors.Wrap(err, "error unmarshaling binlog_source field from vreplication table record") + } + stream.Bls = bls + stream.Pos = row["pos"].ToString() + stream.StopPos = row["stop_pos"].ToString() + if stream.MaxTps, err = row["max_tps"].ToInt64(); err != nil { + return nil, vterrors.Wrap(err, "error parsing max_tps field from vreplication table record") + } + if stream.MaxReplicationLag, err = row["max_replication_lag"].ToInt64(); err != nil { + return nil, vterrors.Wrap(err, "error parsing max_replication_lag field from vreplication table record") + } + timeUpdated, err := row["time_updated"].ToInt64() + if err != nil { + return nil, vterrors.Wrap(err, "error parsing time_updated field from vreplication table record") + } + stream.TimeUpdated = &vttime.Time{Seconds: timeUpdated} + txTimestamp, err := row["transaction_timestamp"].ToInt64() + if err != nil { + return nil, vterrors.Wrap(err, "error parsing transaction_timestamp field from vreplication table record") + } + stream.TransactionTimestamp = &vttime.Time{Seconds: txTimestamp} + stream.State = binlogdatapb.VReplicationWorkflowState(binlogdatapb.VReplicationWorkflowState_value[row["state"].ToString()]) + stream.Message = row["message"].ToString() + if stream.RowsCopied, err = row["rows_copied"].ToInt64(); err != nil { + return nil, vterrors.Wrap(err, "error parsing rows_copied field from vreplication table record") + } + timeHeartbeat, err := row["time_heartbeat"].ToInt64() + if err != nil { + return nil, vterrors.Wrap(err, "error parsing time_heartbeat field from vreplication table record") + } + stream.TimeHeartbeat = &vttime.Time{Seconds: timeHeartbeat} + timeThrottled, err := row["time_throttled"].ToInt64() + if err != nil { + return nil, vterrors.Wrap(err, "error parsing time_throttled field from vreplication table record") + } + stream.TimeThrottled = &vttime.Time{Seconds: timeThrottled} + stream.ComponentThrottled = row["component_throttled"].ToString() + workflows[workflow].Streams = append(workflows[workflow].Streams, stream) + } + resp.Workflows = maps.Values(workflows) + + return resp, nil +} + func (tm *TabletManager) ReadVReplicationWorkflow(ctx context.Context, req *tabletmanagerdatapb.ReadVReplicationWorkflowRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowResponse, error) { if req == nil || req.Workflow == "" { return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "invalid request, no workflow provided") @@ -262,6 +410,9 @@ func (tm *TabletManager) UpdateVReplicationWorkflow(ctx context.Context, req *ta for _, row := range res.Named().Rows { id := row.AsInt64("id", 0) cells := strings.Split(row.AsString("cell", ""), ",") + for i := range cells { + cells[i] = strings.TrimSpace(cells[i]) + } tabletTypes, inorder, err := discovery.ParseTabletTypesAndOrder(row.AsString("tablet_types", "")) if err != nil { return nil, err @@ -284,8 +435,8 @@ func (tm *TabletManager) UpdateVReplicationWorkflow(ctx context.Context, req *ta tabletTypes = req.TabletTypes } tabletTypesStr := topoproto.MakeStringTypeCSV(tabletTypes) - if inorder && req.TabletSelectionPreference == tabletmanagerdatapb.TabletSelectionPreference_UNKNOWN || - req.TabletSelectionPreference == tabletmanagerdatapb.TabletSelectionPreference_INORDER { + if (inorder && req.TabletSelectionPreference == tabletmanagerdatapb.TabletSelectionPreference_UNKNOWN) || + (req.TabletSelectionPreference == tabletmanagerdatapb.TabletSelectionPreference_INORDER) { tabletTypesStr = discovery.InOrderHint + tabletTypesStr } if err = prototext.Unmarshal(source, bls); err != nil { @@ -328,6 +479,29 @@ func (tm *TabletManager) UpdateVReplicationWorkflow(ctx context.Context, req *ta }, nil } +// UpdateVReplicationWorkflows operates in much the same way that +// UpdateVReplicationWorkflow does, but it allows you to update the +// metadata/flow control fields -- state, message, and stop_pos -- for +// multiple workflows. +// Note: today this is only used during Reshard as all of the vreplication +// streams need to be migrated from the old shards to the new ones. +func (tm *TabletManager) UpdateVReplicationWorkflows(ctx context.Context, req *tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsResponse, error) { + query, err := tm.buildUpdateVReplicationWorkflowsQuery(req) + if err != nil { + return nil, err + } + res, err := tm.VREngine.Exec(query) + if err != nil { + return nil, err + } + + return &tabletmanagerdatapb.UpdateVReplicationWorkflowsResponse{ + Result: &querypb.QueryResult{ + RowsAffected: uint64(len(res.Rows)), + }, + }, nil +} + // VReplicationExec executes a vreplication command. func (tm *TabletManager) VReplicationExec(ctx context.Context, query string) (*querypb.QueryResult, error) { // Replace any provided sidecar database qualifiers with the correct one. @@ -346,3 +520,131 @@ func (tm *TabletManager) VReplicationExec(ctx context.Context, query string) (*q func (tm *TabletManager) VReplicationWaitForPos(ctx context.Context, id int32, pos string) error { return tm.VREngine.WaitForPos(ctx, id, pos) } + +// buildReadVReplicationWorkflowsQuery builds the SQL query used to read N +// vreplication workflows based on the request. +func (tm *TabletManager) buildReadVReplicationWorkflowsQuery(req *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest) (string, error) { + bindVars := map[string]*querypb.BindVariable{ + "db": sqltypes.StringBindVariable(tm.DBConfigs.DBName), + } + + additionalPredicates := strings.Builder{} + if req.GetExcludeFrozen() { + additionalPredicates.WriteString(fmt.Sprintf(" and message != '%s'", workflow.Frozen)) + } + if len(req.GetIncludeIds()) > 0 { + additionalPredicates.WriteString(" and id in (") + for i, id := range req.GetIncludeIds() { + if i > 0 { + additionalPredicates.WriteByte(',') + } + additionalPredicates.WriteString(fmt.Sprintf("%d", id)) + } + additionalPredicates.WriteByte(')') + } + if len(req.GetIncludeWorkflows()) > 0 { + additionalPredicates.WriteString(" and workflow in (") + for i, wf := range req.GetIncludeWorkflows() { + if i > 0 { + additionalPredicates.WriteByte(',') + } + additionalPredicates.WriteString(sqltypes.EncodeStringSQL(wf)) + } + additionalPredicates.WriteByte(')') + } + if len(req.GetExcludeWorkflows()) > 0 { + additionalPredicates.WriteString(" and workflow not in (") + for i, wf := range req.GetExcludeWorkflows() { + if i > 0 { + additionalPredicates.WriteByte(',') + } + additionalPredicates.WriteString(sqltypes.EncodeStringSQL(wf)) + } + additionalPredicates.WriteByte(')') + } + if len(req.GetIncludeStates()) > 0 { + additionalPredicates.WriteString(" and state in (") + for i, state := range req.GetIncludeStates() { + if i > 0 { + additionalPredicates.WriteByte(',') + } + additionalPredicates.WriteString(sqltypes.EncodeStringSQL(state.String())) + } + additionalPredicates.WriteByte(')') + } + if len(req.GetExcludeStates()) > 0 { + additionalPredicates.WriteString(" and state not in (") + for i, state := range req.GetExcludeStates() { + if i > 0 { + additionalPredicates.WriteByte(',') + } + additionalPredicates.WriteString(sqltypes.EncodeStringSQL(state.String())) + } + additionalPredicates.WriteByte(')') + } + + parsed := sqlparser.BuildParsedQuery(sqlReadVReplicationWorkflows, sidecar.GetIdentifier(), ":db", additionalPredicates.String()) + return parsed.GenerateQuery(bindVars, nil) +} + +// buildUpdateVReplicationWorkflowsQuery builds the SQL query used to update +// the metadata/flow control fields for N vreplication workflows based on the +// request. +func (tm *TabletManager) buildUpdateVReplicationWorkflowsQuery(req *tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest) (string, error) { + if req.GetAllWorkflows() && (len(req.GetIncludeWorkflows()) > 0 || len(req.GetExcludeWorkflows()) > 0) { + return "", errAllWithIncludeExcludeWorkflows + } + if textutil.ValueIsSimulatedNull(req.GetState()) && textutil.ValueIsSimulatedNull(req.GetMessage()) && textutil.ValueIsSimulatedNull(req.GetStopPosition()) { + return "", errNoFieldsToUpdate + } + sets := strings.Builder{} + predicates := strings.Builder{} + + // First add the SET clauses. + if !textutil.ValueIsSimulatedNull(req.GetState()) { + state, ok := binlogdatapb.VReplicationWorkflowState_name[int32(req.GetState())] + if !ok { + return "", vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "invalid state value: %v", req.GetState()) + } + sets.WriteString(" state = ") + sets.WriteString(sqltypes.EncodeStringSQL(state)) + } + if !textutil.ValueIsSimulatedNull(req.GetMessage()) { + if sets.Len() > 0 { + sets.WriteByte(',') + } + sets.WriteString(" message = ") + sets.WriteString(sqltypes.EncodeStringSQL(req.GetMessage())) + } + if !textutil.ValueIsSimulatedNull(req.GetStopPosition()) { + if sets.Len() > 0 { + sets.WriteByte(',') + } + sets.WriteString(" stop_pos = ") + sets.WriteString(sqltypes.EncodeStringSQL(req.GetStopPosition())) + } + + // Now add any WHERE predicate clauses. + if len(req.GetIncludeWorkflows()) > 0 { + predicates.WriteString(" and workflow in (") + for i, wf := range req.GetIncludeWorkflows() { + if i > 0 { + predicates.WriteByte(',') + } + predicates.WriteString(sqltypes.EncodeStringSQL(wf)) + } + predicates.WriteByte(')') + } + if len(req.GetExcludeWorkflows()) > 0 { + predicates.WriteString(" and workflow not in (") + for i, wf := range req.GetExcludeWorkflows() { + if i > 0 { + predicates.WriteByte(',') + } + predicates.WriteString(sqltypes.EncodeStringSQL(wf)) + } + predicates.WriteByte(')') + } + + return sqlparser.BuildParsedQuery(sqlUpdateVReplicationWorkflows, sidecar.GetIdentifier(), sets.String(), tm.DBConfigs.DBName, predicates.String()).Query, nil +} diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go index 1db4e02b67b..2190534247e 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go @@ -21,12 +21,11 @@ import ( "errors" "fmt" "math" + "reflect" "runtime/debug" "strings" "testing" - - "vitess.io/vitess/go/vt/vtenv" - "vitess.io/vitess/go/vt/vttablet" + "time" "github.com/stretchr/testify/require" @@ -34,10 +33,16 @@ import ( "vitess.io/vitess/go/sqlescape" "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/textutil" + "vitess.io/vitess/go/vt/binlog/binlogplayer" + "vitess.io/vitess/go/vt/dbconfigs" "vitess.io/vitess/go/vt/sqlparser" + "vitess.io/vitess/go/vt/topo" + "vitess.io/vitess/go/vt/topo/topoproto" "vitess.io/vitess/go/vt/topotools" "vitess.io/vitess/go/vt/vtctl/workflow" + "vitess.io/vitess/go/vt/vtenv" "vitess.io/vitess/go/vt/vtgate/vindexes" + "vitess.io/vitess/go/vt/vttablet" binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata" querypb "vitess.io/vitess/go/vt/proto/query" @@ -50,29 +55,30 @@ import ( const ( insertVReplicationPrefix = "insert into _vt.vreplication (workflow, source, pos, max_tps, max_replication_lag, cell, tablet_types, time_updated, transaction_timestamp, state, db_name, workflow_type, workflow_sub_type, defer_secondary_keys)" - getWorkflow = "select id from _vt.vreplication where db_name='vt_%s' and workflow='%s'" - checkForWorkflow = "select 1 from _vt.vreplication where db_name='vt_%s' and workflow='%s'" - checkForFrozenWorkflow = "select 1 from _vt.vreplication where db_name='vt_%s' and message='FROZEN' and workflow_sub_type != 1" - freezeWorkflow = "update _vt.vreplication set message = 'FROZEN' where db_name='vt_%s' and workflow='%s'" checkForJournal = "/select val from _vt.resharding_journal where id=" - getWorkflowStatus = "select id, workflow, source, pos, stop_pos, max_replication_lag, state, db_name, time_updated, transaction_timestamp, message, tags, workflow_type, workflow_sub_type, time_heartbeat, defer_secondary_keys, component_throttled, time_throttled, rows_copied, tablet_types, cell from _vt.vreplication where workflow = '%s' and db_name = 'vt_%s'" - getWorkflowState = "select pos, stop_pos, max_tps, max_replication_lag, state, workflow_type, workflow, workflow_sub_type, defer_secondary_keys from _vt.vreplication where id=1" + getWorkflowState = "select pos, stop_pos, max_tps, max_replication_lag, state, workflow_type, workflow, workflow_sub_type, defer_secondary_keys from _vt.vreplication where id=%d" getCopyState = "select distinct table_name from _vt.copy_state cs, _vt.vreplication vr where vr.id = cs.vrepl_id and vr.id = 1" - getNumCopyStateTable = "select count(distinct table_name) from _vt.copy_state where vrepl_id=1" - getLatestCopyState = "select vrepl_id, table_name, lastpk from _vt.copy_state where vrepl_id in (1) and id in (select max(id) from _vt.copy_state where vrepl_id in (1) group by vrepl_id, table_name)" + getNumCopyStateTable = "select count(distinct table_name) from _vt.copy_state where vrepl_id=%d" + getLatestCopyState = "select vrepl_id, table_name, lastpk from _vt.copy_state where vrepl_id in (%d) and id in (select max(id) from _vt.copy_state where vrepl_id in (%d) group by vrepl_id, table_name)" getAutoIncrementStep = "select @@session.auto_increment_increment" setSessionTZ = "set @@session.time_zone = '+00:00'" setNames = "set names 'binary'" getBinlogRowImage = "select @@binlog_row_image" insertStreamsCreatedLog = "insert into _vt.vreplication_log(vrepl_id, type, state, message) values(1, 'Stream Created', '', '%s'" - getVReplicationRecord = "select * from _vt.vreplication where id = 1" + getVReplicationRecord = "select * from _vt.vreplication where id = %d" startWorkflow = "update _vt.vreplication set state='Running' where db_name='vt_%s' and workflow='%s'" stopForCutover = "update _vt.vreplication set state='Stopped', message='stopped for cutover' where id=1" getMaxValForSequence = "select max(`id`) as maxval from `vt_%s`.`%s`" initSequenceTable = "insert into %a.%a (id, next_id, cache) values (0, %d, 1000) on duplicate key update next_id = if(next_id < %d, %d, next_id)" deleteWorkflow = "delete from _vt.vreplication where db_name = 'vt_%s' and workflow = '%s'" - updatePickedSourceTablet = `update _vt.vreplication set message='Picked source tablet: cell:\"%s\" uid:%d' where id=1` - getRowsCopied = "SELECT rows_copied FROM _vt.vreplication WHERE id=1" + updatePickedSourceTablet = `update _vt.vreplication set message='Picked source tablet: cell:\"%s\" uid:%d' where id=%d` + getRowsCopied = "SELECT rows_copied FROM _vt.vreplication WHERE id=%d" + hasWorkflows = "select if(count(*) > 0, 1, 0) as has_workflows from _vt.vreplication where db_name = '%s'" + readAllWorkflows = "select workflow, id, source, pos, stop_pos, max_tps, max_replication_lag, cell, tablet_types, time_updated, transaction_timestamp, state, message, db_name, rows_copied, tags, time_heartbeat, workflow_type, time_throttled, component_throttled, workflow_sub_type, defer_secondary_keys from _vt.vreplication where db_name = '%s'%s group by workflow, id order by workflow, id" + readWorkflowsLimited = "select workflow, id, source, pos, stop_pos, max_tps, max_replication_lag, cell, tablet_types, time_updated, transaction_timestamp, state, message, db_name, rows_copied, tags, time_heartbeat, workflow_type, time_throttled, component_throttled, workflow_sub_type, defer_secondary_keys from _vt.vreplication where db_name = '%s' and workflow in ('%s') group by workflow, id order by workflow, id" + readWorkflow = "select id, source, pos, stop_pos, max_tps, max_replication_lag, cell, tablet_types, time_updated, transaction_timestamp, state, message, db_name, rows_copied, tags, time_heartbeat, workflow_type, time_throttled, component_throttled, workflow_sub_type, defer_secondary_keys from _vt.vreplication where workflow = '%s' and db_name = '%s'" + readWorkflowConfig = "select id, source, cell, tablet_types, state, message from _vt.vreplication where workflow = '%s'" + updateWorkflow = "update _vt.vreplication set state = '%s', source = '%s', cell = '%s', tablet_types = '%s' where id in (%d)" ) var ( @@ -249,10 +255,6 @@ func TestCreateVReplicationWorkflow(t *testing.T) { }, } - tenv.tmc.setVReplicationExecResults(targetTablet.tablet, fmt.Sprintf("select 1 from _vt.vreplication where db_name='vt_%s' and workflow='%s'", - targetKs, wf), &sqltypes.Result{}) - tenv.tmc.setVReplicationExecResults(targetTablet.tablet, fmt.Sprintf("select 1 from _vt.vreplication where db_name='vt_%s' and message='FROZEN' and workflow_sub_type != 1", - targetKs), &sqltypes.Result{}) tenv.tmc.setVReplicationExecResults(sourceTablet.tablet, "select val from _vt.resharding_journal where id=7224776740563431192", &sqltypes.Result{}) for _, tt := range tests { @@ -273,11 +275,13 @@ func TestCreateVReplicationWorkflow(t *testing.T) { } tenv.tmc.SetSchema(tt.schema) - tenv.tmc.tablets[targetTabletUID].vrdbClient.ExpectRequest("use _vt", &sqltypes.Result{}, nil) // This is our expected query, which will also short circuit // the test with an error as at this point we've tested what // we wanted to test. - tenv.tmc.tablets[targetTabletUID].vrdbClient.ExpectRequest(tt.query, nil, errShortCircuit) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(tt.query, &sqltypes.Result{}, errShortCircuit) _, err := ws.MoveTablesCreate(ctx, tt.req) tenv.tmc.tablets[targetTabletUID].vrdbClient.Wait() require.ErrorIs(t, err, errShortCircuit) @@ -285,10 +289,11 @@ func TestCreateVReplicationWorkflow(t *testing.T) { } } -// TestMoveTables tests the query generated from a VtctldServer -// MoveTablesCreate request to ensure that the VReplication -// stream(s) are created correctly. Followed by ensuring that -// SwitchTraffic and ReverseTraffic work as expected. +// TestMoveTables tests the query sequence originating from a +// VtctldServer MoveTablesCreate request to ensure that the +// VReplication stream(s) are created correctly and expected +// results returned. Followed by ensuring that SwitchTraffic +// and ReverseTraffic also work as expected. func TestMoveTables(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -300,6 +305,7 @@ func TestMoveTables(t *testing.T) { globalKs := "global" globalShard := "0" wf := "testwf" + vreplID := 1 tabletTypes := []topodatapb.TabletType{ topodatapb.TabletType_PRIMARY, topodatapb.TabletType_REPLICA, @@ -320,7 +326,7 @@ func TestMoveTables(t *testing.T) { globalTablet := tenv.addTablet(t, 500, globalKs, globalShard) defer tenv.deleteTablet(globalTablet.tablet) - tenv.ts.SaveVSchema(ctx, globalKs, &vschemapb.Keyspace{ + err := tenv.ts.SaveVSchema(ctx, globalKs, &vschemapb.Keyspace{ Sharded: false, Tables: map[string]*vschemapb.Table{ "t1_seq": { @@ -328,7 +334,8 @@ func TestMoveTables(t *testing.T) { }, }, }) - tenv.ts.SaveVSchema(ctx, targetKs, &vschemapb.Keyspace{ + require.NoError(t, err) + err = tenv.ts.SaveVSchema(ctx, targetKs, &vschemapb.Keyspace{ Sharded: true, Vindexes: map[string]*vschemapb.Vindex{ "hash": { @@ -348,9 +355,21 @@ func TestMoveTables(t *testing.T) { }, }, }) + require.NoError(t, err) ws := workflow.NewServer(vtenv.NewTestEnv(), tenv.ts, tenv.tmc) + idQuery, err := sqlparser.ParseAndBind("select id from _vt.vreplication where id = %a", + sqltypes.Int64BindVariable(int64(vreplID))) + require.NoError(t, err) + idRes := sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "id", + "int64", + ), + fmt.Sprintf("%d", vreplID), + ) + tenv.mysqld.Schema = defaultSchema tenv.mysqld.Schema.DatabaseSchema = tenv.dbName tenv.mysqld.FetchSuperQueryMap = make(map[string]*sqltypes.Result) @@ -370,118 +389,68 @@ func TestMoveTables(t *testing.T) { tenv.tmc.setVReplicationExecResults(sourceTablet.tablet, checkForJournal, &sqltypes.Result{}) for _, ftc := range targetShards { - tenv.tmc.setVReplicationExecResults(ftc.tablet, fmt.Sprintf(checkForWorkflow, targetKs, wf), &sqltypes.Result{}) - tenv.tmc.setVReplicationExecResults(ftc.tablet, fmt.Sprintf(checkForFrozenWorkflow, targetKs), &sqltypes.Result{}) - tenv.tmc.setVReplicationExecResults(ftc.tablet, fmt.Sprintf(getWorkflow, targetKs, wf), - sqltypes.MakeTestResult( - sqltypes.MakeTestFields( - "id", - "int64", - ), - "1", - ), - ) - tenv.tmc.setVReplicationExecResults(ftc.tablet, getCopyState, &sqltypes.Result{}) - tenv.tmc.setVReplicationExecResults(ftc.tablet, fmt.Sprintf(getWorkflowStatus, wf, targetKs), - sqltypes.MakeTestResult( - sqltypes.MakeTestFields( - "id|workflow|source|pos|stop_pos|max_replication_log|state|db_name|time_updated|transaction_timestamp|message|tags|workflow_type|workflow_sub_type|time_heartbeat|defer_secondary_keys|component_throttled|time_throttled|rows_copied", - "int64|varchar|blob|varchar|varchar|int64|varchar|varchar|int64|int64|varchar|varchar|int64|int64|int64|int64|varchar|int64|int64", - ), - fmt.Sprintf("1|%s|%s|%s|NULL|0|running|vt_%s|1686577659|0|||1|0|0|0||0|10", wf, bls, position, targetKs), - ), - ) - tenv.tmc.setVReplicationExecResults(ftc.tablet, getLatestCopyState, &sqltypes.Result{}) + addInvariants(ftc.vrdbClient, vreplID, sourceTabletUID, position, wf, tenv.cells[0]) - ftc.vrdbClient.ExpectRequest("use _vt", &sqltypes.Result{}, nil) - insert := fmt.Sprintf(`%s values ('%s', 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"t1\" filter:\"select * from t1 where in_keyrange(id, \'%s.hash\', \'%s\')\"}}', '', 0, 0, '%s', 'primary,replica,rdonly', now(), 0, 'Stopped', '%s', 1, 0, 0)`, - insertVReplicationPrefix, wf, sourceKs, sourceShard, targetKs, ftc.tablet.Shard, tenv.cells[0], tenv.dbName) + tenv.tmc.setVReplicationExecResults(ftc.tablet, getCopyState, &sqltypes.Result{}) + ftc.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + insert := fmt.Sprintf(`%s values ('%s', 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"t1\" filter:\"select * from t1 where in_keyrange(id, \'%s.hash\', \'%s\')\"}}', '', 0, 0, '%s', 'primary,replica,rdonly', now(), 0, 'Stopped', '%s', %d, 0, 0)`, + insertVReplicationPrefix, wf, sourceKs, sourceShard, targetKs, ftc.tablet.Shard, tenv.cells[0], tenv.dbName, vreplID) ftc.vrdbClient.ExpectRequest(insert, &sqltypes.Result{InsertID: 1}, nil) ftc.vrdbClient.ExpectRequest(getAutoIncrementStep, &sqltypes.Result{}, nil) - ftc.vrdbClient.ExpectRequest(getVReplicationRecord, + ftc.vrdbClient.ExpectRequest(fmt.Sprintf(getVReplicationRecord, vreplID), sqltypes.MakeTestResult( sqltypes.MakeTestFields( "id|source", "int64|varchar", ), - fmt.Sprintf("1|%s", bls), + fmt.Sprintf("%d|%s", vreplID, bls), ), nil) - ftc.vrdbClient.ExpectRequest(fmt.Sprintf(updatePickedSourceTablet, tenv.cells[0], sourceTabletUID), &sqltypes.Result{}, nil) - ftc.vrdbClient.ExpectRequest(setSessionTZ, &sqltypes.Result{}, nil) - ftc.vrdbClient.ExpectRequest(setNames, &sqltypes.Result{}, nil) - ftc.vrdbClient.ExpectRequest(setNetReadTimeout, &sqltypes.Result{}, nil) - ftc.vrdbClient.ExpectRequest(setNetWriteTimeout, &sqltypes.Result{}, nil) - ftc.vrdbClient.ExpectRequest(getRowsCopied, - sqltypes.MakeTestResult( - sqltypes.MakeTestFields( - "rows_copied", - "int64", - ), - "0", - ), - nil, - ) - ftc.vrdbClient.ExpectRequest(getWorkflowState, sqltypes.MakeTestResult( + ftc.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflow, wf, tenv.dbName), sqltypes.MakeTestResult( sqltypes.MakeTestFields( - "pos|stop_pos|max_tps|max_replication_lag|state|workflow_type|workflow|workflow_sub_type|defer_secondary_keys", - "varchar|varchar|int64|int64|varchar|int64|varchar|int64|int64", + "id|source|pos|stop_pos|max_tps|max_replication_lag|cell|tablet_types|time_updated|transaction_timestamp|state|message|db_name|rows_copied|tags|time_heartbeat|workflow_type|time_throttled|component_throttled|workflow_sub_type|defer_secondary_keys", + "int64|varchar|blob|varchar|int64|int64|varchar|varchar|int64|int64|varchar|varchar|varchar|int64|varchar|int64|int64|int64|varchar|int64|int64", ), - fmt.Sprintf("||0|0|Stopped|1|%s|0|0", wf), + fmt.Sprintf("%d|%s|%s|NULL|0|0|||1686577659|0|Stopped||%s|1||0|0|0||0|1", vreplID, bls, position, targetKs), ), nil) - ftc.vrdbClient.ExpectRequest(getNumCopyStateTable, sqltypes.MakeTestResult( + ftc.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflowConfig, wf), sqltypes.MakeTestResult( sqltypes.MakeTestFields( - "count(distinct table_name)", - "int64", + "id|source|cell|tablet_types|state|message", + "int64|blob|varchar|varchar|varchar|varchar", ), - "1", + fmt.Sprintf("%d|%s|||Stopped|", vreplID, bls), ), nil) - ftc.vrdbClient.ExpectRequest(getWorkflowState, sqltypes.MakeTestResult( + ftc.vrdbClient.ExpectRequest(idQuery, idRes, nil) + ftc.vrdbClient.ExpectRequest(fmt.Sprintf(updateWorkflow, binlogdatapb.VReplicationWorkflowState_Running.String(), strings.Replace(bls, `"`, `\"`, -1), "", "", vreplID), &sqltypes.Result{}, nil) + ftc.vrdbClient.ExpectRequest(fmt.Sprintf(getVReplicationRecord, vreplID), + sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "id|source", + "int64|varchar", + ), + fmt.Sprintf("%d|%s", vreplID, bls), + ), nil) + ftc.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflow, wf, tenv.dbName), sqltypes.MakeTestResult( sqltypes.MakeTestFields( - "pos|stop_pos|max_tps|max_replication_lag|state|workflow_type|workflow|workflow_sub_type|defer_secondary_keys", - "varchar|varchar|int64|int64|varchar|int64|varchar|int64|int64", + "id|source|pos|stop_pos|max_tps|max_replication_lag|cell|tablet_types|time_updated|transaction_timestamp|state|message|db_name|rows_copied|tags|time_heartbeat|workflow_type|time_throttled|component_throttled|workflow_sub_type|defer_secondary_keys", + "int64|varchar|blob|varchar|int64|int64|varchar|varchar|int64|int64|varchar|varchar|varchar|int64|varchar|int64|int64|int64|varchar|int64|int64", ), - fmt.Sprintf("||0|0|Stopped|1|%s|0|0", wf), + fmt.Sprintf("%d|%s|%s|NULL|0|0|||1686577659|0|Running||%s|1||0|0|0||0|1", vreplID, bls, position, targetKs), ), nil) - ftc.vrdbClient.ExpectRequest(getNumCopyStateTable, sqltypes.MakeTestResult( + ftc.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflowsLimited, tenv.dbName, wf), sqltypes.MakeTestResult( sqltypes.MakeTestFields( - "count(distinct table_name)", - "int64", + "workflow|id|source|pos|stop_pos|max_tps|max_replication_lag|cell|tablet_types|time_updated|transaction_timestamp|state|message|db_name|rows_copied|tags|time_heartbeat|workflow_type|time_throttled|component_throttled|workflow_sub_type|defer_secondary_keys", + "workflow|int64|varchar|blob|varchar|int64|int64|varchar|varchar|int64|int64|varchar|varchar|varchar|int64|varchar|int64|int64|int64|varchar|int64|int64", ), - "1", + fmt.Sprintf("%s|%d|%s|%s|NULL|0|0|||1686577659|0|Running||%s|1||0|0|0||0|1", wf, vreplID, bls, position, targetKs), ), nil) - ftc.vrdbClient.ExpectRequest(getBinlogRowImage, sqltypes.MakeTestResult( + ftc.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflow, wf, tenv.dbName), sqltypes.MakeTestResult( sqltypes.MakeTestFields( - "@@binlog_row_image", - "varchar", + "id|source|pos|stop_pos|max_tps|max_replication_lag|cell|tablet_types|time_updated|transaction_timestamp|state|message|db_name|rows_copied|tags|time_heartbeat|workflow_type|time_throttled|component_throttled|workflow_sub_type|defer_secondary_keys", + "int64|varchar|blob|varchar|int64|int64|varchar|varchar|int64|int64|varchar|varchar|varchar|int64|varchar|int64|int64|int64|varchar|int64|int64", ), - "FULL", + fmt.Sprintf("%d|%s|%s|NULL|0|0|||1686577659|0|Running||%s|1||0|0|0||0|1", vreplID, bls, position, targetKs), ), nil) - - ftc.vrdbClient.ExpectRequest(fmt.Sprintf(insertStreamsCreatedLog, bls), &sqltypes.Result{}, nil) - tenv.tmc.setVReplicationExecResults(ftc.tablet, fmt.Sprintf(getWorkflow, targetKs, wf), - sqltypes.MakeTestResult( - sqltypes.MakeTestFields( - "id", - "int64", - ), - "1", - ), - ) - tenv.tmc.setVReplicationExecResults(ftc.tablet, fmt.Sprintf(startWorkflow, targetKs, wf), &sqltypes.Result{}) - ftc.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.DefaultName), &sqltypes.Result{}, nil) - - tenv.tmc.setVReplicationExecResults(ftc.tablet, stopForCutover, &sqltypes.Result{}) - tenv.tmc.setVReplicationExecResults(ftc.tablet, fmt.Sprintf(freezeWorkflow, targetKs, wf), &sqltypes.Result{}) - - tenv.tmc.setVReplicationExecResults(ftc.tablet, fmt.Sprintf(getMaxValForSequence, targetKs, "t1"), - sqltypes.MakeTestResult( - sqltypes.MakeTestFields( - "maxval", - "int64", - ), - fmt.Sprintf("%d", ftc.tablet.Alias.Uid), // Use the tablet's UID as the max value - ), - ) + tenv.tmc.setVReplicationExecResults(ftc.tablet, fmt.Sprintf(getLatestCopyState, vreplID, vreplID), &sqltypes.Result{}) } // We use the tablet's UID in the mocked results for the max value used on each target shard. @@ -491,7 +460,7 @@ func TestMoveTables(t *testing.T) { &sqltypes.Result{RowsAffected: 0}, ) - _, err := ws.MoveTablesCreate(ctx, &vtctldatapb.MoveTablesCreateRequest{ + _, err = ws.MoveTablesCreate(ctx, &vtctldatapb.MoveTablesCreateRequest{ SourceKeyspace: sourceKs, TargetKeyspace: targetKs, Workflow: wf, @@ -502,6 +471,23 @@ func TestMoveTables(t *testing.T) { }) require.NoError(t, err) + for _, ftc := range targetShards { + ftc.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflowsLimited, tenv.dbName, wf), sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "workflow|id|source|pos|stop_pos|max_tps|max_replication_lag|cell|tablet_types|time_updated|transaction_timestamp|state|message|db_name|rows_copied|tags|time_heartbeat|workflow_type|time_throttled|component_throttled|workflow_sub_type|defer_secondary_keys", + "workflow|int64|varchar|blob|varchar|int64|int64|varchar|varchar|int64|int64|varchar|varchar|varchar|int64|varchar|int64|int64|int64|varchar|int64|int64", + ), + fmt.Sprintf("%s|%d|%s|%s|NULL|0|0|||1686577659|0|Running||%s|1||0|0|0||0|1", wf, vreplID, bls, position, targetKs), + ), nil) + ftc.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflow, wf, tenv.dbName), sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "id|source|pos|stop_pos|max_tps|max_replication_lag|cell|tablet_types|time_updated|transaction_timestamp|state|message|db_name|rows_copied|tags|time_heartbeat|workflow_type|time_throttled|component_throttled|workflow_sub_type|defer_secondary_keys", + "int64|varchar|blob|varchar|int64|int64|varchar|varchar|int64|int64|varchar|varchar|varchar|int64|varchar|int64|int64|int64|varchar|int64|int64", + ), + fmt.Sprintf("%d|%s|%s|NULL|0|0|||1686577659|0|Running||%s|1||0|0|0||0|1", vreplID, bls, position, targetKs), + ), nil) + } + _, err = ws.WorkflowSwitchTraffic(ctx, &vtctldatapb.WorkflowSwitchTrafficRequest{ Keyspace: targetKs, Workflow: wf, @@ -513,15 +499,31 @@ func TestMoveTables(t *testing.T) { }) require.NoError(t, err) - tenv.tmc.setVReplicationExecResults(sourceTablet.tablet, fmt.Sprintf(getWorkflowStatus, workflow.ReverseWorkflowName(wf), sourceKs), - sqltypes.MakeTestResult( + for _, ftc := range targetShards { + ftc.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflow, wf, tenv.dbName), sqltypes.MakeTestResult( sqltypes.MakeTestFields( - "id|workflow|source|pos|stop_pos|max_replication_log|state|db_name|time_updated|transaction_timestamp|message|tags|workflow_type|workflow_sub_type|time_heartbeat|defer_secondary_keys|component_throttled|time_throttled|rows_copied", - "int64|varchar|blob|varchar|varchar|int64|varchar|varchar|int64|int64|varchar|varchar|int64|int64|int64|int64|varchar|int64|int64", + "id|source|pos|stop_pos|max_tps|max_replication_lag|cell|tablet_types|time_updated|transaction_timestamp|state|message|db_name|rows_copied|tags|time_heartbeat|workflow_type|time_throttled|component_throttled|workflow_sub_type|defer_secondary_keys", + "int64|varchar|blob|varchar|int64|int64|varchar|varchar|int64|int64|varchar|varchar|varchar|int64|varchar|int64|int64|int64|varchar|int64|int64", ), - fmt.Sprintf("1|%s|%s|%s|NULL|0|running|vt_%s|1686577659|0|||1|0|0|0||0|10", workflow.ReverseWorkflowName(wf), bls, position, sourceKs), + fmt.Sprintf("%d|%s|%s|NULL|0|0|||1686577659|0|Running||%s|1||0|0|0||0|1", vreplID, bls, position, targetKs), + ), nil) + } + addInvariants(sourceTablet.vrdbClient, vreplID, sourceTabletUID, position, workflow.ReverseWorkflowName(wf), tenv.cells[0]) + sourceTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflow, workflow.ReverseWorkflowName(wf), tenv.dbName), sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "id|source|pos|stop_pos|max_tps|max_replication_lag|cell|tablet_types|time_updated|transaction_timestamp|state|message|db_name|rows_copied|tags|time_heartbeat|workflow_type|time_throttled|component_throttled|workflow_sub_type|defer_secondary_keys", + "int64|varchar|blob|varchar|int64|int64|varchar|varchar|int64|int64|varchar|varchar|varchar|int64|varchar|int64|int64|int64|varchar|int64|int64", ), - ) + fmt.Sprintf("%d|%s|%s|NULL|0|0|||1686577659|0|Running||%s|1||0|0|0||0|1", vreplID, bls, position, sourceKs), + ), nil) + sourceTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflowsLimited, tenv.dbName, workflow.ReverseWorkflowName(wf)), sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "workflow|id|source|pos|stop_pos|max_tps|max_replication_lag|cell|tablet_types|time_updated|transaction_timestamp|state|message|db_name|rows_copied|tags|time_heartbeat|workflow_type|time_throttled|component_throttled|workflow_sub_type|defer_secondary_keys", + "workflow|int64|varchar|blob|varchar|int64|int64|varchar|varchar|int64|int64|varchar|varchar|varchar|int64|varchar|int64|int64|int64|varchar|int64|int64", + ), + fmt.Sprintf("%s|%d|%s|%s|NULL|0|0|||1686577659|0|Running||%s|1||0|0|0||0|1", workflow.ReverseWorkflowName(wf), vreplID, bls, position, sourceKs), + ), nil) + sourceTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflow, wf, tenv.dbName), &sqltypes.Result{}, nil) _, err = ws.WorkflowSwitchTraffic(ctx, &vtctldatapb.WorkflowSwitchTrafficRequest{ Keyspace: targetKs, @@ -550,7 +552,7 @@ func TestUpdateVReplicationWorkflow(t *testing.T) { tablet := tenv.addTablet(t, tabletUID, keyspace, shard) defer tenv.deleteTablet(tablet.tablet) - parsed := sqlparser.BuildParsedQuery(sqlSelectVReplicationWorkflowConfig, sidecar.DefaultName, ":wf") + parsed := sqlparser.BuildParsedQuery(sqlSelectVReplicationWorkflowConfig, sidecar.GetIdentifier(), ":wf") bindVars := map[string]*querypb.BindVariable{ "wf": sqltypes.StringBindVariable(workflow), } @@ -675,9 +677,9 @@ func TestUpdateVReplicationWorkflow(t *testing.T) { require.NotEqual(t, "", tt.query, "No expected query provided") // These are the same for each RPC call. - tenv.tmc.tablets[tabletUID].vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.DefaultName), &sqltypes.Result{}, nil) + tenv.tmc.tablets[tabletUID].vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) tenv.tmc.tablets[tabletUID].vrdbClient.ExpectRequest(selectQuery, selectRes, nil) - tenv.tmc.tablets[tabletUID].vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.DefaultName), &sqltypes.Result{}, nil) + tenv.tmc.tablets[tabletUID].vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) tenv.tmc.tablets[tabletUID].vrdbClient.ExpectRequest(idQuery, idRes, nil) // This is our expected query, which will also short circuit @@ -691,6 +693,109 @@ func TestUpdateVReplicationWorkflow(t *testing.T) { } } +func TestUpdateVReplicationWorkflows(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + keyspace := "testks" + tabletUID := 100 + // VREngine.Exec queries the records in the table and explicitly adds a where id in (...) clause. + vreplIDs := []string{"1", "2", "3"} + + tenv := newTestEnv(t, ctx, keyspace, []string{shard}) + defer tenv.close() + + tablet := tenv.addTablet(t, tabletUID, keyspace, shard) + defer tenv.deleteTablet(tablet.tablet) + + tests := []struct { + name string + request *tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest + query string + }{ + { + name: "update only state=running for all workflows", + request: &tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest{ + AllWorkflows: true, + State: binlogdatapb.VReplicationWorkflowState_Running, + Message: textutil.SimulatedNullString, + StopPosition: textutil.SimulatedNullString, + }, + query: fmt.Sprintf(`update /*vt+ ALLOW_UNSAFE_VREPLICATION_WRITE */ _vt.vreplication set state = 'Running' where id in (%s)`, strings.Join(vreplIDs, ", ")), + }, + { + name: "update only state=running for all but reverse workflows", + request: &tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest{ + ExcludeWorkflows: []string{workflow.ReverseWorkflowName("testwf")}, + State: binlogdatapb.VReplicationWorkflowState_Running, + Message: textutil.SimulatedNullString, + StopPosition: textutil.SimulatedNullString, + }, + query: fmt.Sprintf(`update /*vt+ ALLOW_UNSAFE_VREPLICATION_WRITE */ _vt.vreplication set state = 'Running' where id in (%s)`, strings.Join(vreplIDs, ", ")), + }, + { + name: "update all vals for all workflows", + request: &tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest{ + AllWorkflows: true, + State: binlogdatapb.VReplicationWorkflowState_Running, + Message: "hi", + StopPosition: position, + }, + query: fmt.Sprintf(`update /*vt+ ALLOW_UNSAFE_VREPLICATION_WRITE */ _vt.vreplication set state = 'Running', message = 'hi', stop_pos = '%s' where id in (%s)`, position, strings.Join(vreplIDs, ", ")), + }, + { + name: "update state=stopped, messege=for vdiff for two workflows", + request: &tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest{ + IncludeWorkflows: []string{"testwf", "testwf2"}, + State: binlogdatapb.VReplicationWorkflowState_Running, + Message: textutil.SimulatedNullString, + StopPosition: textutil.SimulatedNullString, + }, + query: fmt.Sprintf(`update /*vt+ ALLOW_UNSAFE_VREPLICATION_WRITE */ _vt.vreplication set state = 'Running' where id in (%s)`, strings.Join(vreplIDs, ", ")), + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // This is needed because MockDBClient uses t.Fatal() + // which doesn't play well with subtests. + defer func() { + if err := recover(); err != nil { + t.Errorf("Recovered from panic: %v", err) + } + }() + + require.NotNil(t, tt.request, "No request provided") + require.NotEqual(t, "", tt.query, "No expected query provided") + + // These are the same for each RPC call. + tenv.tmc.tablets[tabletUID].vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + addlPredicates := "" + if len(tt.request.GetIncludeWorkflows()) > 0 { + addlPredicates = fmt.Sprintf(" and workflow in ('%s')", strings.Join(tt.request.GetIncludeWorkflows(), "', '")) + } + if len(tt.request.GetExcludeWorkflows()) > 0 { + addlPredicates = fmt.Sprintf(" and workflow not in ('%s')", strings.Join(tt.request.GetExcludeWorkflows(), "', '")) + } + tenv.tmc.tablets[tabletUID].vrdbClient.ExpectRequest(fmt.Sprintf("select id from _vt.vreplication where db_name = '%s'%s", tenv.dbName, addlPredicates), + sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "id", + "int64", + ), + vreplIDs...), + nil) + + // This is our expected query, which will also short circuit + // the test with an error as at this point we've tested what + // we wanted to test. + tenv.tmc.tablets[tabletUID].vrdbClient.ExpectRequest(tt.query, &sqltypes.Result{}, errShortCircuit) + _, err := tenv.tmc.tablets[tabletUID].tm.UpdateVReplicationWorkflows(ctx, tt.request) + tenv.tmc.tablets[tabletUID].vrdbClient.Wait() + require.ErrorIs(t, err, errShortCircuit) + }) + } +} + // TestSourceShardSelection tests the RPC calls made by VtctldServer to tablet // managers include the correct set of BLS settings. // @@ -739,7 +844,7 @@ func TestSourceShardSelection(t *testing.T) { ws := workflow.NewServer(vtenv.NewTestEnv(), tenv.ts, tenv.tmc) - tenv.ts.SaveVSchema(ctx, sourceKs, &vschemapb.Keyspace{ + err := tenv.ts.SaveVSchema(ctx, sourceKs, &vschemapb.Keyspace{ Sharded: true, Vindexes: map[string]*vschemapb.Vindex{ "hash": { @@ -755,7 +860,8 @@ func TestSourceShardSelection(t *testing.T) { }, }, }) - tenv.ts.SaveVSchema(ctx, targetKs, &vschemapb.Keyspace{ + require.NoError(t, err) + err = tenv.ts.SaveVSchema(ctx, targetKs, &vschemapb.Keyspace{ Sharded: true, Vindexes: map[string]*vschemapb.Vindex{ "hash": { @@ -771,6 +877,7 @@ func TestSourceShardSelection(t *testing.T) { }, }, }) + require.NoError(t, err) tests := []struct { name string @@ -846,6 +953,7 @@ func TestSourceShardSelection(t *testing.T) { targetKs, wf), &sqltypes.Result{}) tenv.tmc.setVReplicationExecResults(tt.tablet, fmt.Sprintf("select 1 from _vt.vreplication where db_name='vt_%s' and message='FROZEN' and workflow_sub_type != 1", targetKs), &sqltypes.Result{}) + tenv.tmc.setVReplicationExecResults(tt.tablet, getCopyState, &sqltypes.Result{}) } for _, tt := range tests { @@ -867,13 +975,15 @@ func TestSourceShardSelection(t *testing.T) { tenv.tmc.SetSchema(tt.schema) if tt.vschema != nil { - tenv.ts.SaveVSchema(ctx, targetKs, tt.vschema) + err = tenv.ts.SaveVSchema(ctx, targetKs, tt.vschema) + require.NoError(t, err) } for uid, streams := range tt.streams { tt := targetTablets[uid] + tt.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + tt.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) for i, sourceShard := range streams { - tt.vrdbClient.ExpectRequest("use _vt", &sqltypes.Result{}, nil) var err error if i == len(streams)-1 { // errShortCircuit is intentionally injected into the MoveTables @@ -881,6 +991,7 @@ func TestSourceShardSelection(t *testing.T) { // everything we wanted to in the test. err = errShortCircuit } + tt.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) tt.vrdbClient.ExpectRequest( fmt.Sprintf(`%s values ('%s', 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"t1\" filter:\"select * from t1 where in_keyrange(id, \'%s.hash\', \'%s\')\"}}', '', 0, 0, '%s', '', now(), 0, 'Stopped', '%s', 1, 0, 0)`, insertVReplicationPrefix, wf, sourceKs, sourceShard, targetKs, tt.tablet.Shard, tenv.cells[0], tenv.dbName), @@ -930,6 +1041,7 @@ func TestFailedMoveTablesCreateCleanup(t *testing.T) { targetTabletUID := 300 targetKs := "targetks" wf := "testwf" + vreplID := 1 table := defaultSchema.TableDefinitions[0].Name invalidTimeZone := "NOPE" bls := fmt.Sprintf("keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"%s\" filter:\"select * from %s\"}}", @@ -959,18 +1071,9 @@ func TestFailedMoveTablesCreateCleanup(t *testing.T) { err := topotools.SaveRoutingRules(ctx, tenv.ts, nil) require.NoError(t, err, "failed to save routing rules") - tenv.tmc.setVReplicationExecResults(targetTablet.tablet, fmt.Sprintf(checkForWorkflow, targetKs, wf), &sqltypes.Result{}) - tenv.tmc.setVReplicationExecResults(targetTablet.tablet, fmt.Sprintf(checkForFrozenWorkflow, targetKs), &sqltypes.Result{}) - tenv.tmc.setVReplicationExecResults(targetTablet.tablet, fmt.Sprintf(getWorkflow, targetKs, wf), - sqltypes.MakeTestResult( - sqltypes.MakeTestFields( - "id", - "int64", - ), - "1", - ), - ) - targetTablet.vrdbClient.ExpectRequest("use _vt", &sqltypes.Result{}, nil) + addInvariants(targetTablet.vrdbClient, vreplID, sourceTabletUID, position, wf, tenv.cells[0]) + + tenv.tmc.tablets[targetTabletUID].vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) targetTablet.vrdbClient.ExpectRequest( fmt.Sprintf("%s %s", insertVReplicationPrefix, @@ -984,82 +1087,24 @@ func TestFailedMoveTablesCreateCleanup(t *testing.T) { nil, ) targetTablet.vrdbClient.ExpectRequest(getAutoIncrementStep, &sqltypes.Result{}, nil) - targetTablet.vrdbClient.ExpectRequest(getVReplicationRecord, + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(getVReplicationRecord, vreplID), sqltypes.MakeTestResult( sqltypes.MakeTestFields( "id|source", "int64|varchar", ), - fmt.Sprintf("1|%s", bls), - ), - nil, - ) - targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(updatePickedSourceTablet, tenv.cells[0], sourceTabletUID), - &sqltypes.Result{}, nil) - targetTablet.vrdbClient.ExpectRequest(setSessionTZ, &sqltypes.Result{}, nil) - targetTablet.vrdbClient.ExpectRequest(setNames, &sqltypes.Result{}, nil) - targetTablet.vrdbClient.ExpectRequest(setNetReadTimeout, &sqltypes.Result{}, nil) - targetTablet.vrdbClient.ExpectRequest(setNetWriteTimeout, &sqltypes.Result{}, nil) - targetTablet.vrdbClient.ExpectRequest(getRowsCopied, - sqltypes.MakeTestResult( - sqltypes.MakeTestFields( - "rows_copied", - "int64", - ), - "0", - ), - nil, - ) - targetTablet.vrdbClient.ExpectRequest(getWorkflowState, - sqltypes.MakeTestResult( - sqltypes.MakeTestFields( - "pos|stop_pos|max_tps|max_replication_lag|state|workflow_type|workflow|workflow_sub_type|defer_secondary_keys", - "varchar|varchar|int64|int64|varchar|int64|varchar|int64|int64", - ), - fmt.Sprintf("||0|0|Stopped|1|%s|0|0", wf), - ), - nil, - ) - targetTablet.vrdbClient.ExpectRequest(getNumCopyStateTable, - sqltypes.MakeTestResult( - sqltypes.MakeTestFields( - "count(distinct table_name)", - "int64", - ), - "1", - ), - nil, - ) - targetTablet.vrdbClient.ExpectRequest(getWorkflowState, - sqltypes.MakeTestResult( - sqltypes.MakeTestFields( - "pos|stop_pos|max_tps|max_replication_lag|state|workflow_type|workflow|workflow_sub_type|defer_secondary_keys", - "varchar|varchar|int64|int64|varchar|int64|varchar|int64|int64", - ), - fmt.Sprintf("||0|0|Stopped|1|%s|0|0", wf), - ), - nil, - ) - targetTablet.vrdbClient.ExpectRequest(getNumCopyStateTable, - sqltypes.MakeTestResult( - sqltypes.MakeTestFields( - "count(distinct table_name)", - "int64", - ), - "1", + fmt.Sprintf("%d|%s", vreplID, bls), ), nil, ) - targetTablet.vrdbClient.ExpectRequest(getBinlogRowImage, - sqltypes.MakeTestResult( - sqltypes.MakeTestFields( - "@@binlog_row_image", - "varchar", - ), - "FULL", + + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflow, wf, tenv.dbName), sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "id|source|pos|stop_pos|max_tps|max_replication_lag|cell|tablet_types|time_updated|transaction_timestamp|state|message|db_name|rows_copied|tags|time_heartbeat|workflow_type|time_throttled|component_throttled|workflow_sub_type|defer_secondary_keys", + "int64|varchar|blob|varchar|int64|int64|varchar|varchar|int64|int64|varchar|varchar|varchar|int64|varchar|int64|int64|int64|varchar|int64|int64", ), - nil, - ) + fmt.Sprintf("%d|%s|%s|NULL|0|0|||1686577659|0|Stopped||%s|1||0|0|0||0|1", vreplID, bls, position, targetKs), + ), nil) targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(insertStreamsCreatedLog, bls), &sqltypes.Result{}, nil) tenv.tmc.setVReplicationExecResults(targetTablet.tablet, @@ -1109,3 +1154,2122 @@ func TestFailedMoveTablesCreateCleanup(t *testing.T) { require.NoError(t, err, "failed to get target vschema") require.Equal(t, vs, vs2, "expected vschema to be unchanged") } + +// TestHasVReplicationWorkflows tests the simple RPC to be sure +// that it generates the expected query and results for each +// request. +func TestHasVReplicationWorkflows(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceTabletUID := 200 + targetKs := "targetks" + targetTabletUID := 300 + shard := "0" + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceTablet := tenv.addTablet(t, sourceTabletUID, sourceKs, shard) + defer tenv.deleteTablet(sourceTablet.tablet) + targetTablet := tenv.addTablet(t, targetTabletUID, targetKs, shard) + defer tenv.deleteTablet(targetTablet.tablet) + + tests := []struct { + name string + tablet *fakeTabletConn + queryRes *sqltypes.Result + want *tabletmanagerdatapb.HasVReplicationWorkflowsResponse + wantErr bool + }{ + { + name: "source tablet", + tablet: sourceTablet, + queryRes: sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "has_workflows", + "int64", + ), + "0", + ), + want: &tabletmanagerdatapb.HasVReplicationWorkflowsResponse{ + Has: false, + }, + }, + { + name: "target tablet", + tablet: targetTablet, + queryRes: sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "has_workflows", + "int64", + ), + "1", + ), + want: &tabletmanagerdatapb.HasVReplicationWorkflowsResponse{ + Has: true, + }, + }, + { + name: "target tablet with error", + tablet: targetTablet, + queryRes: sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "wut|yu", + "varchar|varchar", + ), + "byeee|felicia", + "no|more", + ), + want: nil, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // This is needed because MockDBClient uses t.Fatal() + // which doesn't play well with subtests. + defer func() { + if err := recover(); err != nil { + t.Errorf("Recovered from panic: %v; Stack: %s", err, string(debug.Stack())) + } + }() + + require.NotNil(t, tt.tablet, "No tablet provided") + + req := &tabletmanagerdatapb.HasVReplicationWorkflowsRequest{} + + tt.tablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + tt.tablet.vrdbClient.ExpectRequest(fmt.Sprintf(hasWorkflows, tenv.dbName), tt.queryRes, nil) + + got, err := tenv.tmc.HasVReplicationWorkflows(ctx, tt.tablet.tablet, req) + if (err != nil) != tt.wantErr { + t.Errorf("TabletManager.HasVReplicationWorkflows() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("TabletManager.HasVReplicationWorkflows() = %v, want %v", got, tt.want) + } + }) + } +} + +// TestReadVReplicationWorkflows tests the RPC requests are turned +// into the expected proper SQL query. +func TestReadVReplicationWorkflows(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + tabletUID := 300 + ks := "targetks" + shard := "0" + tenv := newTestEnv(t, ctx, ks, []string{shard}) + defer tenv.close() + + tablet := tenv.addTablet(t, tabletUID, ks, shard) + defer tenv.deleteTablet(tablet.tablet) + + tests := []struct { + name string + req *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest + wantPreds string // Additional query predicates + wantErr bool + }{ + { + name: "nothing", + req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{}, + // No additional query predicates. + }, + { + name: "all except frozen", + req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ + ExcludeFrozen: true, + }, + wantPreds: " and message != 'FROZEN'", + }, + { + name: "1-3 unless frozen", + req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ + IncludeIds: []int32{1, 2, 3}, + ExcludeFrozen: true, + }, + wantPreds: " and message != 'FROZEN' and id in (1,2,3)", + }, + { + name: "all but wf1 and wf2", + req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ + ExcludeWorkflows: []string{"wf1", "wf2"}, + }, + wantPreds: " and workflow not in ('wf1','wf2')", + }, + { + name: "all but wf1 and wf2", + req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ + ExcludeWorkflows: []string{"wf1", "wf2"}, + }, + wantPreds: " and workflow not in ('wf1','wf2')", + }, + { + name: "only wf1 and wf2", + req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ + IncludeWorkflows: []string{"wf1", "wf2"}, + ExcludeStates: []binlogdatapb.VReplicationWorkflowState{ + binlogdatapb.VReplicationWorkflowState_Stopped, + }, + }, + wantPreds: " and workflow in ('wf1','wf2') and state not in ('Stopped')", + }, + { + name: "only copying or running", + req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ + IncludeStates: []binlogdatapb.VReplicationWorkflowState{ + binlogdatapb.VReplicationWorkflowState_Copying, + binlogdatapb.VReplicationWorkflowState_Running, + }, + }, + wantPreds: " and state in ('Copying','Running')", + }, + { + name: "mess of predicates", + req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ + IncludeIds: []int32{1, 3}, + IncludeWorkflows: []string{"wf1"}, + ExcludeWorkflows: []string{"wf2"}, + ExcludeStates: []binlogdatapb.VReplicationWorkflowState{ + binlogdatapb.VReplicationWorkflowState_Copying, + }, + ExcludeFrozen: true, + }, + wantPreds: " and message != 'FROZEN' and id in (1,3) and workflow in ('wf1') and workflow not in ('wf2') and state not in ('Copying')", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // This is needed because MockDBClient uses t.Fatal() + // which doesn't play well with subtests. + defer func() { + if err := recover(); err != nil { + t.Errorf("Recovered from panic: %v; Stack: %s", err, string(debug.Stack())) + } + }() + + require.NotNil(t, tt.req, "No request provided") + + if !tt.wantErr { // Errors we're testing for occur before executing any queries. + tablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + tablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, tt.wantPreds), &sqltypes.Result{}, nil) + } + + _, err := tenv.tmc.ReadVReplicationWorkflows(ctx, tablet.tablet, tt.req) + if (err != nil) != tt.wantErr { + t.Errorf("TabletManager.ReadVReplicationWorkflows() error = %v, wantErr %v", err, tt.wantErr) + return + } + }) + } +} + +// addInvariants adds handling for queries that can be injected into the +// sequence of queries, N times, in a non-deterministic order. +func addInvariants(dbClient *binlogplayer.MockDBClient, vreplID, sourceTabletUID int, position, workflow, cell string) { + // This reduces a lot of noise, but is also needed as it's executed when any of the + // other queries here are executed via engine.exec(). + dbClient.AddInvariant(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}) + + // The binlogplayer queries result from the controller starting up and the sequence + // within everything else is non-deterministic. + dbClient.AddInvariant(fmt.Sprintf(getWorkflowState, vreplID), sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "pos|stop_pos|max_tps|max_replication_lag|state|workflow_type|workflow|workflow_sub_type|defer_secondary_keys", + "varchar|varchar|int64|int64|varchar|int64|varchar|int64|int64", + ), + fmt.Sprintf("%s||0|0|Stopped|1|%s|0|0", position, workflow), + )) + dbClient.AddInvariant(setSessionTZ, &sqltypes.Result{}) + dbClient.AddInvariant(setNames, &sqltypes.Result{}) + dbClient.AddInvariant(setNetReadTimeout, &sqltypes.Result{}) + dbClient.AddInvariant(setNetWriteTimeout, &sqltypes.Result{}) + + // Same for the vreplicator queries. + dbClient.AddInvariant(fmt.Sprintf(getNumCopyStateTable, vreplID), sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "count(distinct table_name)", + "int64", + ), + "0", + )) + dbClient.AddInvariant(getBinlogRowImage, sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "@@binlog_row_image", + "varchar", + ), + "FULL", + )) + dbClient.AddInvariant(fmt.Sprintf(getRowsCopied, vreplID), sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "rows_copied", + "int64", + ), + "0", + )) + dbClient.AddInvariant(fmt.Sprintf(updatePickedSourceTablet, cell, sourceTabletUID, vreplID), &sqltypes.Result{}) +} + +func addMaterializeSettingsTablesToSchema(ms *vtctldatapb.MaterializeSettings, tenv *testEnv, venv *vtenv.Environment) { + schema := defaultSchema.CloneVT() + for _, ts := range ms.TableSettings { + tableName := ts.TargetTable + table, err := venv.Parser().TableFromStatement(ts.SourceExpression) + if err == nil { + tableName = table.Name.String() + } + schema.TableDefinitions = append(schema.TableDefinitions, &tabletmanagerdatapb.TableDefinition{ + Name: tableName, + Schema: fmt.Sprintf("%s_schema", tableName), + }) + schema.TableDefinitions = append(schema.TableDefinitions, &tabletmanagerdatapb.TableDefinition{ + Name: ts.TargetTable, + Schema: fmt.Sprintf("%s_schema", ts.TargetTable), + }) + } + tenv.tmc.SetSchema(schema) +} + +func TestExternalizeLookupVindex(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceShard := "0" + sourceTabletUID := 200 + targetKs := "targetks" + targetShards := make(map[string]*fakeTabletConn) + targetTabletUID := 300 + wf := "testwf" + vreplID := 1 + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceTablet := tenv.addTablet(t, sourceTabletUID, sourceKs, sourceShard) + defer tenv.deleteTablet(sourceTablet.tablet) + + targetShards["-80"] = tenv.addTablet(t, targetTabletUID, targetKs, "-80") + defer tenv.deleteTablet(targetShards["-80"].tablet) + addInvariants(targetShards["-80"].vrdbClient, vreplID, sourceTabletUID, position, wf, tenv.cells[0]) + targetShards["80-"] = tenv.addTablet(t, targetTabletUID+10, targetKs, "80-") + defer tenv.deleteTablet(targetShards["80-"].tablet) + addInvariants(targetShards["80-"].vrdbClient, vreplID, sourceTabletUID, position, wf, tenv.cells[0]) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + // Keyspace where the vindex is created. + SourceKeyspace: sourceKs, + // Keyspace where the lookup table and VReplication workflow is created. + TargetKeyspace: targetKs, + Cell: tenv.cells[0], + TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ + topodatapb.TabletType_PRIMARY, + topodatapb.TabletType_RDONLY, + }), + } + + sourceVschema := &vschemapb.Keyspace{ + Sharded: false, + Vindexes: map[string]*vschemapb.Vindex{ + "xxhash": { + Type: "xxhash", + }, + "owned_lookup": { + Type: "lookup_unique", + Params: map[string]string{ + "table": "targetks.owned_lookup", + "from": "c1", + "to": "c2", + "write_only": "true", + }, + Owner: "t1", + }, + "unowned_lookup": { + Type: "lookup_unique", + Params: map[string]string{ + "table": "targetks.unowned_lookup", + "from": "c1", + "to": "c2", + "write_only": "true", + }, + }, + "unqualified_lookup": { + Type: "lookup_unique", + Params: map[string]string{ + "table": "unqualified", + "from": "c1", + "to": "c2", + }, + }, + }, + Tables: map[string]*vschemapb.Table{ + "t1": { + ColumnVindexes: []*vschemapb.ColumnVindex{{ + Name: "xxhash", + Column: "col1", + }, { + Name: "owned_lookup", + Column: "col2", + }}, + }, + }, + } + + trxTS := fmt.Sprintf("%d", time.Now().Unix()) + fields := sqltypes.MakeTestFields( + "id|state|message|source|workflow_type|workflow_sub_type|max_tps|max_replication_lag|time_updated|time_heartbeat|time_throttled|transaction_timestamp|rows_copied", + "int64|varbinary|varbinary|blob|int64|int64|int64|int64|int64|int64|int64|int64|int64", + ) + wftype := fmt.Sprintf("%d", binlogdatapb.VReplicationWorkflowType_CreateLookupIndex) + ownedSourceStopAfterCopy := fmt.Sprintf(`keyspace:"%s",shard:"0",filter:{rules:{match:"owned_lookup" filter:"select * from t1 where in_keyrange(col1, '%s.xxhash', '-80')"}} stop_after_copy:true`, + ms.SourceKeyspace, ms.SourceKeyspace) + ownedSourceKeepRunningAfterCopy := fmt.Sprintf(`keyspace:"%s",shard:"0",filter:{rules:{match:"owned_lookup" filter:"select * from t1 where in_keyrange(col1, '%s.xxhash', '-80')"}}`, + ms.SourceKeyspace, ms.SourceKeyspace) + ownedRunning := sqltypes.MakeTestResult(fields, "1|Running|msg|"+ownedSourceKeepRunningAfterCopy+"|"+wftype+"|0|0|0|0|0|0|"+trxTS+"|5") + ownedStopped := sqltypes.MakeTestResult(fields, "1|Stopped|Stopped after copy|"+ownedSourceStopAfterCopy+"|"+wftype+"|0|0|0|0|0|0|"+trxTS+"|5") + unownedSourceStopAfterCopy := fmt.Sprintf(`keyspace:"%s",shard:"0",filter:{rules:{match:"unowned_lookup" filter:"select * from t1 where in_keyrange(col1, '%s.xxhash', '-80')"}} stop_after_copy:true`, + ms.SourceKeyspace, ms.SourceKeyspace) + unownedSourceKeepRunningAfterCopy := fmt.Sprintf(`keyspace:"%s",shard:"0",filter:{rules:{match:"unowned_lookup" filter:"select * from t1 where in_keyrange(col1, '%s.xxhash', '-80')"}}`, + ms.SourceKeyspace, ms.SourceKeyspace) + unownedRunning := sqltypes.MakeTestResult(fields, "2|Running|msg|"+unownedSourceKeepRunningAfterCopy+"|"+wftype+"|0|0|0|0|0|0|"+trxTS+"|5") + unownedStopped := sqltypes.MakeTestResult(fields, "2|Stopped|Stopped after copy|"+unownedSourceStopAfterCopy+"|"+wftype+"|0|0|0|0|0|0|"+trxTS+"|5") + + testcases := []struct { + request *vtctldatapb.LookupVindexExternalizeRequest + vrResponse *sqltypes.Result + err string + expectedVschema *vschemapb.Keyspace + expectDelete bool + }{ + { + request: &vtctldatapb.LookupVindexExternalizeRequest{ + Name: "owned_lookup", + Keyspace: ms.SourceKeyspace, + TableKeyspace: ms.TargetKeyspace, + }, + vrResponse: ownedStopped, + expectedVschema: &vschemapb.Keyspace{ + Vindexes: map[string]*vschemapb.Vindex{ + "owned_lookup": { + Type: "lookup_unique", + Params: map[string]string{ + "table": "targetks.owned_lookup", + "from": "c1", + "to": "c2", + }, + Owner: "t1", + }, + }, + }, + expectDelete: true, + }, + { + request: &vtctldatapb.LookupVindexExternalizeRequest{ + Name: "unowned_lookup", + Keyspace: ms.SourceKeyspace, + TableKeyspace: ms.TargetKeyspace, + }, + vrResponse: unownedStopped, + expectedVschema: &vschemapb.Keyspace{ + Vindexes: map[string]*vschemapb.Vindex{ + "unowned_lookup": { + Type: "lookup_unique", + Params: map[string]string{ + "table": "targetks.unowned_lookup", + "from": "c1", + "to": "c2", + }, + }, + }, + }, + err: "is not in Running state", + }, + { + request: &vtctldatapb.LookupVindexExternalizeRequest{ + Name: "owned_lookup", + Keyspace: ms.SourceKeyspace, + TableKeyspace: ms.TargetKeyspace, + }, + vrResponse: ownedRunning, + expectedVschema: &vschemapb.Keyspace{ + Vindexes: map[string]*vschemapb.Vindex{ + "owned_lookup": { + Type: "lookup_unique", + Params: map[string]string{ + "table": "targetks.owned_lookup", + "from": "c1", + "to": "c2", + }, + Owner: "t1", + }, + }, + }, + expectDelete: true, + }, + { + request: &vtctldatapb.LookupVindexExternalizeRequest{ + Name: "unowned_lookup", + Keyspace: ms.SourceKeyspace, + TableKeyspace: ms.TargetKeyspace, + }, + vrResponse: unownedRunning, + expectedVschema: &vschemapb.Keyspace{ + Vindexes: map[string]*vschemapb.Vindex{ + "unowned_lookup": { + Type: "lookup_unique", + Params: map[string]string{ + "table": "targetks.unowned_lookup", + "from": "c1", + "to": "c2", + }, + }, + }, + }, + }, + { + request: &vtctldatapb.LookupVindexExternalizeRequest{ + Name: "absent_lookup", + Keyspace: ms.SourceKeyspace, + TableKeyspace: ms.TargetKeyspace, + }, + expectedVschema: &vschemapb.Keyspace{ + Vindexes: map[string]*vschemapb.Vindex{ + "absent_lookup": { + Type: "lookup_unique", + Params: map[string]string{ + "table": "targetks.absent_lookup", + "from": "c1", + "to": "c2", + }, + }, + }, + }, + err: "vindex absent_lookup not found in the sourceks keyspace", + }, + } + for _, tcase := range testcases { + t.Run(tcase.request.Name, func(t *testing.T) { + // Resave the source schema for every iteration. + err := tenv.ts.SaveVSchema(ctx, tcase.request.Keyspace, sourceVschema) + require.NoError(t, err) + err = tenv.ts.RebuildSrvVSchema(ctx, []string{tenv.cells[0]}) + require.NoError(t, err) + + require.NotNil(t, tcase.request, "No request provided") + + for _, targetTablet := range targetShards { + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflow, tcase.request.Name, tenv.dbName), tcase.vrResponse, nil) + if tcase.err == "" { + // We query the workflow again to build the status output when + // it's successfully created. + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflow, tcase.request.Name, tenv.dbName), tcase.vrResponse, nil) + } + } + + preWorkflowDeleteCalls := tenv.tmc.workflowDeleteCalls + _, err = ws.LookupVindexExternalize(ctx, tcase.request) + if tcase.err != "" { + if err == nil || !strings.Contains(err.Error(), tcase.err) { + require.FailNow(t, "LookupVindexExternalize error", "ExternalizeVindex(%v) err: %v, must contain %v", tcase.request, err, tcase.err) + } + return + } + require.NoError(t, err) + expectedWorkflowDeleteCalls := preWorkflowDeleteCalls + if tcase.expectDelete { + // We expect the RPC to be called on each target shard. + expectedWorkflowDeleteCalls = preWorkflowDeleteCalls + (len(targetShards)) + } + require.Equal(t, expectedWorkflowDeleteCalls, tenv.tmc.workflowDeleteCalls) + + aftervschema, err := tenv.ts.GetVSchema(ctx, ms.SourceKeyspace) + require.NoError(t, err) + vindex := aftervschema.Vindexes[tcase.request.Name] + expectedVindex := tcase.expectedVschema.Vindexes[tcase.request.Name] + require.NotNil(t, vindex, "vindex %s not found in vschema", tcase.request.Name) + require.NotContains(t, vindex.Params, "write_only", tcase.request) + require.Equal(t, expectedVindex, vindex, "vindex mismatch. expected: %+v, got: %+v", expectedVindex, vindex) + }) + } +} + +func TestMaterializerOneToOne(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceTabletUID := 200 + targetKs := "targetks" + targetTabletUID := 300 + shard := "0" + wf := "testwf" + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceTablet := tenv.addTablet(t, sourceTabletUID, sourceKs, shard) + defer tenv.deleteTablet(sourceTablet.tablet) + targetTablet := tenv.addTablet(t, targetTabletUID, targetKs, shard) + defer tenv.deleteTablet(targetTablet.tablet) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + Workflow: wf, + SourceKeyspace: sourceKs, + TargetKeyspace: targetKs, + TableSettings: []*vtctldatapb.TableMaterializeSettings{ + { + TargetTable: "t1", + SourceExpression: "select * from t1", + CreateDdl: "t1ddl", + }, + { + TargetTable: "t2", + SourceExpression: "select * from t3", + CreateDdl: "t2ddl", + }, + { + TargetTable: "t4", + SourceExpression: "", // empty + CreateDdl: "t4ddl", + }, + }, + Cell: tenv.cells[0], + TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ + topodatapb.TabletType_PRIMARY, + topodatapb.TabletType_RDONLY, + }), + } + + addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) + + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + + // This is our expected query, which will also short circuit + // the test with an error as at this point we've tested what + // we wanted to test. + insert := insertVReplicationPrefix + + fmt.Sprintf(` values ('%s', 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"t1\" filter:\"select * from t1\"} rules:{match:\"t2\" filter:\"select * from t3\"} rules:{match:\"t4\"}}', '', 0, 0, '%s', 'primary,rdonly', now(), 0, 'Stopped', '%s', 0, 0, 0)`, + wf, sourceKs, shard, tenv.cells[0], tenv.dbName) + targetTablet.vrdbClient.ExpectRequest(insert, &sqltypes.Result{}, errShortCircuit) + + err := ws.Materialize(ctx, ms) + targetTablet.vrdbClient.Wait() + require.ErrorIs(t, err, errShortCircuit) +} + +func TestMaterializerManyToOne(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceTabletUID := 200 + sourceShards := make(map[string]*fakeTabletConn) + targetKs := "targetks" + targetTabletUID := 300 + targetShard := "0" + wf := "testwf" + vreplID := 1 + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceShards["-80"] = tenv.addTablet(t, sourceTabletUID, sourceKs, "-80") + defer tenv.deleteTablet(sourceShards["-80"].tablet) + sourceShards["80-"] = tenv.addTablet(t, sourceTabletUID+10, sourceKs, "80-") + defer tenv.deleteTablet(sourceShards["80-"].tablet) + + targetTablet := tenv.addTablet(t, targetTabletUID, targetKs, targetShard) + defer tenv.deleteTablet(targetTablet.tablet) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + Workflow: wf, + SourceKeyspace: sourceKs, + TargetKeyspace: targetKs, + TableSettings: []*vtctldatapb.TableMaterializeSettings{{ + TargetTable: "t1", + SourceExpression: "select * from t1", + CreateDdl: "t1ddl", + }, { + TargetTable: "t2", + SourceExpression: "select * from t3", + CreateDdl: "t2ddl", + }}, + Cell: tenv.cells[0], + TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ + topodatapb.TabletType_PRIMARY, + topodatapb.TabletType_RDONLY, + }), + } + + addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) + targetTablet.vrdbClient.AddInvariant("update _vt.vreplication set message='no schema defined' where id=1", &sqltypes.Result{}) // If the first workflow controller progresses ... + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + + // This is our expected query, which will also short circuit + // the test with an error as at this point we've tested what + // we wanted to test. + for _, sourceShard := range []string{"-80", "80-"} { // One insert per [binlog]source/stream + addInvariants(targetTablet.vrdbClient, vreplID, sourceTabletUID, position, wf, tenv.cells[0]) + + bls := fmt.Sprintf("keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"t1\" filter:\"select * from t1\"} rules:{match:\"t2\" filter:\"select * from t3\"}}", sourceKs, sourceShard) + insert := insertVReplicationPrefix + + fmt.Sprintf(` values ('%s', 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"t1\" filter:\"select * from t1\"} rules:{match:\"t2\" filter:\"select * from t3\"}}', '', 0, 0, '%s', 'primary,rdonly', now(), 0, 'Stopped', '%s', 0, 0, 0)`, + wf, sourceKs, sourceShard, tenv.cells[0], tenv.dbName) + if vreplID == 1 { + targetTablet.vrdbClient.ExpectRequest(insert, &sqltypes.Result{InsertID: uint64(vreplID)}, nil) + targetTablet.vrdbClient.ExpectRequest(getAutoIncrementStep, &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(getVReplicationRecord, vreplID), + sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "id|source", + "int64|varchar", + ), + fmt.Sprintf("%d|%s", vreplID, bls), + ), nil) + vreplID++ + } else { + targetTablet.vrdbClient.ExpectRequest(insert, &sqltypes.Result{InsertID: uint64(vreplID)}, errShortCircuit) + } + } + + err := ws.Materialize(ctx, ms) + targetTablet.vrdbClient.Wait() + require.ErrorIs(t, err, errShortCircuit) +} + +func TestMaterializerOneToMany(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceShard := "0" + sourceTabletUID := 200 + targetKs := "targetks" + targetShards := make(map[string]*fakeTabletConn) + targetTabletUID := 300 + wf := "testwf" + vreplID := 1 + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceTablet := tenv.addTablet(t, sourceTabletUID, sourceKs, sourceShard) + defer tenv.deleteTablet(sourceTablet.tablet) + + targetShards["-80"] = tenv.addTablet(t, targetTabletUID, targetKs, "-80") + defer tenv.deleteTablet(targetShards["-80"].tablet) + targetShards["80-"] = tenv.addTablet(t, targetTabletUID+10, targetKs, "80-") + defer tenv.deleteTablet(targetShards["80-"].tablet) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + Workflow: wf, + SourceKeyspace: sourceKs, + TargetKeyspace: targetKs, + TableSettings: []*vtctldatapb.TableMaterializeSettings{{ + TargetTable: "t1", + SourceExpression: "select * from t1", + CreateDdl: "t1ddl", + }}, + Cell: tenv.cells[0], + TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ + topodatapb.TabletType_PRIMARY, + topodatapb.TabletType_RDONLY, + }), + } + + err := tenv.ts.SaveVSchema(ctx, targetKs, &vschemapb.Keyspace{ + Sharded: true, + Vindexes: map[string]*vschemapb.Vindex{ + "xxhash": { + Type: "xxhash", + }, + }, + Tables: map[string]*vschemapb.Table{ + "t1": { + ColumnVindexes: []*vschemapb.ColumnVindex{{ + Column: "c1", + Name: "xxhash", + }}, + }, + }, + }) + require.NoError(t, err) + + addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) + + // This is our expected query, which will also short circuit + // the test with an error as at this point we've tested what + // we wanted to test. + for _, targetShard := range []string{"-80", "80-"} { + targetTablet := targetShards[targetShard] + addInvariants(targetTablet.vrdbClient, vreplID, sourceTabletUID, position, wf, tenv.cells[0]) + targetTablet.vrdbClient.AddInvariant("update _vt.vreplication set message='no schema defined' where id=1", &sqltypes.Result{}) // If the first workflow controller progresses ... + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + + bls := fmt.Sprintf("keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"t1\" filter:\"select * from t1 where in_keyrange(c1, '%s.xxhash', '%s')\"}}", + sourceKs, sourceShard, targetKs, targetShard) + insert := insertVReplicationPrefix + + fmt.Sprintf(` values ('%s', 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"t1\" filter:\"select * from t1 where in_keyrange(c1, \'%s.xxhash\', \'%s\')\"}}', '', 0, 0, '%s', 'primary,rdonly', now(), 0, 'Stopped', '%s', 0, 0, 0)`, + wf, sourceKs, sourceShard, targetKs, targetShard, tenv.cells[0], tenv.dbName) + if targetShard == "-80" { + targetTablet.vrdbClient.ExpectRequest(insert, &sqltypes.Result{InsertID: uint64(vreplID)}, nil) + targetTablet.vrdbClient.ExpectRequest(getAutoIncrementStep, &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(getVReplicationRecord, vreplID), + sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "id|source", + "int64|varchar", + ), + fmt.Sprintf("%d|%s", vreplID, bls), + ), nil) + } else { + targetTablet.vrdbClient.ExpectRequest(insert, &sqltypes.Result{InsertID: uint64(vreplID)}, errShortCircuit) + } + } + + err = ws.Materialize(ctx, ms) + for _, targetTablet := range targetShards { + targetTablet.vrdbClient.Wait() + } + require.ErrorIs(t, err, errShortCircuit) +} + +func TestMaterializerManyToMany(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceShards := make(map[string]*fakeTabletConn) + sourceTabletUID := 200 + targetKs := "targetks" + targetShards := make(map[string]*fakeTabletConn) + targetTabletUID := 300 + wf := "testwf" + vreplID := 1 + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceShards["-40"] = tenv.addTablet(t, sourceTabletUID, sourceKs, "-40") + defer tenv.deleteTablet(sourceShards["-40"].tablet) + sourceShards["40-"] = tenv.addTablet(t, sourceTabletUID+10, sourceKs, "40-") + defer tenv.deleteTablet(sourceShards["40-"].tablet) + + targetShards["-80"] = tenv.addTablet(t, targetTabletUID, targetKs, "-80") + defer tenv.deleteTablet(targetShards["-80"].tablet) + targetShards["80-"] = tenv.addTablet(t, targetTabletUID+10, targetKs, "80-") + defer tenv.deleteTablet(targetShards["80-"].tablet) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + Workflow: wf, + SourceKeyspace: sourceKs, + TargetKeyspace: targetKs, + TableSettings: []*vtctldatapb.TableMaterializeSettings{{ + TargetTable: "t1", + SourceExpression: "select * from t1", + CreateDdl: "t1ddl", + }}, + Cell: tenv.cells[0], + TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ + topodatapb.TabletType_PRIMARY, + topodatapb.TabletType_RDONLY, + }), + } + + err := tenv.ts.SaveVSchema(ctx, targetKs, &vschemapb.Keyspace{ + Sharded: true, + Vindexes: map[string]*vschemapb.Vindex{ + "xxhash": { + Type: "xxhash", + }, + }, + Tables: map[string]*vschemapb.Table{ + "t1": { + ColumnVindexes: []*vschemapb.ColumnVindex{{ + Column: "c1", + Name: "xxhash", + }}, + }, + }, + }) + require.NoError(t, err) + + addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) + + // This is our expected query, which will also short circuit + // the test with an error as at this point we've tested what + // we wanted to test. + for _, targetShard := range []string{"-80", "80-"} { + targetTablet := targetShards[targetShard] + targetTablet.vrdbClient.AddInvariant("update _vt.vreplication set message='no schema defined' where id=1", &sqltypes.Result{}) // If the first workflow controller progresses ... + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + + for i, sourceShard := range []string{"-40", "40-"} { // One insert per [binlog]source/stream + addInvariants(targetTablet.vrdbClient, vreplID, sourceTabletUID+(i*10), position, wf, tenv.cells[0]) + bls := fmt.Sprintf("keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"t1\" filter:\"select * from t1 where in_keyrange(c1, '%s.xxhash', '%s')\"}}", + sourceKs, sourceShard, targetKs, targetShard) + insert := insertVReplicationPrefix + + fmt.Sprintf(` values ('%s', 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"t1\" filter:\"select * from t1 where in_keyrange(c1, \'%s.xxhash\', \'%s\')\"}}', '', 0, 0, '%s', 'primary,rdonly', now(), 0, 'Stopped', '%s', 0, 0, 0)`, + wf, sourceKs, sourceShard, targetKs, targetShard, tenv.cells[0], tenv.dbName) + if targetShard == "80-" && sourceShard == "40-" { // Last insert + targetTablet.vrdbClient.ExpectRequest(insert, &sqltypes.Result{InsertID: uint64(vreplID)}, errShortCircuit) + } else { // Can't short circuit as we will do more inserts + targetTablet.vrdbClient.ExpectRequest(insert, &sqltypes.Result{InsertID: uint64(vreplID)}, nil) + targetTablet.vrdbClient.ExpectRequest(getAutoIncrementStep, &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(getVReplicationRecord, vreplID), + sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "id|source", + "int64|varchar", + ), + fmt.Sprintf("%d|%s", vreplID, bls), + ), nil) + } + } + } + + err = ws.Materialize(ctx, ms) + for _, targetTablet := range targetShards { + targetTablet.vrdbClient.Wait() + } + require.ErrorIs(t, err, errShortCircuit) +} + +func TestMaterializerMulticolumnVindex(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceShard := "0" + sourceTabletUID := 200 + targetKs := "targetks" + targetShards := make(map[string]*fakeTabletConn) + targetTabletUID := 300 + wf := "testwf" + vreplID := 1 + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceTablet := tenv.addTablet(t, sourceTabletUID, sourceKs, sourceShard) + defer tenv.deleteTablet(sourceTablet.tablet) + + targetShards["-80"] = tenv.addTablet(t, targetTabletUID, targetKs, "-80") + defer tenv.deleteTablet(targetShards["-80"].tablet) + targetShards["80-"] = tenv.addTablet(t, targetTabletUID+10, targetKs, "80-") + defer tenv.deleteTablet(targetShards["80-"].tablet) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + Workflow: wf, + SourceKeyspace: sourceKs, + TargetKeyspace: targetKs, + TableSettings: []*vtctldatapb.TableMaterializeSettings{{ + TargetTable: "t1", + SourceExpression: "select * from t1", + CreateDdl: "t1ddl", + }}, + Cell: tenv.cells[0], + TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ + topodatapb.TabletType_PRIMARY, + topodatapb.TabletType_RDONLY, + }), + } + + err := tenv.ts.SaveVSchema(ctx, targetKs, &vschemapb.Keyspace{ + Sharded: true, + Vindexes: map[string]*vschemapb.Vindex{ + "region": { + Type: "region_experimental", + Params: map[string]string{ + "region_bytes": "1", + }, + }, + }, + Tables: map[string]*vschemapb.Table{ + "t1": { + ColumnVindexes: []*vschemapb.ColumnVindex{{ + Columns: []string{"c1", "c2"}, + Name: "region", + }}, + }, + }, + }) + require.NoError(t, err) + + addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) + + // This is our expected query, which will also short circuit + // the test with an error as at this point we've tested what + // we wanted to test. + for _, targetShard := range []string{"-80", "80-"} { + targetTablet := targetShards[targetShard] + addInvariants(targetTablet.vrdbClient, vreplID, sourceTabletUID, position, wf, tenv.cells[0]) + targetTablet.vrdbClient.AddInvariant("update _vt.vreplication set message='no schema defined' where id=1", &sqltypes.Result{}) // If the first workflow controller progresses ... + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + + bls := fmt.Sprintf("keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"t1\" filter:\"select * from t1 where in_keyrange(c1, c2, '%s.region', '%s')\"}}", + sourceKs, sourceShard, targetKs, targetShard) + insert := insertVReplicationPrefix + + fmt.Sprintf(` values ('%s', 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"t1\" filter:\"select * from t1 where in_keyrange(c1, c2, \'%s.region\', \'%s\')\"}}', '', 0, 0, '%s', 'primary,rdonly', now(), 0, 'Stopped', '%s', 0, 0, 0)`, + wf, sourceKs, sourceShard, targetKs, targetShard, tenv.cells[0], tenv.dbName) + if targetShard == "-80" { + targetTablet.vrdbClient.ExpectRequest(insert, &sqltypes.Result{InsertID: uint64(vreplID)}, nil) + targetTablet.vrdbClient.ExpectRequest(getAutoIncrementStep, &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(getVReplicationRecord, vreplID), + sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "id|source", + "int64|varchar", + ), + fmt.Sprintf("%d|%s", vreplID, bls), + ), nil) + } else { + targetTablet.vrdbClient.ExpectRequest(insert, &sqltypes.Result{InsertID: uint64(vreplID)}, errShortCircuit) + } + } + + err = ws.Materialize(ctx, ms) + for _, targetTablet := range targetShards { + targetTablet.vrdbClient.Wait() + } + require.ErrorIs(t, err, errShortCircuit) +} + +func TestMaterializerDeploySchema(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceTabletUID := 100 + targetKs := "targetks" + targetTabletUID := 200 + shard := "0" + wf := "testwf" + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceTablet := tenv.addTablet(t, sourceTabletUID, sourceKs, shard) + defer tenv.deleteTablet(sourceTablet.tablet) + targetTablet := tenv.addTablet(t, targetTabletUID, targetKs, shard) + defer tenv.deleteTablet(targetTablet.tablet) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + Workflow: wf, + SourceKeyspace: sourceKs, + TargetKeyspace: targetKs, + TableSettings: []*vtctldatapb.TableMaterializeSettings{{ + TargetTable: "t1", + SourceExpression: "select * from t1", + CreateDdl: "t1ddl", + }, { + TargetTable: "t2", + SourceExpression: "select * from t3", + CreateDdl: "t2ddl", + }}, + Cell: tenv.cells[0], + TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ + topodatapb.TabletType_PRIMARY, + topodatapb.TabletType_RDONLY, + }), + } + + addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) + + // Remove t2 from the target tablet's schema so that it must + // be deployed. + schema := tenv.tmc.schema.CloneVT() + for i, sd := range schema.TableDefinitions { + if sd.Name == "t2" { + schema.TableDefinitions = append(schema.TableDefinitions[:i], schema.TableDefinitions[i+1:]...) + } + } + tenv.tmc.tabletSchemas[targetTabletUID] = schema + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + tenv.tmc.setVReplicationExecResults(targetTablet.tablet, `t2ddl`, &sqltypes.Result{}) // Execute the fake CreateDdl + + // This is our expected query, which will also short circuit + // the test with an error as at this point we've tested what + // we wanted to test. + insert := insertVReplicationPrefix + + fmt.Sprintf(` values ('%s', 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"t1\" filter:\"select * from t1\"} rules:{match:\"t2\" filter:\"select * from t3\"}}', '', 0, 0, '%s', 'primary,rdonly', now(), 0, 'Stopped', '%s', 0, 0, 0)`, + wf, sourceKs, shard, tenv.cells[0], tenv.dbName) + targetTablet.vrdbClient.ExpectRequest(insert, &sqltypes.Result{}, errShortCircuit) + + err := ws.Materialize(ctx, ms) + targetTablet.vrdbClient.Wait() + require.ErrorIs(t, err, errShortCircuit) + require.Equal(t, 1, tenv.tmc.getSchemaRequestCount(sourceTabletUID)) + require.Equal(t, 1, tenv.tmc.getSchemaRequestCount(targetTabletUID)) +} + +func TestMaterializerCopySchema(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceTabletUID := 100 + targetKs := "targetks" + targetTabletUID := 200 + shard := "0" + wf := "testwf" + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceTablet := tenv.addTablet(t, sourceTabletUID, sourceKs, shard) + defer tenv.deleteTablet(sourceTablet.tablet) + targetTablet := tenv.addTablet(t, targetTabletUID, targetKs, shard) + defer tenv.deleteTablet(targetTablet.tablet) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + Workflow: wf, + SourceKeyspace: sourceKs, + TargetKeyspace: targetKs, + TableSettings: []*vtctldatapb.TableMaterializeSettings{{ + TargetTable: "t1", + SourceExpression: "select * from t1", + CreateDdl: "copy", + }, { + TargetTable: "t2", + SourceExpression: "select * from t3", + CreateDdl: "t2ddl", + }}, + Cell: tenv.cells[0], + TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ + topodatapb.TabletType_PRIMARY, + topodatapb.TabletType_RDONLY, + }), + } + + addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) + + // Remove t1 from the target tablet's schema so that it must + // be copied. The workflow should still succeed w/o it existing + // when we start. + schema := tenv.tmc.schema.CloneVT() + for i, sd := range schema.TableDefinitions { + if sd.Name == "t1" { + schema.TableDefinitions = append(schema.TableDefinitions[:i], schema.TableDefinitions[i+1:]...) + } + } + tenv.tmc.tabletSchemas[targetTabletUID] = schema + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + + // This is our expected query, which will also short circuit + // the test with an error as at this point we've tested what + // we wanted to test. + insert := insertVReplicationPrefix + + fmt.Sprintf(` values ('%s', 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"t1\" filter:\"select * from t1\"} rules:{match:\"t2\" filter:\"select * from t3\"}}', '', 0, 0, '%s', 'primary,rdonly', now(), 0, 'Stopped', '%s', 0, 0, 0)`, + wf, sourceKs, shard, tenv.cells[0], tenv.dbName) + targetTablet.vrdbClient.ExpectRequest(insert, &sqltypes.Result{}, errShortCircuit) + + err := ws.Materialize(ctx, ms) + targetTablet.vrdbClient.Wait() + require.ErrorIs(t, err, errShortCircuit) + require.Equal(t, 0, tenv.tmc.getSchemaRequestCount(sourceTabletUID)) + require.Equal(t, 1, tenv.tmc.getSchemaRequestCount(targetTabletUID)) +} + +func TestMaterializerExplicitColumns(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceShard := "0" + sourceTabletUID := 200 + targetKs := "targetks" + targetShards := make(map[string]*fakeTabletConn) + targetTabletUID := 300 + wf := "testwf" + vreplID := 1 + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceTablet := tenv.addTablet(t, sourceTabletUID, sourceKs, sourceShard) + defer tenv.deleteTablet(sourceTablet.tablet) + + targetShards["-80"] = tenv.addTablet(t, targetTabletUID, targetKs, "-80") + defer tenv.deleteTablet(targetShards["-80"].tablet) + targetShards["80-"] = tenv.addTablet(t, targetTabletUID+10, targetKs, "80-") + defer tenv.deleteTablet(targetShards["80-"].tablet) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + Workflow: wf, + SourceKeyspace: sourceKs, + TargetKeyspace: targetKs, + TableSettings: []*vtctldatapb.TableMaterializeSettings{{ + TargetTable: "t1", + SourceExpression: "select c1, c1+c2, c2 from t1", + CreateDdl: "t1ddl", + }}, + Cell: tenv.cells[0], + TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ + topodatapb.TabletType_PRIMARY, + topodatapb.TabletType_RDONLY, + }), + } + + err := tenv.ts.SaveVSchema(ctx, targetKs, &vschemapb.Keyspace{ + Sharded: true, + Vindexes: map[string]*vschemapb.Vindex{ + "region": { + Type: "region_experimental", + Params: map[string]string{ + "region_bytes": "1", + }, + }, + }, + Tables: map[string]*vschemapb.Table{ + "t1": { + ColumnVindexes: []*vschemapb.ColumnVindex{{ + Columns: []string{"c1", "c2"}, + Name: "region", + }}, + }, + }, + }) + require.NoError(t, err) + + addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) + + // This is our expected query, which will also short circuit + // the test with an error as at this point we've tested what + // we wanted to test. + for _, targetShard := range []string{"-80", "80-"} { + targetTablet := targetShards[targetShard] + addInvariants(targetTablet.vrdbClient, vreplID, sourceTabletUID, position, wf, tenv.cells[0]) + targetTablet.vrdbClient.AddInvariant("update _vt.vreplication set message='no schema defined' where id=1", &sqltypes.Result{}) // If the first workflow controller progresses ... + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + + bls := fmt.Sprintf("keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"t1\" filter:\"select c1, c1 + c2, c2 from t1 where in_keyrange(c1, c2, '%s.region', '%s')\"}}", + sourceKs, sourceShard, targetKs, targetShard) + insert := insertVReplicationPrefix + + fmt.Sprintf(` values ('%s', 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"t1\" filter:\"select c1, c1 + c2, c2 from t1 where in_keyrange(c1, c2, \'%s.region\', \'%s\')\"}}', '', 0, 0, '%s', 'primary,rdonly', now(), 0, 'Stopped', '%s', 0, 0, 0)`, + wf, sourceKs, sourceShard, targetKs, targetShard, tenv.cells[0], tenv.dbName) + if targetShard == "-80" { + targetTablet.vrdbClient.ExpectRequest(insert, &sqltypes.Result{InsertID: uint64(vreplID)}, nil) + targetTablet.vrdbClient.ExpectRequest(getAutoIncrementStep, &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(getVReplicationRecord, vreplID), + sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "id|source", + "int64|varchar", + ), + fmt.Sprintf("%d|%s", vreplID, bls), + ), nil) + } else { + targetTablet.vrdbClient.ExpectRequest(insert, &sqltypes.Result{InsertID: uint64(vreplID)}, errShortCircuit) + } + } + + err = ws.Materialize(ctx, ms) + for _, targetTablet := range targetShards { + targetTablet.vrdbClient.Wait() + } + require.ErrorIs(t, err, errShortCircuit) +} + +func TestMaterializerRenamedColumns(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceShard := "0" + sourceTabletUID := 200 + targetKs := "targetks" + targetShards := make(map[string]*fakeTabletConn) + targetTabletUID := 300 + wf := "testwf" + vreplID := 1 + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceTablet := tenv.addTablet(t, sourceTabletUID, sourceKs, sourceShard) + defer tenv.deleteTablet(sourceTablet.tablet) + + targetShards["-80"] = tenv.addTablet(t, targetTabletUID, targetKs, "-80") + defer tenv.deleteTablet(targetShards["-80"].tablet) + targetShards["80-"] = tenv.addTablet(t, targetTabletUID+10, targetKs, "80-") + defer tenv.deleteTablet(targetShards["80-"].tablet) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + Workflow: wf, + SourceKeyspace: sourceKs, + TargetKeyspace: targetKs, + TableSettings: []*vtctldatapb.TableMaterializeSettings{{ + TargetTable: "t1", + SourceExpression: "select c3 as c1, c1+c2, c4 as c2 from t1", + CreateDdl: "t1ddl", + }}, + Cell: tenv.cells[0], + TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ + topodatapb.TabletType_PRIMARY, + topodatapb.TabletType_RDONLY, + }), + } + + err := tenv.ts.SaveVSchema(ctx, targetKs, &vschemapb.Keyspace{ + Sharded: true, + Vindexes: map[string]*vschemapb.Vindex{ + "region": { + Type: "region_experimental", + Params: map[string]string{ + "region_bytes": "1", + }, + }, + }, + Tables: map[string]*vschemapb.Table{ + "t1": { + ColumnVindexes: []*vschemapb.ColumnVindex{{ + Columns: []string{"c1", "c2"}, + Name: "region", + }}, + }, + }, + }) + require.NoError(t, err) + + addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) + + // This is our expected query, which will also short circuit + // the test with an error as at this point we've tested what + // we wanted to test. + for _, targetShard := range []string{"-80", "80-"} { + targetTablet := targetShards[targetShard] + addInvariants(targetTablet.vrdbClient, vreplID, sourceTabletUID, position, wf, tenv.cells[0]) + targetTablet.vrdbClient.AddInvariant("update _vt.vreplication set message='no schema defined' where id=1", &sqltypes.Result{}) // If the first workflow controller progresses ... + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + + bls := fmt.Sprintf("keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"t1\" filter:\"select c3 as c1, c1 + c2, c4 as c2 from t1 where in_keyrange(c3, c4, '%s.region', '%s')\"}}", + sourceKs, sourceShard, targetKs, targetShard) + insert := insertVReplicationPrefix + + fmt.Sprintf(` values ('%s', 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"t1\" filter:\"select c3 as c1, c1 + c2, c4 as c2 from t1 where in_keyrange(c3, c4, \'%s.region\', \'%s\')\"}}', '', 0, 0, '%s', 'primary,rdonly', now(), 0, 'Stopped', '%s', 0, 0, 0)`, + wf, sourceKs, sourceShard, targetKs, targetShard, tenv.cells[0], tenv.dbName) + if targetShard == "-80" { + targetTablet.vrdbClient.ExpectRequest(insert, &sqltypes.Result{InsertID: uint64(vreplID)}, nil) + targetTablet.vrdbClient.ExpectRequest(getAutoIncrementStep, &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(getVReplicationRecord, vreplID), + sqltypes.MakeTestResult( + sqltypes.MakeTestFields( + "id|source", + "int64|varchar", + ), + fmt.Sprintf("%d|%s", vreplID, bls), + ), nil) + } else { + targetTablet.vrdbClient.ExpectRequest(insert, &sqltypes.Result{InsertID: uint64(vreplID)}, errShortCircuit) + } + } + + err = ws.Materialize(ctx, ms) + for _, targetTablet := range targetShards { + targetTablet.vrdbClient.Wait() + } + require.ErrorIs(t, err, errShortCircuit) +} + +func TestMaterializerStopAfterCopy(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceTabletUID := 200 + targetKs := "targetks" + targetTabletUID := 300 + shard := "0" + wf := "testwf" + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceTablet := tenv.addTablet(t, sourceTabletUID, sourceKs, shard) + defer tenv.deleteTablet(sourceTablet.tablet) + targetTablet := tenv.addTablet(t, targetTabletUID, targetKs, shard) + defer tenv.deleteTablet(targetTablet.tablet) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + Workflow: wf, + SourceKeyspace: sourceKs, + TargetKeyspace: targetKs, + StopAfterCopy: true, + TableSettings: []*vtctldatapb.TableMaterializeSettings{{ + TargetTable: "t1", + SourceExpression: "select * from t1", + CreateDdl: "t1ddl", + }, { + TargetTable: "t2", + SourceExpression: "select * from t3", + CreateDdl: "t2ddl", + }}, + Cell: tenv.cells[0], + TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ + topodatapb.TabletType_PRIMARY, + topodatapb.TabletType_RDONLY, + }), + } + + addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) + + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + + // This is our expected query, which will also short circuit + // the test with an error as at this point we've tested what + // we wanted to test. + insert := insertVReplicationPrefix + + fmt.Sprintf(` values ('%s', 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"t1\" filter:\"select * from t1\"} rules:{match:\"t2\" filter:\"select * from t3\"}} stop_after_copy:true', '', 0, 0, '%s', 'primary,rdonly', now(), 0, 'Stopped', '%s', 0, 0, 0)`, + wf, sourceKs, shard, tenv.cells[0], tenv.dbName) + targetTablet.vrdbClient.ExpectRequest(insert, &sqltypes.Result{}, errShortCircuit) + + err := ws.Materialize(ctx, ms) + targetTablet.vrdbClient.Wait() + require.ErrorIs(t, err, errShortCircuit) +} + +func TestMaterializerNoTargetVSchema(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceTabletUID := 100 + targetKs := "targetks" + targetTabletUID := 200 + shard := "0" + wf := "testwf" + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceTablet := tenv.addTablet(t, sourceTabletUID, sourceKs, shard) + defer tenv.deleteTablet(sourceTablet.tablet) + targetTablet := tenv.addTablet(t, targetTabletUID, targetKs, shard) + defer tenv.deleteTablet(targetTablet.tablet) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + Workflow: wf, + SourceKeyspace: sourceKs, + TargetKeyspace: targetKs, + TableSettings: []*vtctldatapb.TableMaterializeSettings{{ + TargetTable: "t1", + SourceExpression: "select * from t1", + CreateDdl: "t1ddl", + }}, + Cell: tenv.cells[0], + TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ + topodatapb.TabletType_PRIMARY, + topodatapb.TabletType_RDONLY, + }), + } + + err := tenv.ts.SaveVSchema(ctx, targetKs, &vschemapb.Keyspace{ + Sharded: true, + }) + require.NoError(t, err) + + addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) + + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + + err = ws.Materialize(ctx, ms) + targetTablet.vrdbClient.Wait() + require.EqualError(t, err, fmt.Sprintf("table t1 not found in vschema for keyspace %s", targetKs)) +} + +func TestMaterializerNoDDL(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceTabletUID := 100 + targetKs := "targetks" + targetTabletUID := 200 + shard := "0" + wf := "testwf" + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceTablet := tenv.addTablet(t, sourceTabletUID, sourceKs, shard) + defer tenv.deleteTablet(sourceTablet.tablet) + targetTablet := tenv.addTablet(t, targetTabletUID, targetKs, shard) + defer tenv.deleteTablet(targetTablet.tablet) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + Workflow: wf, + SourceKeyspace: sourceKs, + TargetKeyspace: targetKs, + TableSettings: []*vtctldatapb.TableMaterializeSettings{{ + TargetTable: "t1", + SourceExpression: "select * from t1", + CreateDdl: "", + }}, + Cell: tenv.cells[0], + TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ + topodatapb.TabletType_PRIMARY, + topodatapb.TabletType_RDONLY, + }), + } + + // Clear out the schema on the target tablet. + tenv.tmc.tabletSchemas[targetTabletUID] = &tabletmanagerdatapb.SchemaDefinition{} + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + + err := ws.Materialize(ctx, ms) + require.EqualError(t, err, "target table t1 does not exist and there is no create ddl defined") + require.Equal(t, tenv.tmc.getSchemaRequestCount(100), 0) + require.Equal(t, tenv.tmc.getSchemaRequestCount(200), 1) + +} + +func TestMaterializerNoSourcePrimary(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceTabletUID := 100 + targetKs := "targetks" + targetTabletUID := 200 + shard := "0" + wf := "testwf" + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceTablet := tenv.addTablet(t, sourceTabletUID, sourceKs, shard) + defer tenv.deleteTablet(sourceTablet.tablet) + targetTablet := tenv.addTablet(t, targetTabletUID, targetKs, shard) + defer tenv.deleteTablet(targetTablet.tablet) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + Workflow: wf, + SourceKeyspace: sourceKs, + TargetKeyspace: targetKs, + TableSettings: []*vtctldatapb.TableMaterializeSettings{{ + TargetTable: "t1", + SourceExpression: "select * from t1", + CreateDdl: "copy", + }}, + Cell: tenv.cells[0], + TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ + topodatapb.TabletType_PRIMARY, + topodatapb.TabletType_RDONLY, + }), + } + + addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) + + tenv.tmc.tabletSchemas[targetTabletUID] = &tabletmanagerdatapb.SchemaDefinition{} + targetTablet.tablet.Type = topodatapb.TabletType_REPLICA + _, _ = tenv.ts.UpdateShardFields(tenv.ctx, targetKs, shard, func(si *topo.ShardInfo) error { + si.PrimaryAlias = nil + return nil + }) + + err := ws.Materialize(ctx, ms) + require.EqualError(t, err, "shard has no primary: 0") +} + +func TestMaterializerTableMismatchNonCopy(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceTabletUID := 100 + targetKs := "targetks" + targetTabletUID := 200 + shard := "0" + wf := "testwf" + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceTablet := tenv.addTablet(t, sourceTabletUID, sourceKs, shard) + defer tenv.deleteTablet(sourceTablet.tablet) + targetTablet := tenv.addTablet(t, targetTabletUID, targetKs, shard) + defer tenv.deleteTablet(targetTablet.tablet) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + Workflow: wf, + SourceKeyspace: sourceKs, + TargetKeyspace: targetKs, + TableSettings: []*vtctldatapb.TableMaterializeSettings{{ + TargetTable: "t1", + SourceExpression: "select * from t2", + CreateDdl: "", + }}, + Cell: tenv.cells[0], + TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ + topodatapb.TabletType_PRIMARY, + topodatapb.TabletType_RDONLY, + }), + } + + addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) + + // Clear out the schema on the target tablet. + tenv.tmc.tabletSchemas[targetTabletUID] = &tabletmanagerdatapb.SchemaDefinition{} + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + + err := ws.Materialize(ctx, ms) + require.EqualError(t, err, "target table t1 does not exist and there is no create ddl defined") +} + +func TestMaterializerTableMismatchCopy(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceTabletUID := 100 + targetKs := "targetks" + targetTabletUID := 200 + shard := "0" + wf := "testwf" + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceTablet := tenv.addTablet(t, sourceTabletUID, sourceKs, shard) + defer tenv.deleteTablet(sourceTablet.tablet) + targetTablet := tenv.addTablet(t, targetTabletUID, targetKs, shard) + defer tenv.deleteTablet(targetTablet.tablet) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + Workflow: wf, + SourceKeyspace: sourceKs, + TargetKeyspace: targetKs, + TableSettings: []*vtctldatapb.TableMaterializeSettings{{ + TargetTable: "t1", + SourceExpression: "select * from t2", + CreateDdl: "copy", + }}, + Cell: tenv.cells[0], + TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ + topodatapb.TabletType_PRIMARY, + topodatapb.TabletType_RDONLY, + }), + } + + addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) + + // Clear out the schema on the target tablet. + tenv.tmc.tabletSchemas[targetTabletUID] = &tabletmanagerdatapb.SchemaDefinition{} + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + + err := ws.Materialize(ctx, ms) + require.EqualError(t, err, "source and target table names must match for copying schema: t2 vs t1") +} + +func TestMaterializerNoSourceTable(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceTabletUID := 100 + targetKs := "targetks" + targetTabletUID := 200 + shard := "0" + wf := "testwf" + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceTablet := tenv.addTablet(t, sourceTabletUID, sourceKs, shard) + defer tenv.deleteTablet(sourceTablet.tablet) + targetTablet := tenv.addTablet(t, targetTabletUID, targetKs, shard) + defer tenv.deleteTablet(targetTablet.tablet) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + Workflow: wf, + SourceKeyspace: sourceKs, + TargetKeyspace: targetKs, + TableSettings: []*vtctldatapb.TableMaterializeSettings{{ + TargetTable: "t1", + SourceExpression: "select * from t1", + CreateDdl: "copy", + }}, + } + + addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) + + // Clear out the schema on the source and target tablet. + tenv.tmc.tabletSchemas[sourceTabletUID] = &tabletmanagerdatapb.SchemaDefinition{} + tenv.tmc.tabletSchemas[targetTabletUID] = &tabletmanagerdatapb.SchemaDefinition{} + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + + err := ws.Materialize(ctx, ms) + require.EqualError(t, err, "source table t1 does not exist") +} + +func TestMaterializerSyntaxError(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceTabletUID := 100 + targetKs := "targetks" + targetTabletUID := 200 + shard := "0" + wf := "testwf" + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceTablet := tenv.addTablet(t, sourceTabletUID, sourceKs, shard) + defer tenv.deleteTablet(sourceTablet.tablet) + targetTablet := tenv.addTablet(t, targetTabletUID, targetKs, shard) + defer tenv.deleteTablet(targetTablet.tablet) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + Workflow: wf, + SourceKeyspace: sourceKs, + TargetKeyspace: targetKs, + TableSettings: []*vtctldatapb.TableMaterializeSettings{{ + TargetTable: "t1", + SourceExpression: "bad query", + CreateDdl: "t1ddl", + }}, + Cell: tenv.cells[0], + TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ + topodatapb.TabletType_PRIMARY, + topodatapb.TabletType_RDONLY, + }), + } + + addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) + + // Clear out the schema on the source and target tablet. + tenv.tmc.tabletSchemas[sourceTabletUID] = &tabletmanagerdatapb.SchemaDefinition{} + tenv.tmc.tabletSchemas[targetTabletUID] = &tabletmanagerdatapb.SchemaDefinition{} + tenv.tmc.setVReplicationExecResults(targetTablet.tablet, ms.TableSettings[0].CreateDdl, &sqltypes.Result{}) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + + err := ws.Materialize(ctx, ms) + require.EqualError(t, err, "syntax error at position 4 near 'bad'") +} + +func TestMaterializerNotASelect(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceTabletUID := 100 + targetKs := "targetks" + targetTabletUID := 200 + shard := "0" + wf := "testwf" + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceTablet := tenv.addTablet(t, sourceTabletUID, sourceKs, shard) + defer tenv.deleteTablet(sourceTablet.tablet) + targetTablet := tenv.addTablet(t, targetTabletUID, targetKs, shard) + defer tenv.deleteTablet(targetTablet.tablet) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + Workflow: wf, + SourceKeyspace: sourceKs, + TargetKeyspace: targetKs, + TableSettings: []*vtctldatapb.TableMaterializeSettings{{ + TargetTable: "t1", + SourceExpression: "update t1 set val=1", + CreateDdl: "t1ddl", + }}, + Cell: tenv.cells[0], + TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ + topodatapb.TabletType_PRIMARY, + topodatapb.TabletType_RDONLY, + }), + } + + addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) + + // Clear out the schema on the source and target tablet. + tenv.tmc.tabletSchemas[sourceTabletUID] = &tabletmanagerdatapb.SchemaDefinition{} + tenv.tmc.tabletSchemas[targetTabletUID] = &tabletmanagerdatapb.SchemaDefinition{} + tenv.tmc.setVReplicationExecResults(targetTablet.tablet, ms.TableSettings[0].CreateDdl, &sqltypes.Result{}) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + + err := ws.Materialize(ctx, ms) + require.EqualError(t, err, "unrecognized statement: update t1 set val=1") +} + +func TestMaterializerNoGoodVindex(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceShard := "0" + sourceTabletUID := 200 + targetKs := "targetks" + targetShards := make(map[string]*fakeTabletConn) + targetTabletUID := 300 + wf := "testwf" + vreplID := 1 + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceTablet := tenv.addTablet(t, sourceTabletUID, sourceKs, sourceShard) + defer tenv.deleteTablet(sourceTablet.tablet) + + targetShards["-80"] = tenv.addTablet(t, targetTabletUID, targetKs, "-80") + defer tenv.deleteTablet(targetShards["-80"].tablet) + targetShards["80-"] = tenv.addTablet(t, targetTabletUID+10, targetKs, "80-") + defer tenv.deleteTablet(targetShards["80-"].tablet) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + Workflow: wf, + SourceKeyspace: sourceKs, + TargetKeyspace: targetKs, + TableSettings: []*vtctldatapb.TableMaterializeSettings{{ + TargetTable: "t1", + SourceExpression: "select * from t1", + CreateDdl: "t1ddl", + }}, + Cell: tenv.cells[0], + TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ + topodatapb.TabletType_PRIMARY, + topodatapb.TabletType_RDONLY, + }), + } + + err := tenv.ts.SaveVSchema(ctx, targetKs, &vschemapb.Keyspace{ + Sharded: true, + Vindexes: map[string]*vschemapb.Vindex{ + "lookup_unique": { + Type: "lookup_unique", + Params: map[string]string{ + "table": "t1", + "from": "c1", + "to": "c2", + }, + }, + }, + Tables: map[string]*vschemapb.Table{ + "t1": { + ColumnVindexes: []*vschemapb.ColumnVindex{{ + Column: "c1", + Name: "lookup_unique", + }}, + }, + }, + }) + require.NoError(t, err) + + addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) + + // This is aggregated from the two target shards. + errNoVindex := "could not find a vindex to compute keyspace id for table t1" + errs := make([]string, 0, len(targetShards)) + + for _, targetShard := range []string{"-80", "80-"} { + targetTablet := targetShards[targetShard] + addInvariants(targetTablet.vrdbClient, vreplID, sourceTabletUID, position, wf, tenv.cells[0]) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + errs = append(errs, errNoVindex) + } + + err = ws.Materialize(ctx, ms) + require.EqualError(t, err, strings.Join(errs, "\n")) +} + +func TestMaterializerComplexVindexExpression(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceShard := "0" + sourceTabletUID := 200 + targetKs := "targetks" + targetShards := make(map[string]*fakeTabletConn) + targetTabletUID := 300 + wf := "testwf" + vreplID := 1 + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceTablet := tenv.addTablet(t, sourceTabletUID, sourceKs, sourceShard) + defer tenv.deleteTablet(sourceTablet.tablet) + + targetShards["-80"] = tenv.addTablet(t, targetTabletUID, targetKs, "-80") + defer tenv.deleteTablet(targetShards["-80"].tablet) + targetShards["80-"] = tenv.addTablet(t, targetTabletUID+10, targetKs, "80-") + defer tenv.deleteTablet(targetShards["80-"].tablet) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + Workflow: wf, + SourceKeyspace: sourceKs, + TargetKeyspace: targetKs, + TableSettings: []*vtctldatapb.TableMaterializeSettings{{ + TargetTable: "t1", + SourceExpression: "select a+b as c1 from t1", + CreateDdl: "t1ddl", + }}, + Cell: tenv.cells[0], + TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ + topodatapb.TabletType_PRIMARY, + topodatapb.TabletType_RDONLY, + }), + } + + err := tenv.ts.SaveVSchema(ctx, targetKs, &vschemapb.Keyspace{ + Sharded: true, + Vindexes: map[string]*vschemapb.Vindex{ + "xxhash": { + Type: "xxhash", + }, + }, + Tables: map[string]*vschemapb.Table{ + "t1": { + ColumnVindexes: []*vschemapb.ColumnVindex{{ + Column: "c1", + Name: "xxhash", + }}, + }, + }, + }) + require.NoError(t, err) + + addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) + + // This is aggregated from the two target shards. + errNoVindex := "vindex column cannot be a complex expression: a + b as c1" + errs := make([]string, 0, len(targetShards)) + + for _, targetShard := range []string{"-80", "80-"} { + targetTablet := targetShards[targetShard] + addInvariants(targetTablet.vrdbClient, vreplID, sourceTabletUID, position, wf, tenv.cells[0]) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + errs = append(errs, errNoVindex) + } + + err = ws.Materialize(ctx, ms) + require.EqualError(t, err, strings.Join(errs, "\n")) +} + +func TestMaterializerNoVindexInExpression(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + sourceKs := "sourceks" + sourceShard := "0" + sourceTabletUID := 200 + targetKs := "targetks" + targetShards := make(map[string]*fakeTabletConn) + targetTabletUID := 300 + wf := "testwf" + vreplID := 1 + vtenv := vtenv.NewTestEnv() + tenv := newTestEnv(t, ctx, sourceKs, []string{shard}) + defer tenv.close() + + sourceTablet := tenv.addTablet(t, sourceTabletUID, sourceKs, sourceShard) + defer tenv.deleteTablet(sourceTablet.tablet) + + targetShards["-80"] = tenv.addTablet(t, targetTabletUID, targetKs, "-80") + defer tenv.deleteTablet(targetShards["-80"].tablet) + targetShards["80-"] = tenv.addTablet(t, targetTabletUID+10, targetKs, "80-") + defer tenv.deleteTablet(targetShards["80-"].tablet) + + ws := workflow.NewServer(vtenv, tenv.ts, tenv.tmc) + ms := &vtctldatapb.MaterializeSettings{ + Workflow: wf, + SourceKeyspace: sourceKs, + TargetKeyspace: targetKs, + TableSettings: []*vtctldatapb.TableMaterializeSettings{{ + TargetTable: "t1", + SourceExpression: "select c2 from t1", + CreateDdl: "t1ddl", + }}, + Cell: tenv.cells[0], + TabletTypes: topoproto.MakeStringTypeCSV([]topodatapb.TabletType{ + topodatapb.TabletType_PRIMARY, + topodatapb.TabletType_RDONLY, + }), + } + + err := tenv.ts.SaveVSchema(ctx, targetKs, &vschemapb.Keyspace{ + Sharded: true, + Vindexes: map[string]*vschemapb.Vindex{ + "xxhash": { + Type: "xxhash", + }, + }, + Tables: map[string]*vschemapb.Table{ + "t1": { + ColumnVindexes: []*vschemapb.ColumnVindex{{ + Column: "c1", + Name: "xxhash", + }}, + }, + }, + }) + require.NoError(t, err) + + addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) + + // This is aggregated from the two target shards. + errNoVindex := "could not find vindex column c1" + errs := make([]string, 0, len(targetShards)) + + for _, targetShard := range []string{"-80", "80-"} { + targetTablet := targetShards[targetShard] + addInvariants(targetTablet.vrdbClient, vreplID, sourceTabletUID, position, wf, tenv.cells[0]) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) + errs = append(errs, errNoVindex) + } + + err = ws.Materialize(ctx, ms) + require.EqualError(t, err, strings.Join(errs, "\n")) +} + +func TestBuildReadVReplicationWorkflowsQuery(t *testing.T) { + tm := &TabletManager{ + DBConfigs: &dbconfigs.DBConfigs{ + DBName: "vt_testks", + }, + } + tests := []struct { + name string + req *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest + want string + wantErr string + }{ + { + name: "all options", + req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ + IncludeIds: []int32{1, 2, 3}, + IncludeWorkflows: []string{"wf1", "wf2"}, + ExcludeWorkflows: []string{"1wf"}, + IncludeStates: []binlogdatapb.VReplicationWorkflowState{binlogdatapb.VReplicationWorkflowState_Stopped, binlogdatapb.VReplicationWorkflowState_Error}, + ExcludeFrozen: true, + }, + want: "select workflow, id, source, pos, stop_pos, max_tps, max_replication_lag, cell, tablet_types, time_updated, transaction_timestamp, state, message, db_name, rows_copied, tags, time_heartbeat, workflow_type, time_throttled, component_throttled, workflow_sub_type, defer_secondary_keys from _vt.vreplication where db_name = 'vt_testks' and message != 'FROZEN' and id in (1,2,3) and workflow in ('wf1','wf2') and workflow not in ('1wf') and state in ('Stopped','Error') group by workflow, id order by workflow, id", + }, + { + name: "2 workflows if running", + req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ + IncludeWorkflows: []string{"wf1", "wf2"}, + IncludeStates: []binlogdatapb.VReplicationWorkflowState{binlogdatapb.VReplicationWorkflowState_Running}, + }, + want: "select workflow, id, source, pos, stop_pos, max_tps, max_replication_lag, cell, tablet_types, time_updated, transaction_timestamp, state, message, db_name, rows_copied, tags, time_heartbeat, workflow_type, time_throttled, component_throttled, workflow_sub_type, defer_secondary_keys from _vt.vreplication where db_name = 'vt_testks' and workflow in ('wf1','wf2') and state in ('Running') group by workflow, id order by workflow, id", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := tm.buildReadVReplicationWorkflowsQuery(tt.req) + if tt.wantErr != "" { + require.EqualError(t, err, tt.wantErr) + } else { + require.NoError(t, err) + } + require.Equal(t, tt.want, got, "buildReadVReplicationWorkflowsQuery() = %v, want %v", got, tt.want) + }) + } +} + +func TestBuildUpdateVReplicationWorkflowsQuery(t *testing.T) { + tm := &TabletManager{ + DBConfigs: &dbconfigs.DBConfigs{ + DBName: "vt_testks", + }, + } + tests := []struct { + name string + req *tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest + want string + wantErr string + }{ + { + name: "nothing to update", + req: &tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest{ + State: binlogdatapb.VReplicationWorkflowState(textutil.SimulatedNullInt), + Message: textutil.SimulatedNullString, + StopPosition: textutil.SimulatedNullString, + }, + wantErr: errNoFieldsToUpdate.Error(), + }, + { + name: "mutually exclusive options", + req: &tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest{ + State: binlogdatapb.VReplicationWorkflowState_Running, + AllWorkflows: true, + ExcludeWorkflows: []string{"wf1"}, + }, + wantErr: errAllWithIncludeExcludeWorkflows.Error(), + }, + { + name: "all values and options", + req: &tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest{ + State: binlogdatapb.VReplicationWorkflowState_Running, + Message: "test message", + StopPosition: "MySQL56/17b1039f-21b6-13ed-b365-1a43f95f28a3:1-20", + IncludeWorkflows: []string{"wf2", "wf3"}, + ExcludeWorkflows: []string{"1wf"}, + }, + want: "update /*vt+ ALLOW_UNSAFE_VREPLICATION_WRITE */ _vt.vreplication set state = 'Running', message = 'test message', stop_pos = 'MySQL56/17b1039f-21b6-13ed-b365-1a43f95f28a3:1-20' where db_name = 'vt_testks' and workflow in ('wf2','wf3') and workflow not in ('1wf')", + }, + { + name: "state for all", + req: &tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest{ + State: binlogdatapb.VReplicationWorkflowState_Running, + Message: textutil.SimulatedNullString, + StopPosition: textutil.SimulatedNullString, + AllWorkflows: true, + }, + want: "update /*vt+ ALLOW_UNSAFE_VREPLICATION_WRITE */ _vt.vreplication set state = 'Running' where db_name = 'vt_testks'", + }, + { + name: "stop all for vdiff", + req: &tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest{ + State: binlogdatapb.VReplicationWorkflowState_Stopped, + Message: "for vdiff", + StopPosition: textutil.SimulatedNullString, + AllWorkflows: true, + }, + want: "update /*vt+ ALLOW_UNSAFE_VREPLICATION_WRITE */ _vt.vreplication set state = 'Stopped', message = 'for vdiff' where db_name = 'vt_testks'", + }, + { + name: "start one until position", + req: &tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest{ + State: binlogdatapb.VReplicationWorkflowState_Running, + Message: "for until position", + StopPosition: "MySQL56/17b1039f-21b6-13ed-b365-1a43f95f28a3:1-9999", + IncludeWorkflows: []string{"wf1"}, + }, + want: "update /*vt+ ALLOW_UNSAFE_VREPLICATION_WRITE */ _vt.vreplication set state = 'Running', message = 'for until position', stop_pos = 'MySQL56/17b1039f-21b6-13ed-b365-1a43f95f28a3:1-9999' where db_name = 'vt_testks' and workflow in ('wf1')", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := tm.buildUpdateVReplicationWorkflowsQuery(tt.req) + if tt.wantErr != "" { + require.EqualError(t, err, tt.wantErr) + } else { + require.NoError(t, err) + } + require.Equal(t, tt.want, got, "buildUpdateVReplicationWorkflowsQuery() = %v, want %v", got, tt.want) + }) + } +} diff --git a/go/vt/vttablet/tmclient/rpc_client_api.go b/go/vt/vttablet/tmclient/rpc_client_api.go index 2e75dbd45fc..24e5286a994 100644 --- a/go/vt/vttablet/tmclient/rpc_client_api.go +++ b/go/vt/vttablet/tmclient/rpc_client_api.go @@ -177,8 +177,11 @@ type TabletManagerClient interface { CreateVReplicationWorkflow(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.CreateVReplicationWorkflowRequest) (*tabletmanagerdatapb.CreateVReplicationWorkflowResponse, error) DeleteVReplicationWorkflow(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.DeleteVReplicationWorkflowRequest) (*tabletmanagerdatapb.DeleteVReplicationWorkflowResponse, error) + HasVReplicationWorkflows(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.HasVReplicationWorkflowsRequest) (*tabletmanagerdatapb.HasVReplicationWorkflowsResponse, error) + ReadVReplicationWorkflows(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowsResponse, error) ReadVReplicationWorkflow(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.ReadVReplicationWorkflowRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowResponse, error) UpdateVReplicationWorkflow(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.UpdateVReplicationWorkflowRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowResponse, error) + UpdateVReplicationWorkflows(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsResponse, error) // VReplicationExec executes a VReplication command VReplicationExec(ctx context.Context, tablet *topodatapb.Tablet, query string) (*querypb.QueryResult, error) VReplicationWaitForPos(ctx context.Context, tablet *topodatapb.Tablet, id int32, pos string) error diff --git a/go/vt/vttablet/tmrpctest/test_tm_rpc.go b/go/vt/vttablet/tmrpctest/test_tm_rpc.go index f3a9e842753..7e8460ca153 100644 --- a/go/vt/vttablet/tmrpctest/test_tm_rpc.go +++ b/go/vt/vttablet/tmrpctest/test_tm_rpc.go @@ -65,6 +65,16 @@ func (fra *fakeRPCTM) DeleteVReplicationWorkflow(ctx context.Context, req *table panic("implement me") } +func (fra *fakeRPCTM) HasVReplicationWorkflows(ctx context.Context, req *tabletmanagerdatapb.HasVReplicationWorkflowsRequest) (*tabletmanagerdatapb.HasVReplicationWorkflowsResponse, error) { + //TODO implement me + panic("implement me") +} + +func (fra *fakeRPCTM) ReadVReplicationWorkflows(ctx context.Context, req *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowsResponse, error) { + //TODO implement me + panic("implement me") +} + func (fra *fakeRPCTM) ReadVReplicationWorkflow(ctx context.Context, req *tabletmanagerdatapb.ReadVReplicationWorkflowRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowResponse, error) { //TODO implement me panic("implement me") @@ -75,6 +85,11 @@ func (fra *fakeRPCTM) UpdateVReplicationWorkflow(ctx context.Context, req *table panic("implement me") } +func (fra *fakeRPCTM) UpdateVReplicationWorkflows(ctx context.Context, req *tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsResponse, error) { + //TODO implement me + panic("implement me") +} + func (fra *fakeRPCTM) ResetSequences(ctx context.Context, tables []string) error { //TODO implement me panic("implement me") diff --git a/go/vt/wrangler/switcher.go b/go/vt/wrangler/switcher.go index 0e1f33b90ea..c9e22f4669e 100644 --- a/go/vt/wrangler/switcher.go +++ b/go/vt/wrangler/switcher.go @@ -109,7 +109,7 @@ func (r *switcher) stopSourceWrites(ctx context.Context) error { } func (r *switcher) stopStreams(ctx context.Context, sm *workflow.StreamMigrator) ([]string, error) { - return sm.StopStreams(ctx) + return sm.LegacyStopStreams(ctx) } func (r *switcher) cancelMigration(ctx context.Context, sm *workflow.StreamMigrator) { diff --git a/go/vt/wrangler/traffic_switcher.go b/go/vt/wrangler/traffic_switcher.go index a6b3587c3a1..fb76b8e8f21 100644 --- a/go/vt/wrangler/traffic_switcher.go +++ b/go/vt/wrangler/traffic_switcher.go @@ -555,7 +555,7 @@ func (wr *Wrangler) SwitchWrites(ctx context.Context, targetKeyspace, workflowNa } if !journalsExist { ts.Logger().Infof("No previous journals were found. Proceeding normally.") - sm, err := workflow.BuildStreamMigrator(ctx, ts, cancel, wr.env.Parser()) + sm, err := workflow.BuildLegacyStreamMigrator(ctx, ts, cancel, wr.env.Parser()) if err != nil { return handleError("failed to migrate the workflow streams", err) } diff --git a/proto/tabletmanagerdata.proto b/proto/tabletmanagerdata.proto index e1a0e97f03e..113dc257902 100644 --- a/proto/tabletmanagerdata.proto +++ b/proto/tabletmanagerdata.proto @@ -550,6 +550,26 @@ message DeleteVReplicationWorkflowResponse { query.QueryResult result = 1; } +message HasVReplicationWorkflowsRequest { +} + +message HasVReplicationWorkflowsResponse { + bool has = 1; +} + +message ReadVReplicationWorkflowsRequest { + repeated int32 include_ids = 1; + repeated string include_workflows = 2; + repeated binlogdata.VReplicationWorkflowState include_states = 3; + repeated string exclude_workflows = 4; + repeated binlogdata.VReplicationWorkflowState exclude_states = 5; + bool exclude_frozen = 6; +} + +message ReadVReplicationWorkflowsResponse { + repeated ReadVReplicationWorkflowResponse workflows = 1; +} + message ReadVReplicationWorkflowRequest { string workflow = 1; } @@ -645,6 +665,19 @@ message UpdateVReplicationWorkflowResponse { query.QueryResult result = 1; } +message UpdateVReplicationWorkflowsRequest { + bool all_workflows = 1; + repeated string include_workflows = 2; + repeated string exclude_workflows = 3; + binlogdata.VReplicationWorkflowState state = 4; + string message = 5; + string stop_position = 6; +} + +message UpdateVReplicationWorkflowsResponse { + query.QueryResult result = 1; +} + message ResetSequencesRequest { repeated string tables = 1; } diff --git a/proto/tabletmanagerservice.proto b/proto/tabletmanagerservice.proto index 7492bdd7cca..084f37615c0 100644 --- a/proto/tabletmanagerservice.proto +++ b/proto/tabletmanagerservice.proto @@ -116,10 +116,13 @@ service TabletManager { // VReplication API rpc CreateVReplicationWorkflow(tabletmanagerdata.CreateVReplicationWorkflowRequest) returns (tabletmanagerdata.CreateVReplicationWorkflowResponse) {}; rpc DeleteVReplicationWorkflow(tabletmanagerdata.DeleteVReplicationWorkflowRequest) returns(tabletmanagerdata.DeleteVReplicationWorkflowResponse) {}; + rpc HasVReplicationWorkflows(tabletmanagerdata.HasVReplicationWorkflowsRequest) returns(tabletmanagerdata.HasVReplicationWorkflowsResponse) {}; rpc ReadVReplicationWorkflow(tabletmanagerdata.ReadVReplicationWorkflowRequest) returns(tabletmanagerdata.ReadVReplicationWorkflowResponse) {}; + rpc ReadVReplicationWorkflows(tabletmanagerdata.ReadVReplicationWorkflowsRequest) returns(tabletmanagerdata.ReadVReplicationWorkflowsResponse) {}; rpc VReplicationExec(tabletmanagerdata.VReplicationExecRequest) returns(tabletmanagerdata.VReplicationExecResponse) {}; rpc VReplicationWaitForPos(tabletmanagerdata.VReplicationWaitForPosRequest) returns(tabletmanagerdata.VReplicationWaitForPosResponse) {}; rpc UpdateVReplicationWorkflow(tabletmanagerdata.UpdateVReplicationWorkflowRequest) returns(tabletmanagerdata.UpdateVReplicationWorkflowResponse) {}; + rpc UpdateVReplicationWorkflows(tabletmanagerdata.UpdateVReplicationWorkflowsRequest) returns(tabletmanagerdata.UpdateVReplicationWorkflowsResponse) {}; // VDiff API rpc VDiff(tabletmanagerdata.VDiffRequest) returns(tabletmanagerdata.VDiffResponse) {}; diff --git a/web/vtadmin/src/proto/vtadmin.d.ts b/web/vtadmin/src/proto/vtadmin.d.ts index 53fc9df7e7f..d9e8308d9bb 100644 --- a/web/vtadmin/src/proto/vtadmin.d.ts +++ b/web/vtadmin/src/proto/vtadmin.d.ts @@ -27767,6 +27767,418 @@ export namespace tabletmanagerdata { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a HasVReplicationWorkflowsRequest. */ + interface IHasVReplicationWorkflowsRequest { + } + + /** Represents a HasVReplicationWorkflowsRequest. */ + class HasVReplicationWorkflowsRequest implements IHasVReplicationWorkflowsRequest { + + /** + * Constructs a new HasVReplicationWorkflowsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: tabletmanagerdata.IHasVReplicationWorkflowsRequest); + + /** + * Creates a new HasVReplicationWorkflowsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns HasVReplicationWorkflowsRequest instance + */ + public static create(properties?: tabletmanagerdata.IHasVReplicationWorkflowsRequest): tabletmanagerdata.HasVReplicationWorkflowsRequest; + + /** + * Encodes the specified HasVReplicationWorkflowsRequest message. Does not implicitly {@link tabletmanagerdata.HasVReplicationWorkflowsRequest.verify|verify} messages. + * @param message HasVReplicationWorkflowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: tabletmanagerdata.IHasVReplicationWorkflowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HasVReplicationWorkflowsRequest message, length delimited. Does not implicitly {@link tabletmanagerdata.HasVReplicationWorkflowsRequest.verify|verify} messages. + * @param message HasVReplicationWorkflowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: tabletmanagerdata.IHasVReplicationWorkflowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HasVReplicationWorkflowsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HasVReplicationWorkflowsRequest + * @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): tabletmanagerdata.HasVReplicationWorkflowsRequest; + + /** + * Decodes a HasVReplicationWorkflowsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HasVReplicationWorkflowsRequest + * @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)): tabletmanagerdata.HasVReplicationWorkflowsRequest; + + /** + * Verifies a HasVReplicationWorkflowsRequest 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 HasVReplicationWorkflowsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HasVReplicationWorkflowsRequest + */ + public static fromObject(object: { [k: string]: any }): tabletmanagerdata.HasVReplicationWorkflowsRequest; + + /** + * Creates a plain object from a HasVReplicationWorkflowsRequest message. Also converts values to other types if specified. + * @param message HasVReplicationWorkflowsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: tabletmanagerdata.HasVReplicationWorkflowsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HasVReplicationWorkflowsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HasVReplicationWorkflowsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HasVReplicationWorkflowsResponse. */ + interface IHasVReplicationWorkflowsResponse { + + /** HasVReplicationWorkflowsResponse has */ + has?: (boolean|null); + } + + /** Represents a HasVReplicationWorkflowsResponse. */ + class HasVReplicationWorkflowsResponse implements IHasVReplicationWorkflowsResponse { + + /** + * Constructs a new HasVReplicationWorkflowsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: tabletmanagerdata.IHasVReplicationWorkflowsResponse); + + /** HasVReplicationWorkflowsResponse has. */ + public has: boolean; + + /** + * Creates a new HasVReplicationWorkflowsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns HasVReplicationWorkflowsResponse instance + */ + public static create(properties?: tabletmanagerdata.IHasVReplicationWorkflowsResponse): tabletmanagerdata.HasVReplicationWorkflowsResponse; + + /** + * Encodes the specified HasVReplicationWorkflowsResponse message. Does not implicitly {@link tabletmanagerdata.HasVReplicationWorkflowsResponse.verify|verify} messages. + * @param message HasVReplicationWorkflowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: tabletmanagerdata.IHasVReplicationWorkflowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HasVReplicationWorkflowsResponse message, length delimited. Does not implicitly {@link tabletmanagerdata.HasVReplicationWorkflowsResponse.verify|verify} messages. + * @param message HasVReplicationWorkflowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: tabletmanagerdata.IHasVReplicationWorkflowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HasVReplicationWorkflowsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HasVReplicationWorkflowsResponse + * @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): tabletmanagerdata.HasVReplicationWorkflowsResponse; + + /** + * Decodes a HasVReplicationWorkflowsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HasVReplicationWorkflowsResponse + * @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)): tabletmanagerdata.HasVReplicationWorkflowsResponse; + + /** + * Verifies a HasVReplicationWorkflowsResponse 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 HasVReplicationWorkflowsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HasVReplicationWorkflowsResponse + */ + public static fromObject(object: { [k: string]: any }): tabletmanagerdata.HasVReplicationWorkflowsResponse; + + /** + * Creates a plain object from a HasVReplicationWorkflowsResponse message. Also converts values to other types if specified. + * @param message HasVReplicationWorkflowsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: tabletmanagerdata.HasVReplicationWorkflowsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HasVReplicationWorkflowsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HasVReplicationWorkflowsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadVReplicationWorkflowsRequest. */ + interface IReadVReplicationWorkflowsRequest { + + /** ReadVReplicationWorkflowsRequest include_ids */ + include_ids?: (number[]|null); + + /** ReadVReplicationWorkflowsRequest include_workflows */ + include_workflows?: (string[]|null); + + /** ReadVReplicationWorkflowsRequest include_states */ + include_states?: (binlogdata.VReplicationWorkflowState[]|null); + + /** ReadVReplicationWorkflowsRequest exclude_workflows */ + exclude_workflows?: (string[]|null); + + /** ReadVReplicationWorkflowsRequest exclude_states */ + exclude_states?: (binlogdata.VReplicationWorkflowState[]|null); + + /** ReadVReplicationWorkflowsRequest exclude_frozen */ + exclude_frozen?: (boolean|null); + } + + /** Represents a ReadVReplicationWorkflowsRequest. */ + class ReadVReplicationWorkflowsRequest implements IReadVReplicationWorkflowsRequest { + + /** + * Constructs a new ReadVReplicationWorkflowsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: tabletmanagerdata.IReadVReplicationWorkflowsRequest); + + /** ReadVReplicationWorkflowsRequest include_ids. */ + public include_ids: number[]; + + /** ReadVReplicationWorkflowsRequest include_workflows. */ + public include_workflows: string[]; + + /** ReadVReplicationWorkflowsRequest include_states. */ + public include_states: binlogdata.VReplicationWorkflowState[]; + + /** ReadVReplicationWorkflowsRequest exclude_workflows. */ + public exclude_workflows: string[]; + + /** ReadVReplicationWorkflowsRequest exclude_states. */ + public exclude_states: binlogdata.VReplicationWorkflowState[]; + + /** ReadVReplicationWorkflowsRequest exclude_frozen. */ + public exclude_frozen: boolean; + + /** + * Creates a new ReadVReplicationWorkflowsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadVReplicationWorkflowsRequest instance + */ + public static create(properties?: tabletmanagerdata.IReadVReplicationWorkflowsRequest): tabletmanagerdata.ReadVReplicationWorkflowsRequest; + + /** + * Encodes the specified ReadVReplicationWorkflowsRequest message. Does not implicitly {@link tabletmanagerdata.ReadVReplicationWorkflowsRequest.verify|verify} messages. + * @param message ReadVReplicationWorkflowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: tabletmanagerdata.IReadVReplicationWorkflowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadVReplicationWorkflowsRequest message, length delimited. Does not implicitly {@link tabletmanagerdata.ReadVReplicationWorkflowsRequest.verify|verify} messages. + * @param message ReadVReplicationWorkflowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: tabletmanagerdata.IReadVReplicationWorkflowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadVReplicationWorkflowsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadVReplicationWorkflowsRequest + * @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): tabletmanagerdata.ReadVReplicationWorkflowsRequest; + + /** + * Decodes a ReadVReplicationWorkflowsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadVReplicationWorkflowsRequest + * @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)): tabletmanagerdata.ReadVReplicationWorkflowsRequest; + + /** + * Verifies a ReadVReplicationWorkflowsRequest 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 ReadVReplicationWorkflowsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadVReplicationWorkflowsRequest + */ + public static fromObject(object: { [k: string]: any }): tabletmanagerdata.ReadVReplicationWorkflowsRequest; + + /** + * Creates a plain object from a ReadVReplicationWorkflowsRequest message. Also converts values to other types if specified. + * @param message ReadVReplicationWorkflowsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: tabletmanagerdata.ReadVReplicationWorkflowsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadVReplicationWorkflowsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadVReplicationWorkflowsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadVReplicationWorkflowsResponse. */ + interface IReadVReplicationWorkflowsResponse { + + /** ReadVReplicationWorkflowsResponse workflows */ + workflows?: (tabletmanagerdata.IReadVReplicationWorkflowResponse[]|null); + } + + /** Represents a ReadVReplicationWorkflowsResponse. */ + class ReadVReplicationWorkflowsResponse implements IReadVReplicationWorkflowsResponse { + + /** + * Constructs a new ReadVReplicationWorkflowsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: tabletmanagerdata.IReadVReplicationWorkflowsResponse); + + /** ReadVReplicationWorkflowsResponse workflows. */ + public workflows: tabletmanagerdata.IReadVReplicationWorkflowResponse[]; + + /** + * Creates a new ReadVReplicationWorkflowsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadVReplicationWorkflowsResponse instance + */ + public static create(properties?: tabletmanagerdata.IReadVReplicationWorkflowsResponse): tabletmanagerdata.ReadVReplicationWorkflowsResponse; + + /** + * Encodes the specified ReadVReplicationWorkflowsResponse message. Does not implicitly {@link tabletmanagerdata.ReadVReplicationWorkflowsResponse.verify|verify} messages. + * @param message ReadVReplicationWorkflowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: tabletmanagerdata.IReadVReplicationWorkflowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadVReplicationWorkflowsResponse message, length delimited. Does not implicitly {@link tabletmanagerdata.ReadVReplicationWorkflowsResponse.verify|verify} messages. + * @param message ReadVReplicationWorkflowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: tabletmanagerdata.IReadVReplicationWorkflowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadVReplicationWorkflowsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadVReplicationWorkflowsResponse + * @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): tabletmanagerdata.ReadVReplicationWorkflowsResponse; + + /** + * Decodes a ReadVReplicationWorkflowsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadVReplicationWorkflowsResponse + * @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)): tabletmanagerdata.ReadVReplicationWorkflowsResponse; + + /** + * Verifies a ReadVReplicationWorkflowsResponse 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 ReadVReplicationWorkflowsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadVReplicationWorkflowsResponse + */ + public static fromObject(object: { [k: string]: any }): tabletmanagerdata.ReadVReplicationWorkflowsResponse; + + /** + * Creates a plain object from a ReadVReplicationWorkflowsResponse message. Also converts values to other types if specified. + * @param message ReadVReplicationWorkflowsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: tabletmanagerdata.ReadVReplicationWorkflowsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadVReplicationWorkflowsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadVReplicationWorkflowsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a ReadVReplicationWorkflowRequest. */ interface IReadVReplicationWorkflowRequest { @@ -29137,6 +29549,230 @@ export namespace tabletmanagerdata { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an UpdateVReplicationWorkflowsRequest. */ + interface IUpdateVReplicationWorkflowsRequest { + + /** UpdateVReplicationWorkflowsRequest all_workflows */ + all_workflows?: (boolean|null); + + /** UpdateVReplicationWorkflowsRequest include_workflows */ + include_workflows?: (string[]|null); + + /** UpdateVReplicationWorkflowsRequest exclude_workflows */ + exclude_workflows?: (string[]|null); + + /** UpdateVReplicationWorkflowsRequest state */ + state?: (binlogdata.VReplicationWorkflowState|null); + + /** UpdateVReplicationWorkflowsRequest message */ + message?: (string|null); + + /** UpdateVReplicationWorkflowsRequest stop_position */ + stop_position?: (string|null); + } + + /** Represents an UpdateVReplicationWorkflowsRequest. */ + class UpdateVReplicationWorkflowsRequest implements IUpdateVReplicationWorkflowsRequest { + + /** + * Constructs a new UpdateVReplicationWorkflowsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: tabletmanagerdata.IUpdateVReplicationWorkflowsRequest); + + /** UpdateVReplicationWorkflowsRequest all_workflows. */ + public all_workflows: boolean; + + /** UpdateVReplicationWorkflowsRequest include_workflows. */ + public include_workflows: string[]; + + /** UpdateVReplicationWorkflowsRequest exclude_workflows. */ + public exclude_workflows: string[]; + + /** UpdateVReplicationWorkflowsRequest state. */ + public state: binlogdata.VReplicationWorkflowState; + + /** UpdateVReplicationWorkflowsRequest message. */ + public message: string; + + /** UpdateVReplicationWorkflowsRequest stop_position. */ + public stop_position: string; + + /** + * Creates a new UpdateVReplicationWorkflowsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateVReplicationWorkflowsRequest instance + */ + public static create(properties?: tabletmanagerdata.IUpdateVReplicationWorkflowsRequest): tabletmanagerdata.UpdateVReplicationWorkflowsRequest; + + /** + * Encodes the specified UpdateVReplicationWorkflowsRequest message. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsRequest.verify|verify} messages. + * @param message UpdateVReplicationWorkflowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: tabletmanagerdata.IUpdateVReplicationWorkflowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateVReplicationWorkflowsRequest message, length delimited. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsRequest.verify|verify} messages. + * @param message UpdateVReplicationWorkflowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: tabletmanagerdata.IUpdateVReplicationWorkflowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateVReplicationWorkflowsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateVReplicationWorkflowsRequest + * @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): tabletmanagerdata.UpdateVReplicationWorkflowsRequest; + + /** + * Decodes an UpdateVReplicationWorkflowsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateVReplicationWorkflowsRequest + * @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)): tabletmanagerdata.UpdateVReplicationWorkflowsRequest; + + /** + * Verifies an UpdateVReplicationWorkflowsRequest 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 UpdateVReplicationWorkflowsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateVReplicationWorkflowsRequest + */ + public static fromObject(object: { [k: string]: any }): tabletmanagerdata.UpdateVReplicationWorkflowsRequest; + + /** + * Creates a plain object from an UpdateVReplicationWorkflowsRequest message. Also converts values to other types if specified. + * @param message UpdateVReplicationWorkflowsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: tabletmanagerdata.UpdateVReplicationWorkflowsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateVReplicationWorkflowsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateVReplicationWorkflowsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateVReplicationWorkflowsResponse. */ + interface IUpdateVReplicationWorkflowsResponse { + + /** UpdateVReplicationWorkflowsResponse result */ + result?: (query.IQueryResult|null); + } + + /** Represents an UpdateVReplicationWorkflowsResponse. */ + class UpdateVReplicationWorkflowsResponse implements IUpdateVReplicationWorkflowsResponse { + + /** + * Constructs a new UpdateVReplicationWorkflowsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: tabletmanagerdata.IUpdateVReplicationWorkflowsResponse); + + /** UpdateVReplicationWorkflowsResponse result. */ + public result?: (query.IQueryResult|null); + + /** + * Creates a new UpdateVReplicationWorkflowsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateVReplicationWorkflowsResponse instance + */ + public static create(properties?: tabletmanagerdata.IUpdateVReplicationWorkflowsResponse): tabletmanagerdata.UpdateVReplicationWorkflowsResponse; + + /** + * Encodes the specified UpdateVReplicationWorkflowsResponse message. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsResponse.verify|verify} messages. + * @param message UpdateVReplicationWorkflowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: tabletmanagerdata.IUpdateVReplicationWorkflowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateVReplicationWorkflowsResponse message, length delimited. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsResponse.verify|verify} messages. + * @param message UpdateVReplicationWorkflowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: tabletmanagerdata.IUpdateVReplicationWorkflowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateVReplicationWorkflowsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateVReplicationWorkflowsResponse + * @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): tabletmanagerdata.UpdateVReplicationWorkflowsResponse; + + /** + * Decodes an UpdateVReplicationWorkflowsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateVReplicationWorkflowsResponse + * @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)): tabletmanagerdata.UpdateVReplicationWorkflowsResponse; + + /** + * Verifies an UpdateVReplicationWorkflowsResponse 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 UpdateVReplicationWorkflowsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateVReplicationWorkflowsResponse + */ + public static fromObject(object: { [k: string]: any }): tabletmanagerdata.UpdateVReplicationWorkflowsResponse; + + /** + * Creates a plain object from an UpdateVReplicationWorkflowsResponse message. Also converts values to other types if specified. + * @param message UpdateVReplicationWorkflowsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: tabletmanagerdata.UpdateVReplicationWorkflowsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateVReplicationWorkflowsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateVReplicationWorkflowsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a ResetSequencesRequest. */ interface IResetSequencesRequest { diff --git a/web/vtadmin/src/proto/vtadmin.js b/web/vtadmin/src/proto/vtadmin.js index fc8c6a862fe..bfd74e78997 100644 --- a/web/vtadmin/src/proto/vtadmin.js +++ b/web/vtadmin/src/proto/vtadmin.js @@ -63396,24 +63396,23 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { return DeleteVReplicationWorkflowResponse; })(); - tabletmanagerdata.ReadVReplicationWorkflowRequest = (function() { + tabletmanagerdata.HasVReplicationWorkflowsRequest = (function() { /** - * Properties of a ReadVReplicationWorkflowRequest. + * Properties of a HasVReplicationWorkflowsRequest. * @memberof tabletmanagerdata - * @interface IReadVReplicationWorkflowRequest - * @property {string|null} [workflow] ReadVReplicationWorkflowRequest workflow + * @interface IHasVReplicationWorkflowsRequest */ /** - * Constructs a new ReadVReplicationWorkflowRequest. + * Constructs a new HasVReplicationWorkflowsRequest. * @memberof tabletmanagerdata - * @classdesc Represents a ReadVReplicationWorkflowRequest. - * @implements IReadVReplicationWorkflowRequest + * @classdesc Represents a HasVReplicationWorkflowsRequest. + * @implements IHasVReplicationWorkflowsRequest * @constructor - * @param {tabletmanagerdata.IReadVReplicationWorkflowRequest=} [properties] Properties to set + * @param {tabletmanagerdata.IHasVReplicationWorkflowsRequest=} [properties] Properties to set */ - function ReadVReplicationWorkflowRequest(properties) { + function HasVReplicationWorkflowsRequest(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -63421,77 +63420,63 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { } /** - * ReadVReplicationWorkflowRequest workflow. - * @member {string} workflow - * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest - * @instance - */ - ReadVReplicationWorkflowRequest.prototype.workflow = ""; - - /** - * Creates a new ReadVReplicationWorkflowRequest instance using the specified properties. + * Creates a new HasVReplicationWorkflowsRequest instance using the specified properties. * @function create - * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest + * @memberof tabletmanagerdata.HasVReplicationWorkflowsRequest * @static - * @param {tabletmanagerdata.IReadVReplicationWorkflowRequest=} [properties] Properties to set - * @returns {tabletmanagerdata.ReadVReplicationWorkflowRequest} ReadVReplicationWorkflowRequest instance + * @param {tabletmanagerdata.IHasVReplicationWorkflowsRequest=} [properties] Properties to set + * @returns {tabletmanagerdata.HasVReplicationWorkflowsRequest} HasVReplicationWorkflowsRequest instance */ - ReadVReplicationWorkflowRequest.create = function create(properties) { - return new ReadVReplicationWorkflowRequest(properties); + HasVReplicationWorkflowsRequest.create = function create(properties) { + return new HasVReplicationWorkflowsRequest(properties); }; /** - * Encodes the specified ReadVReplicationWorkflowRequest message. Does not implicitly {@link tabletmanagerdata.ReadVReplicationWorkflowRequest.verify|verify} messages. + * Encodes the specified HasVReplicationWorkflowsRequest message. Does not implicitly {@link tabletmanagerdata.HasVReplicationWorkflowsRequest.verify|verify} messages. * @function encode - * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest + * @memberof tabletmanagerdata.HasVReplicationWorkflowsRequest * @static - * @param {tabletmanagerdata.IReadVReplicationWorkflowRequest} message ReadVReplicationWorkflowRequest message or plain object to encode + * @param {tabletmanagerdata.IHasVReplicationWorkflowsRequest} message HasVReplicationWorkflowsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadVReplicationWorkflowRequest.encode = function encode(message, writer) { + HasVReplicationWorkflowsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.workflow != null && Object.hasOwnProperty.call(message, "workflow")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.workflow); return writer; }; /** - * Encodes the specified ReadVReplicationWorkflowRequest message, length delimited. Does not implicitly {@link tabletmanagerdata.ReadVReplicationWorkflowRequest.verify|verify} messages. + * Encodes the specified HasVReplicationWorkflowsRequest message, length delimited. Does not implicitly {@link tabletmanagerdata.HasVReplicationWorkflowsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest + * @memberof tabletmanagerdata.HasVReplicationWorkflowsRequest * @static - * @param {tabletmanagerdata.IReadVReplicationWorkflowRequest} message ReadVReplicationWorkflowRequest message or plain object to encode + * @param {tabletmanagerdata.IHasVReplicationWorkflowsRequest} message HasVReplicationWorkflowsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadVReplicationWorkflowRequest.encodeDelimited = function encodeDelimited(message, writer) { + HasVReplicationWorkflowsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReadVReplicationWorkflowRequest message from the specified reader or buffer. + * Decodes a HasVReplicationWorkflowsRequest message from the specified reader or buffer. * @function decode - * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest + * @memberof tabletmanagerdata.HasVReplicationWorkflowsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {tabletmanagerdata.ReadVReplicationWorkflowRequest} ReadVReplicationWorkflowRequest + * @returns {tabletmanagerdata.HasVReplicationWorkflowsRequest} HasVReplicationWorkflowsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadVReplicationWorkflowRequest.decode = function decode(reader, length) { + HasVReplicationWorkflowsRequest.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.tabletmanagerdata.ReadVReplicationWorkflowRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tabletmanagerdata.HasVReplicationWorkflowsRequest(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.workflow = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -63501,133 +63486,109 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { }; /** - * Decodes a ReadVReplicationWorkflowRequest message from the specified reader or buffer, length delimited. + * Decodes a HasVReplicationWorkflowsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest + * @memberof tabletmanagerdata.HasVReplicationWorkflowsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tabletmanagerdata.ReadVReplicationWorkflowRequest} ReadVReplicationWorkflowRequest + * @returns {tabletmanagerdata.HasVReplicationWorkflowsRequest} HasVReplicationWorkflowsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadVReplicationWorkflowRequest.decodeDelimited = function decodeDelimited(reader) { + HasVReplicationWorkflowsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReadVReplicationWorkflowRequest message. + * Verifies a HasVReplicationWorkflowsRequest message. * @function verify - * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest + * @memberof tabletmanagerdata.HasVReplicationWorkflowsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReadVReplicationWorkflowRequest.verify = function verify(message) { + HasVReplicationWorkflowsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.workflow != null && message.hasOwnProperty("workflow")) - if (!$util.isString(message.workflow)) - return "workflow: string expected"; return null; }; /** - * Creates a ReadVReplicationWorkflowRequest message from a plain object. Also converts values to their respective internal types. + * Creates a HasVReplicationWorkflowsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest + * @memberof tabletmanagerdata.HasVReplicationWorkflowsRequest * @static * @param {Object.} object Plain object - * @returns {tabletmanagerdata.ReadVReplicationWorkflowRequest} ReadVReplicationWorkflowRequest + * @returns {tabletmanagerdata.HasVReplicationWorkflowsRequest} HasVReplicationWorkflowsRequest */ - ReadVReplicationWorkflowRequest.fromObject = function fromObject(object) { - if (object instanceof $root.tabletmanagerdata.ReadVReplicationWorkflowRequest) + HasVReplicationWorkflowsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.HasVReplicationWorkflowsRequest) return object; - let message = new $root.tabletmanagerdata.ReadVReplicationWorkflowRequest(); - if (object.workflow != null) - message.workflow = String(object.workflow); - return message; + return new $root.tabletmanagerdata.HasVReplicationWorkflowsRequest(); }; /** - * Creates a plain object from a ReadVReplicationWorkflowRequest message. Also converts values to other types if specified. + * Creates a plain object from a HasVReplicationWorkflowsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest + * @memberof tabletmanagerdata.HasVReplicationWorkflowsRequest * @static - * @param {tabletmanagerdata.ReadVReplicationWorkflowRequest} message ReadVReplicationWorkflowRequest + * @param {tabletmanagerdata.HasVReplicationWorkflowsRequest} message HasVReplicationWorkflowsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadVReplicationWorkflowRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.workflow = ""; - if (message.workflow != null && message.hasOwnProperty("workflow")) - object.workflow = message.workflow; - return object; + HasVReplicationWorkflowsRequest.toObject = function toObject() { + return {}; }; /** - * Converts this ReadVReplicationWorkflowRequest to JSON. + * Converts this HasVReplicationWorkflowsRequest to JSON. * @function toJSON - * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest + * @memberof tabletmanagerdata.HasVReplicationWorkflowsRequest * @instance * @returns {Object.} JSON object */ - ReadVReplicationWorkflowRequest.prototype.toJSON = function toJSON() { + HasVReplicationWorkflowsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ReadVReplicationWorkflowRequest + * Gets the default type url for HasVReplicationWorkflowsRequest * @function getTypeUrl - * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest + * @memberof tabletmanagerdata.HasVReplicationWorkflowsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ReadVReplicationWorkflowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + HasVReplicationWorkflowsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/tabletmanagerdata.ReadVReplicationWorkflowRequest"; + return typeUrlPrefix + "/tabletmanagerdata.HasVReplicationWorkflowsRequest"; }; - return ReadVReplicationWorkflowRequest; + return HasVReplicationWorkflowsRequest; })(); - tabletmanagerdata.ReadVReplicationWorkflowResponse = (function() { + tabletmanagerdata.HasVReplicationWorkflowsResponse = (function() { /** - * Properties of a ReadVReplicationWorkflowResponse. + * Properties of a HasVReplicationWorkflowsResponse. * @memberof tabletmanagerdata - * @interface IReadVReplicationWorkflowResponse - * @property {string|null} [workflow] ReadVReplicationWorkflowResponse workflow - * @property {string|null} [cells] ReadVReplicationWorkflowResponse cells - * @property {Array.|null} [tablet_types] ReadVReplicationWorkflowResponse tablet_types - * @property {tabletmanagerdata.TabletSelectionPreference|null} [tablet_selection_preference] ReadVReplicationWorkflowResponse tablet_selection_preference - * @property {string|null} [db_name] ReadVReplicationWorkflowResponse db_name - * @property {string|null} [tags] ReadVReplicationWorkflowResponse tags - * @property {binlogdata.VReplicationWorkflowType|null} [workflow_type] ReadVReplicationWorkflowResponse workflow_type - * @property {binlogdata.VReplicationWorkflowSubType|null} [workflow_sub_type] ReadVReplicationWorkflowResponse workflow_sub_type - * @property {boolean|null} [defer_secondary_keys] ReadVReplicationWorkflowResponse defer_secondary_keys - * @property {Array.|null} [streams] ReadVReplicationWorkflowResponse streams + * @interface IHasVReplicationWorkflowsResponse + * @property {boolean|null} [has] HasVReplicationWorkflowsResponse has */ /** - * Constructs a new ReadVReplicationWorkflowResponse. + * Constructs a new HasVReplicationWorkflowsResponse. * @memberof tabletmanagerdata - * @classdesc Represents a ReadVReplicationWorkflowResponse. - * @implements IReadVReplicationWorkflowResponse + * @classdesc Represents a HasVReplicationWorkflowsResponse. + * @implements IHasVReplicationWorkflowsResponse * @constructor - * @param {tabletmanagerdata.IReadVReplicationWorkflowResponse=} [properties] Properties to set + * @param {tabletmanagerdata.IHasVReplicationWorkflowsResponse=} [properties] Properties to set */ - function ReadVReplicationWorkflowResponse(properties) { - this.tablet_types = []; - this.streams = []; + function HasVReplicationWorkflowsResponse(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -63635,215 +63596,75 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { } /** - * ReadVReplicationWorkflowResponse workflow. - * @member {string} workflow - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse - * @instance - */ - ReadVReplicationWorkflowResponse.prototype.workflow = ""; - - /** - * ReadVReplicationWorkflowResponse cells. - * @member {string} cells - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse - * @instance - */ - ReadVReplicationWorkflowResponse.prototype.cells = ""; - - /** - * ReadVReplicationWorkflowResponse tablet_types. - * @member {Array.} tablet_types - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse - * @instance - */ - ReadVReplicationWorkflowResponse.prototype.tablet_types = $util.emptyArray; - - /** - * ReadVReplicationWorkflowResponse tablet_selection_preference. - * @member {tabletmanagerdata.TabletSelectionPreference} tablet_selection_preference - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse - * @instance - */ - ReadVReplicationWorkflowResponse.prototype.tablet_selection_preference = 0; - - /** - * ReadVReplicationWorkflowResponse db_name. - * @member {string} db_name - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse - * @instance - */ - ReadVReplicationWorkflowResponse.prototype.db_name = ""; - - /** - * ReadVReplicationWorkflowResponse tags. - * @member {string} tags - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse - * @instance - */ - ReadVReplicationWorkflowResponse.prototype.tags = ""; - - /** - * ReadVReplicationWorkflowResponse workflow_type. - * @member {binlogdata.VReplicationWorkflowType} workflow_type - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse - * @instance - */ - ReadVReplicationWorkflowResponse.prototype.workflow_type = 0; - - /** - * ReadVReplicationWorkflowResponse workflow_sub_type. - * @member {binlogdata.VReplicationWorkflowSubType} workflow_sub_type - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse - * @instance - */ - ReadVReplicationWorkflowResponse.prototype.workflow_sub_type = 0; - - /** - * ReadVReplicationWorkflowResponse defer_secondary_keys. - * @member {boolean} defer_secondary_keys - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse - * @instance - */ - ReadVReplicationWorkflowResponse.prototype.defer_secondary_keys = false; - - /** - * ReadVReplicationWorkflowResponse streams. - * @member {Array.} streams - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * HasVReplicationWorkflowsResponse has. + * @member {boolean} has + * @memberof tabletmanagerdata.HasVReplicationWorkflowsResponse * @instance */ - ReadVReplicationWorkflowResponse.prototype.streams = $util.emptyArray; + HasVReplicationWorkflowsResponse.prototype.has = false; /** - * Creates a new ReadVReplicationWorkflowResponse instance using the specified properties. + * Creates a new HasVReplicationWorkflowsResponse instance using the specified properties. * @function create - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @memberof tabletmanagerdata.HasVReplicationWorkflowsResponse * @static - * @param {tabletmanagerdata.IReadVReplicationWorkflowResponse=} [properties] Properties to set - * @returns {tabletmanagerdata.ReadVReplicationWorkflowResponse} ReadVReplicationWorkflowResponse instance + * @param {tabletmanagerdata.IHasVReplicationWorkflowsResponse=} [properties] Properties to set + * @returns {tabletmanagerdata.HasVReplicationWorkflowsResponse} HasVReplicationWorkflowsResponse instance */ - ReadVReplicationWorkflowResponse.create = function create(properties) { - return new ReadVReplicationWorkflowResponse(properties); + HasVReplicationWorkflowsResponse.create = function create(properties) { + return new HasVReplicationWorkflowsResponse(properties); }; /** - * Encodes the specified ReadVReplicationWorkflowResponse message. Does not implicitly {@link tabletmanagerdata.ReadVReplicationWorkflowResponse.verify|verify} messages. + * Encodes the specified HasVReplicationWorkflowsResponse message. Does not implicitly {@link tabletmanagerdata.HasVReplicationWorkflowsResponse.verify|verify} messages. * @function encode - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @memberof tabletmanagerdata.HasVReplicationWorkflowsResponse * @static - * @param {tabletmanagerdata.IReadVReplicationWorkflowResponse} message ReadVReplicationWorkflowResponse message or plain object to encode + * @param {tabletmanagerdata.IHasVReplicationWorkflowsResponse} message HasVReplicationWorkflowsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadVReplicationWorkflowResponse.encode = function encode(message, writer) { + HasVReplicationWorkflowsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.workflow != null && Object.hasOwnProperty.call(message, "workflow")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.workflow); - if (message.cells != null && Object.hasOwnProperty.call(message, "cells")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.cells); - if (message.tablet_types != null && message.tablet_types.length) { - writer.uint32(/* id 4, wireType 2 =*/34).fork(); - for (let i = 0; i < message.tablet_types.length; ++i) - writer.int32(message.tablet_types[i]); - writer.ldelim(); - } - if (message.tablet_selection_preference != null && Object.hasOwnProperty.call(message, "tablet_selection_preference")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.tablet_selection_preference); - if (message.db_name != null && Object.hasOwnProperty.call(message, "db_name")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.db_name); - if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.tags); - if (message.workflow_type != null && Object.hasOwnProperty.call(message, "workflow_type")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.workflow_type); - if (message.workflow_sub_type != null && Object.hasOwnProperty.call(message, "workflow_sub_type")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.workflow_sub_type); - if (message.defer_secondary_keys != null && Object.hasOwnProperty.call(message, "defer_secondary_keys")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.defer_secondary_keys); - if (message.streams != null && message.streams.length) - for (let i = 0; i < message.streams.length; ++i) - $root.tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.encode(message.streams[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.has != null && Object.hasOwnProperty.call(message, "has")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.has); return writer; }; /** - * Encodes the specified ReadVReplicationWorkflowResponse message, length delimited. Does not implicitly {@link tabletmanagerdata.ReadVReplicationWorkflowResponse.verify|verify} messages. + * Encodes the specified HasVReplicationWorkflowsResponse message, length delimited. Does not implicitly {@link tabletmanagerdata.HasVReplicationWorkflowsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @memberof tabletmanagerdata.HasVReplicationWorkflowsResponse * @static - * @param {tabletmanagerdata.IReadVReplicationWorkflowResponse} message ReadVReplicationWorkflowResponse message or plain object to encode + * @param {tabletmanagerdata.IHasVReplicationWorkflowsResponse} message HasVReplicationWorkflowsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadVReplicationWorkflowResponse.encodeDelimited = function encodeDelimited(message, writer) { + HasVReplicationWorkflowsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReadVReplicationWorkflowResponse message from the specified reader or buffer. + * Decodes a HasVReplicationWorkflowsResponse message from the specified reader or buffer. * @function decode - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @memberof tabletmanagerdata.HasVReplicationWorkflowsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {tabletmanagerdata.ReadVReplicationWorkflowResponse} ReadVReplicationWorkflowResponse + * @returns {tabletmanagerdata.HasVReplicationWorkflowsResponse} HasVReplicationWorkflowsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadVReplicationWorkflowResponse.decode = function decode(reader, length) { + HasVReplicationWorkflowsResponse.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.tabletmanagerdata.ReadVReplicationWorkflowResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tabletmanagerdata.HasVReplicationWorkflowsResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { - case 2: { - message.workflow = reader.string(); - break; - } - case 3: { - message.cells = reader.string(); - break; - } - case 4: { - if (!(message.tablet_types && message.tablet_types.length)) - message.tablet_types = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.tablet_types.push(reader.int32()); - } else - message.tablet_types.push(reader.int32()); - break; - } - case 5: { - message.tablet_selection_preference = reader.int32(); - break; - } - case 6: { - message.db_name = reader.string(); - break; - } - case 7: { - message.tags = reader.string(); - break; - } - case 8: { - message.workflow_type = reader.int32(); - break; - } - case 9: { - message.workflow_sub_type = reader.int32(); - break; - } - case 10: { - message.defer_secondary_keys = reader.bool(); - break; - } - case 11: { - if (!(message.streams && message.streams.length)) - message.streams = []; - message.streams.push($root.tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.decode(reader, reader.uint32())); + case 1: { + message.has = reader.bool(); break; } default: @@ -63855,886 +63676,2179 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { }; /** - * Decodes a ReadVReplicationWorkflowResponse message from the specified reader or buffer, length delimited. + * Decodes a HasVReplicationWorkflowsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @memberof tabletmanagerdata.HasVReplicationWorkflowsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tabletmanagerdata.ReadVReplicationWorkflowResponse} ReadVReplicationWorkflowResponse + * @returns {tabletmanagerdata.HasVReplicationWorkflowsResponse} HasVReplicationWorkflowsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadVReplicationWorkflowResponse.decodeDelimited = function decodeDelimited(reader) { + HasVReplicationWorkflowsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReadVReplicationWorkflowResponse message. + * Verifies a HasVReplicationWorkflowsResponse message. * @function verify - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @memberof tabletmanagerdata.HasVReplicationWorkflowsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReadVReplicationWorkflowResponse.verify = function verify(message) { + HasVReplicationWorkflowsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.workflow != null && message.hasOwnProperty("workflow")) - if (!$util.isString(message.workflow)) - return "workflow: string expected"; - if (message.cells != null && message.hasOwnProperty("cells")) - if (!$util.isString(message.cells)) - return "cells: string expected"; - if (message.tablet_types != null && message.hasOwnProperty("tablet_types")) { - if (!Array.isArray(message.tablet_types)) - return "tablet_types: array expected"; - for (let i = 0; i < message.tablet_types.length; ++i) - switch (message.tablet_types[i]) { - default: - return "tablet_types: enum value[] expected"; - case 0: - case 1: - case 1: - case 2: - case 3: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - } - if (message.tablet_selection_preference != null && message.hasOwnProperty("tablet_selection_preference")) - switch (message.tablet_selection_preference) { - default: - return "tablet_selection_preference: enum value expected"; - case 0: - case 1: - case 3: - break; - } - if (message.db_name != null && message.hasOwnProperty("db_name")) - if (!$util.isString(message.db_name)) - return "db_name: string expected"; - if (message.tags != null && message.hasOwnProperty("tags")) - if (!$util.isString(message.tags)) - return "tags: string expected"; - if (message.workflow_type != null && message.hasOwnProperty("workflow_type")) - switch (message.workflow_type) { - default: - return "workflow_type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.workflow_sub_type != null && message.hasOwnProperty("workflow_sub_type")) - switch (message.workflow_sub_type) { - default: - return "workflow_sub_type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.defer_secondary_keys != null && message.hasOwnProperty("defer_secondary_keys")) - if (typeof message.defer_secondary_keys !== "boolean") - return "defer_secondary_keys: boolean expected"; - if (message.streams != null && message.hasOwnProperty("streams")) { - if (!Array.isArray(message.streams)) - return "streams: array expected"; - for (let i = 0; i < message.streams.length; ++i) { - let error = $root.tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.verify(message.streams[i]); - if (error) - return "streams." + error; - } - } + if (message.has != null && message.hasOwnProperty("has")) + if (typeof message.has !== "boolean") + return "has: boolean expected"; return null; }; /** - * Creates a ReadVReplicationWorkflowResponse message from a plain object. Also converts values to their respective internal types. + * Creates a HasVReplicationWorkflowsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @memberof tabletmanagerdata.HasVReplicationWorkflowsResponse * @static * @param {Object.} object Plain object - * @returns {tabletmanagerdata.ReadVReplicationWorkflowResponse} ReadVReplicationWorkflowResponse + * @returns {tabletmanagerdata.HasVReplicationWorkflowsResponse} HasVReplicationWorkflowsResponse */ - ReadVReplicationWorkflowResponse.fromObject = function fromObject(object) { - if (object instanceof $root.tabletmanagerdata.ReadVReplicationWorkflowResponse) + HasVReplicationWorkflowsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.HasVReplicationWorkflowsResponse) return object; - let message = new $root.tabletmanagerdata.ReadVReplicationWorkflowResponse(); - if (object.workflow != null) - message.workflow = String(object.workflow); - if (object.cells != null) - message.cells = String(object.cells); - if (object.tablet_types) { - if (!Array.isArray(object.tablet_types)) - throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_types: array expected"); - message.tablet_types = []; - for (let i = 0; i < object.tablet_types.length; ++i) - switch (object.tablet_types[i]) { - default: - if (typeof object.tablet_types[i] === "number") { - message.tablet_types[i] = object.tablet_types[i]; - break; - } - case "UNKNOWN": - case 0: - message.tablet_types[i] = 0; - break; - case "PRIMARY": - case 1: - message.tablet_types[i] = 1; - break; - case "MASTER": - case 1: - message.tablet_types[i] = 1; - break; - case "REPLICA": - case 2: - message.tablet_types[i] = 2; - break; - case "RDONLY": - case 3: - message.tablet_types[i] = 3; - break; - case "BATCH": - case 3: - message.tablet_types[i] = 3; - break; - case "SPARE": - case 4: - message.tablet_types[i] = 4; - break; - case "EXPERIMENTAL": - case 5: - message.tablet_types[i] = 5; - break; - case "BACKUP": - case 6: - message.tablet_types[i] = 6; - break; - case "RESTORE": - case 7: - message.tablet_types[i] = 7; - break; - case "DRAINED": - case 8: - message.tablet_types[i] = 8; - break; - } - } - switch (object.tablet_selection_preference) { - default: - if (typeof object.tablet_selection_preference === "number") { - message.tablet_selection_preference = object.tablet_selection_preference; - break; - } - break; - case "ANY": - case 0: - message.tablet_selection_preference = 0; - break; - case "INORDER": - case 1: - message.tablet_selection_preference = 1; - break; - case "UNKNOWN": - case 3: - message.tablet_selection_preference = 3; - break; - } - if (object.db_name != null) - message.db_name = String(object.db_name); - if (object.tags != null) - message.tags = String(object.tags); - switch (object.workflow_type) { - default: - if (typeof object.workflow_type === "number") { - message.workflow_type = object.workflow_type; - break; - } - break; - case "Materialize": - case 0: - message.workflow_type = 0; - break; - case "MoveTables": - case 1: - message.workflow_type = 1; - break; - case "CreateLookupIndex": - case 2: - message.workflow_type = 2; - break; - case "Migrate": - case 3: - message.workflow_type = 3; - break; - case "Reshard": - case 4: - message.workflow_type = 4; - break; - case "OnlineDDL": - case 5: - message.workflow_type = 5; - break; - } - switch (object.workflow_sub_type) { - default: - if (typeof object.workflow_sub_type === "number") { - message.workflow_sub_type = object.workflow_sub_type; - break; - } - break; - case "None": - case 0: - message.workflow_sub_type = 0; - break; - case "Partial": - case 1: - message.workflow_sub_type = 1; - break; - case "AtomicCopy": - case 2: - message.workflow_sub_type = 2; - break; - } - if (object.defer_secondary_keys != null) - message.defer_secondary_keys = Boolean(object.defer_secondary_keys); - if (object.streams) { - if (!Array.isArray(object.streams)) - throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowResponse.streams: array expected"); - message.streams = []; - for (let i = 0; i < object.streams.length; ++i) { - if (typeof object.streams[i] !== "object") - throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowResponse.streams: object expected"); - message.streams[i] = $root.tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.fromObject(object.streams[i]); - } - } + let message = new $root.tabletmanagerdata.HasVReplicationWorkflowsResponse(); + if (object.has != null) + message.has = Boolean(object.has); return message; }; /** - * Creates a plain object from a ReadVReplicationWorkflowResponse message. Also converts values to other types if specified. + * Creates a plain object from a HasVReplicationWorkflowsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @memberof tabletmanagerdata.HasVReplicationWorkflowsResponse * @static - * @param {tabletmanagerdata.ReadVReplicationWorkflowResponse} message ReadVReplicationWorkflowResponse + * @param {tabletmanagerdata.HasVReplicationWorkflowsResponse} message HasVReplicationWorkflowsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadVReplicationWorkflowResponse.toObject = function toObject(message, options) { + HasVReplicationWorkflowsResponse.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.arrays || options.defaults) { - object.tablet_types = []; - object.streams = []; - } - if (options.defaults) { - object.workflow = ""; - object.cells = ""; - object.tablet_selection_preference = options.enums === String ? "ANY" : 0; - object.db_name = ""; - object.tags = ""; - object.workflow_type = options.enums === String ? "Materialize" : 0; - object.workflow_sub_type = options.enums === String ? "None" : 0; - object.defer_secondary_keys = false; - } - if (message.workflow != null && message.hasOwnProperty("workflow")) - object.workflow = message.workflow; - if (message.cells != null && message.hasOwnProperty("cells")) - object.cells = message.cells; - if (message.tablet_types && message.tablet_types.length) { - object.tablet_types = []; - for (let j = 0; j < message.tablet_types.length; ++j) - object.tablet_types[j] = options.enums === String ? $root.topodata.TabletType[message.tablet_types[j]] === undefined ? message.tablet_types[j] : $root.topodata.TabletType[message.tablet_types[j]] : message.tablet_types[j]; - } - if (message.tablet_selection_preference != null && message.hasOwnProperty("tablet_selection_preference")) - object.tablet_selection_preference = options.enums === String ? $root.tabletmanagerdata.TabletSelectionPreference[message.tablet_selection_preference] === undefined ? message.tablet_selection_preference : $root.tabletmanagerdata.TabletSelectionPreference[message.tablet_selection_preference] : message.tablet_selection_preference; - if (message.db_name != null && message.hasOwnProperty("db_name")) - object.db_name = message.db_name; - if (message.tags != null && message.hasOwnProperty("tags")) - object.tags = message.tags; - if (message.workflow_type != null && message.hasOwnProperty("workflow_type")) - object.workflow_type = options.enums === String ? $root.binlogdata.VReplicationWorkflowType[message.workflow_type] === undefined ? message.workflow_type : $root.binlogdata.VReplicationWorkflowType[message.workflow_type] : message.workflow_type; - if (message.workflow_sub_type != null && message.hasOwnProperty("workflow_sub_type")) - object.workflow_sub_type = options.enums === String ? $root.binlogdata.VReplicationWorkflowSubType[message.workflow_sub_type] === undefined ? message.workflow_sub_type : $root.binlogdata.VReplicationWorkflowSubType[message.workflow_sub_type] : message.workflow_sub_type; - if (message.defer_secondary_keys != null && message.hasOwnProperty("defer_secondary_keys")) - object.defer_secondary_keys = message.defer_secondary_keys; - if (message.streams && message.streams.length) { - object.streams = []; - for (let j = 0; j < message.streams.length; ++j) - object.streams[j] = $root.tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.toObject(message.streams[j], options); - } + if (options.defaults) + object.has = false; + if (message.has != null && message.hasOwnProperty("has")) + object.has = message.has; return object; }; /** - * Converts this ReadVReplicationWorkflowResponse to JSON. + * Converts this HasVReplicationWorkflowsResponse to JSON. * @function toJSON - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @memberof tabletmanagerdata.HasVReplicationWorkflowsResponse * @instance * @returns {Object.} JSON object */ - ReadVReplicationWorkflowResponse.prototype.toJSON = function toJSON() { + HasVReplicationWorkflowsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ReadVReplicationWorkflowResponse + * Gets the default type url for HasVReplicationWorkflowsResponse * @function getTypeUrl - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @memberof tabletmanagerdata.HasVReplicationWorkflowsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ReadVReplicationWorkflowResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + HasVReplicationWorkflowsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/tabletmanagerdata.ReadVReplicationWorkflowResponse"; + return typeUrlPrefix + "/tabletmanagerdata.HasVReplicationWorkflowsResponse"; }; - ReadVReplicationWorkflowResponse.Stream = (function() { - - /** - * Properties of a Stream. - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse - * @interface IStream - * @property {number|null} [id] Stream id - * @property {binlogdata.IBinlogSource|null} [bls] Stream bls - * @property {string|null} [pos] Stream pos - * @property {string|null} [stop_pos] Stream stop_pos - * @property {number|Long|null} [max_tps] Stream max_tps - * @property {number|Long|null} [max_replication_lag] Stream max_replication_lag - * @property {vttime.ITime|null} [time_updated] Stream time_updated - * @property {vttime.ITime|null} [transaction_timestamp] Stream transaction_timestamp - * @property {binlogdata.VReplicationWorkflowState|null} [state] Stream state - * @property {string|null} [message] Stream message - * @property {number|Long|null} [rows_copied] Stream rows_copied - * @property {vttime.ITime|null} [time_heartbeat] Stream time_heartbeat - * @property {vttime.ITime|null} [time_throttled] Stream time_throttled - * @property {string|null} [component_throttled] Stream component_throttled - */ - - /** - * Constructs a new Stream. - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse - * @classdesc Represents a Stream. - * @implements IStream - * @constructor - * @param {tabletmanagerdata.ReadVReplicationWorkflowResponse.IStream=} [properties] Properties to set - */ - function Stream(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]]; - } - - /** - * Stream id. - * @member {number} id - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @instance - */ - Stream.prototype.id = 0; - - /** - * Stream bls. - * @member {binlogdata.IBinlogSource|null|undefined} bls - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @instance - */ - Stream.prototype.bls = null; + return HasVReplicationWorkflowsResponse; + })(); - /** - * Stream pos. - * @member {string} pos - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @instance - */ - Stream.prototype.pos = ""; + tabletmanagerdata.ReadVReplicationWorkflowsRequest = (function() { - /** - * Stream stop_pos. - * @member {string} stop_pos - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @instance - */ - Stream.prototype.stop_pos = ""; + /** + * Properties of a ReadVReplicationWorkflowsRequest. + * @memberof tabletmanagerdata + * @interface IReadVReplicationWorkflowsRequest + * @property {Array.|null} [include_ids] ReadVReplicationWorkflowsRequest include_ids + * @property {Array.|null} [include_workflows] ReadVReplicationWorkflowsRequest include_workflows + * @property {Array.|null} [include_states] ReadVReplicationWorkflowsRequest include_states + * @property {Array.|null} [exclude_workflows] ReadVReplicationWorkflowsRequest exclude_workflows + * @property {Array.|null} [exclude_states] ReadVReplicationWorkflowsRequest exclude_states + * @property {boolean|null} [exclude_frozen] ReadVReplicationWorkflowsRequest exclude_frozen + */ - /** - * Stream max_tps. - * @member {number|Long} max_tps - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @instance - */ - Stream.prototype.max_tps = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * Constructs a new ReadVReplicationWorkflowsRequest. + * @memberof tabletmanagerdata + * @classdesc Represents a ReadVReplicationWorkflowsRequest. + * @implements IReadVReplicationWorkflowsRequest + * @constructor + * @param {tabletmanagerdata.IReadVReplicationWorkflowsRequest=} [properties] Properties to set + */ + function ReadVReplicationWorkflowsRequest(properties) { + this.include_ids = []; + this.include_workflows = []; + this.include_states = []; + this.exclude_workflows = []; + this.exclude_states = []; + 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]]; + } - /** - * Stream max_replication_lag. - * @member {number|Long} max_replication_lag - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @instance - */ - Stream.prototype.max_replication_lag = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * ReadVReplicationWorkflowsRequest include_ids. + * @member {Array.} include_ids + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @instance + */ + ReadVReplicationWorkflowsRequest.prototype.include_ids = $util.emptyArray; - /** - * Stream time_updated. - * @member {vttime.ITime|null|undefined} time_updated - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @instance - */ - Stream.prototype.time_updated = null; + /** + * ReadVReplicationWorkflowsRequest include_workflows. + * @member {Array.} include_workflows + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @instance + */ + ReadVReplicationWorkflowsRequest.prototype.include_workflows = $util.emptyArray; - /** - * Stream transaction_timestamp. - * @member {vttime.ITime|null|undefined} transaction_timestamp - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @instance - */ - Stream.prototype.transaction_timestamp = null; + /** + * ReadVReplicationWorkflowsRequest include_states. + * @member {Array.} include_states + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @instance + */ + ReadVReplicationWorkflowsRequest.prototype.include_states = $util.emptyArray; - /** - * Stream state. - * @member {binlogdata.VReplicationWorkflowState} state - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @instance - */ - Stream.prototype.state = 0; + /** + * ReadVReplicationWorkflowsRequest exclude_workflows. + * @member {Array.} exclude_workflows + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @instance + */ + ReadVReplicationWorkflowsRequest.prototype.exclude_workflows = $util.emptyArray; - /** - * Stream message. - * @member {string} message - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @instance - */ - Stream.prototype.message = ""; + /** + * ReadVReplicationWorkflowsRequest exclude_states. + * @member {Array.} exclude_states + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @instance + */ + ReadVReplicationWorkflowsRequest.prototype.exclude_states = $util.emptyArray; - /** - * Stream rows_copied. - * @member {number|Long} rows_copied - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @instance - */ - Stream.prototype.rows_copied = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * ReadVReplicationWorkflowsRequest exclude_frozen. + * @member {boolean} exclude_frozen + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @instance + */ + ReadVReplicationWorkflowsRequest.prototype.exclude_frozen = false; - /** - * Stream time_heartbeat. - * @member {vttime.ITime|null|undefined} time_heartbeat - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @instance - */ - Stream.prototype.time_heartbeat = null; + /** + * Creates a new ReadVReplicationWorkflowsRequest instance using the specified properties. + * @function create + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @static + * @param {tabletmanagerdata.IReadVReplicationWorkflowsRequest=} [properties] Properties to set + * @returns {tabletmanagerdata.ReadVReplicationWorkflowsRequest} ReadVReplicationWorkflowsRequest instance + */ + ReadVReplicationWorkflowsRequest.create = function create(properties) { + return new ReadVReplicationWorkflowsRequest(properties); + }; - /** - * Stream time_throttled. - * @member {vttime.ITime|null|undefined} time_throttled - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @instance - */ - Stream.prototype.time_throttled = null; + /** + * Encodes the specified ReadVReplicationWorkflowsRequest message. Does not implicitly {@link tabletmanagerdata.ReadVReplicationWorkflowsRequest.verify|verify} messages. + * @function encode + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @static + * @param {tabletmanagerdata.IReadVReplicationWorkflowsRequest} message ReadVReplicationWorkflowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadVReplicationWorkflowsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.include_ids != null && message.include_ids.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (let i = 0; i < message.include_ids.length; ++i) + writer.int32(message.include_ids[i]); + writer.ldelim(); + } + if (message.include_workflows != null && message.include_workflows.length) + for (let i = 0; i < message.include_workflows.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.include_workflows[i]); + if (message.include_states != null && message.include_states.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (let i = 0; i < message.include_states.length; ++i) + writer.int32(message.include_states[i]); + writer.ldelim(); + } + if (message.exclude_workflows != null && message.exclude_workflows.length) + for (let i = 0; i < message.exclude_workflows.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.exclude_workflows[i]); + if (message.exclude_states != null && message.exclude_states.length) { + writer.uint32(/* id 5, wireType 2 =*/42).fork(); + for (let i = 0; i < message.exclude_states.length; ++i) + writer.int32(message.exclude_states[i]); + writer.ldelim(); + } + if (message.exclude_frozen != null && Object.hasOwnProperty.call(message, "exclude_frozen")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.exclude_frozen); + return writer; + }; - /** - * Stream component_throttled. - * @member {string} component_throttled - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @instance - */ - Stream.prototype.component_throttled = ""; + /** + * Encodes the specified ReadVReplicationWorkflowsRequest message, length delimited. Does not implicitly {@link tabletmanagerdata.ReadVReplicationWorkflowsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @static + * @param {tabletmanagerdata.IReadVReplicationWorkflowsRequest} message ReadVReplicationWorkflowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadVReplicationWorkflowsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new Stream instance using the specified properties. - * @function create - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @static - * @param {tabletmanagerdata.ReadVReplicationWorkflowResponse.IStream=} [properties] Properties to set - * @returns {tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream} Stream instance - */ - Stream.create = function create(properties) { - return new Stream(properties); - }; + /** + * Decodes a ReadVReplicationWorkflowsRequest message from the specified reader or buffer. + * @function decode + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tabletmanagerdata.ReadVReplicationWorkflowsRequest} ReadVReplicationWorkflowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadVReplicationWorkflowsRequest.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.tabletmanagerdata.ReadVReplicationWorkflowsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.include_ids && message.include_ids.length)) + message.include_ids = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.include_ids.push(reader.int32()); + } else + message.include_ids.push(reader.int32()); + break; + } + case 2: { + if (!(message.include_workflows && message.include_workflows.length)) + message.include_workflows = []; + message.include_workflows.push(reader.string()); + break; + } + case 3: { + if (!(message.include_states && message.include_states.length)) + message.include_states = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.include_states.push(reader.int32()); + } else + message.include_states.push(reader.int32()); + break; + } + case 4: { + if (!(message.exclude_workflows && message.exclude_workflows.length)) + message.exclude_workflows = []; + message.exclude_workflows.push(reader.string()); + break; + } + case 5: { + if (!(message.exclude_states && message.exclude_states.length)) + message.exclude_states = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.exclude_states.push(reader.int32()); + } else + message.exclude_states.push(reader.int32()); + break; + } + case 6: { + message.exclude_frozen = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified Stream message. Does not implicitly {@link tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.verify|verify} messages. - * @function encode - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @static - * @param {tabletmanagerdata.ReadVReplicationWorkflowResponse.IStream} message Stream message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Stream.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id); - if (message.bls != null && Object.hasOwnProperty.call(message, "bls")) - $root.binlogdata.BinlogSource.encode(message.bls, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.pos != null && Object.hasOwnProperty.call(message, "pos")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pos); - if (message.stop_pos != null && Object.hasOwnProperty.call(message, "stop_pos")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.stop_pos); - if (message.max_tps != null && Object.hasOwnProperty.call(message, "max_tps")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.max_tps); - if (message.max_replication_lag != null && Object.hasOwnProperty.call(message, "max_replication_lag")) - writer.uint32(/* id 6, wireType 0 =*/48).int64(message.max_replication_lag); - if (message.time_updated != null && Object.hasOwnProperty.call(message, "time_updated")) - $root.vttime.Time.encode(message.time_updated, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.transaction_timestamp != null && Object.hasOwnProperty.call(message, "transaction_timestamp")) - $root.vttime.Time.encode(message.transaction_timestamp, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.state); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.message); - if (message.rows_copied != null && Object.hasOwnProperty.call(message, "rows_copied")) - writer.uint32(/* id 11, wireType 0 =*/88).int64(message.rows_copied); - if (message.time_heartbeat != null && Object.hasOwnProperty.call(message, "time_heartbeat")) - $root.vttime.Time.encode(message.time_heartbeat, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.time_throttled != null && Object.hasOwnProperty.call(message, "time_throttled")) - $root.vttime.Time.encode(message.time_throttled, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.component_throttled != null && Object.hasOwnProperty.call(message, "component_throttled")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.component_throttled); - return writer; - }; + /** + * Decodes a ReadVReplicationWorkflowsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tabletmanagerdata.ReadVReplicationWorkflowsRequest} ReadVReplicationWorkflowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadVReplicationWorkflowsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified Stream message, length delimited. Does not implicitly {@link tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.verify|verify} messages. - * @function encodeDelimited - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @static - * @param {tabletmanagerdata.ReadVReplicationWorkflowResponse.IStream} message Stream message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Stream.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies a ReadVReplicationWorkflowsRequest message. + * @function verify + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadVReplicationWorkflowsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.include_ids != null && message.hasOwnProperty("include_ids")) { + if (!Array.isArray(message.include_ids)) + return "include_ids: array expected"; + for (let i = 0; i < message.include_ids.length; ++i) + if (!$util.isInteger(message.include_ids[i])) + return "include_ids: integer[] expected"; + } + if (message.include_workflows != null && message.hasOwnProperty("include_workflows")) { + if (!Array.isArray(message.include_workflows)) + return "include_workflows: array expected"; + for (let i = 0; i < message.include_workflows.length; ++i) + if (!$util.isString(message.include_workflows[i])) + return "include_workflows: string[] expected"; + } + if (message.include_states != null && message.hasOwnProperty("include_states")) { + if (!Array.isArray(message.include_states)) + return "include_states: array expected"; + for (let i = 0; i < message.include_states.length; ++i) + switch (message.include_states[i]) { + default: + return "include_states: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + } + if (message.exclude_workflows != null && message.hasOwnProperty("exclude_workflows")) { + if (!Array.isArray(message.exclude_workflows)) + return "exclude_workflows: array expected"; + for (let i = 0; i < message.exclude_workflows.length; ++i) + if (!$util.isString(message.exclude_workflows[i])) + return "exclude_workflows: string[] expected"; + } + if (message.exclude_states != null && message.hasOwnProperty("exclude_states")) { + if (!Array.isArray(message.exclude_states)) + return "exclude_states: array expected"; + for (let i = 0; i < message.exclude_states.length; ++i) + switch (message.exclude_states[i]) { + default: + return "exclude_states: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + } + if (message.exclude_frozen != null && message.hasOwnProperty("exclude_frozen")) + if (typeof message.exclude_frozen !== "boolean") + return "exclude_frozen: boolean expected"; + return null; + }; - /** - * Decodes a Stream message from the specified reader or buffer. - * @function decode - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream} Stream - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Stream.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.tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.id = reader.int32(); - break; - } - case 2: { - message.bls = $root.binlogdata.BinlogSource.decode(reader, reader.uint32()); - break; - } - case 3: { - message.pos = reader.string(); - break; - } - case 4: { - message.stop_pos = reader.string(); - break; - } - case 5: { - message.max_tps = reader.int64(); - break; - } - case 6: { - message.max_replication_lag = reader.int64(); - break; - } - case 7: { - message.time_updated = $root.vttime.Time.decode(reader, reader.uint32()); - break; - } - case 8: { - message.transaction_timestamp = $root.vttime.Time.decode(reader, reader.uint32()); - break; - } - case 9: { - message.state = reader.int32(); - break; - } - case 10: { - message.message = reader.string(); - break; - } - case 11: { - message.rows_copied = reader.int64(); - break; - } - case 12: { - message.time_heartbeat = $root.vttime.Time.decode(reader, reader.uint32()); - break; - } - case 13: { - message.time_throttled = $root.vttime.Time.decode(reader, reader.uint32()); + /** + * Creates a ReadVReplicationWorkflowsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @static + * @param {Object.} object Plain object + * @returns {tabletmanagerdata.ReadVReplicationWorkflowsRequest} ReadVReplicationWorkflowsRequest + */ + ReadVReplicationWorkflowsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.ReadVReplicationWorkflowsRequest) + return object; + let message = new $root.tabletmanagerdata.ReadVReplicationWorkflowsRequest(); + if (object.include_ids) { + if (!Array.isArray(object.include_ids)) + throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowsRequest.include_ids: array expected"); + message.include_ids = []; + for (let i = 0; i < object.include_ids.length; ++i) + message.include_ids[i] = object.include_ids[i] | 0; + } + if (object.include_workflows) { + if (!Array.isArray(object.include_workflows)) + throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowsRequest.include_workflows: array expected"); + message.include_workflows = []; + for (let i = 0; i < object.include_workflows.length; ++i) + message.include_workflows[i] = String(object.include_workflows[i]); + } + if (object.include_states) { + if (!Array.isArray(object.include_states)) + throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowsRequest.include_states: array expected"); + message.include_states = []; + for (let i = 0; i < object.include_states.length; ++i) + switch (object.include_states[i]) { + default: + if (typeof object.include_states[i] === "number") { + message.include_states[i] = object.include_states[i]; break; } - case 14: { - message.component_throttled = reader.string(); + case "Unknown": + case 0: + message.include_states[i] = 0; + break; + case "Init": + case 1: + message.include_states[i] = 1; + break; + case "Stopped": + case 2: + message.include_states[i] = 2; + break; + case "Copying": + case 3: + message.include_states[i] = 3; + break; + case "Running": + case 4: + message.include_states[i] = 4; + break; + case "Error": + case 5: + message.include_states[i] = 5; + break; + case "Lagging": + case 6: + message.include_states[i] = 6; + break; + } + } + if (object.exclude_workflows) { + if (!Array.isArray(object.exclude_workflows)) + throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowsRequest.exclude_workflows: array expected"); + message.exclude_workflows = []; + for (let i = 0; i < object.exclude_workflows.length; ++i) + message.exclude_workflows[i] = String(object.exclude_workflows[i]); + } + if (object.exclude_states) { + if (!Array.isArray(object.exclude_states)) + throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowsRequest.exclude_states: array expected"); + message.exclude_states = []; + for (let i = 0; i < object.exclude_states.length; ++i) + switch (object.exclude_states[i]) { + default: + if (typeof object.exclude_states[i] === "number") { + message.exclude_states[i] = object.exclude_states[i]; break; } - default: - reader.skipType(tag & 7); + case "Unknown": + case 0: + message.exclude_states[i] = 0; break; - } - } - return message; - }; - - /** - * Decodes a Stream message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream} Stream - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Stream.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Stream message. - * @function verify - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Stream.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isInteger(message.id)) - return "id: integer expected"; - if (message.bls != null && message.hasOwnProperty("bls")) { - let error = $root.binlogdata.BinlogSource.verify(message.bls); - if (error) - return "bls." + error; - } - if (message.pos != null && message.hasOwnProperty("pos")) - if (!$util.isString(message.pos)) - return "pos: string expected"; - if (message.stop_pos != null && message.hasOwnProperty("stop_pos")) - if (!$util.isString(message.stop_pos)) - return "stop_pos: string expected"; - if (message.max_tps != null && message.hasOwnProperty("max_tps")) - if (!$util.isInteger(message.max_tps) && !(message.max_tps && $util.isInteger(message.max_tps.low) && $util.isInteger(message.max_tps.high))) - return "max_tps: integer|Long expected"; - if (message.max_replication_lag != null && message.hasOwnProperty("max_replication_lag")) - if (!$util.isInteger(message.max_replication_lag) && !(message.max_replication_lag && $util.isInteger(message.max_replication_lag.low) && $util.isInteger(message.max_replication_lag.high))) - return "max_replication_lag: integer|Long expected"; - if (message.time_updated != null && message.hasOwnProperty("time_updated")) { - let error = $root.vttime.Time.verify(message.time_updated); - if (error) - return "time_updated." + error; - } - if (message.transaction_timestamp != null && message.hasOwnProperty("transaction_timestamp")) { - let error = $root.vttime.Time.verify(message.transaction_timestamp); - if (error) - return "transaction_timestamp." + error; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: + case "Init": case 1: + message.exclude_states[i] = 1; + break; + case "Stopped": case 2: + message.exclude_states[i] = 2; + break; + case "Copying": case 3: + message.exclude_states[i] = 3; + break; + case "Running": case 4: + message.exclude_states[i] = 4; + break; + case "Error": case 5: + message.exclude_states[i] = 5; + break; + case "Lagging": case 6: + message.exclude_states[i] = 6; break; } - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.rows_copied != null && message.hasOwnProperty("rows_copied")) - if (!$util.isInteger(message.rows_copied) && !(message.rows_copied && $util.isInteger(message.rows_copied.low) && $util.isInteger(message.rows_copied.high))) - return "rows_copied: integer|Long expected"; - if (message.time_heartbeat != null && message.hasOwnProperty("time_heartbeat")) { - let error = $root.vttime.Time.verify(message.time_heartbeat); - if (error) - return "time_heartbeat." + error; + } + if (object.exclude_frozen != null) + message.exclude_frozen = Boolean(object.exclude_frozen); + return message; + }; + + /** + * Creates a plain object from a ReadVReplicationWorkflowsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @static + * @param {tabletmanagerdata.ReadVReplicationWorkflowsRequest} message ReadVReplicationWorkflowsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadVReplicationWorkflowsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.include_ids = []; + object.include_workflows = []; + object.include_states = []; + object.exclude_workflows = []; + object.exclude_states = []; + } + if (options.defaults) + object.exclude_frozen = false; + if (message.include_ids && message.include_ids.length) { + object.include_ids = []; + for (let j = 0; j < message.include_ids.length; ++j) + object.include_ids[j] = message.include_ids[j]; + } + if (message.include_workflows && message.include_workflows.length) { + object.include_workflows = []; + for (let j = 0; j < message.include_workflows.length; ++j) + object.include_workflows[j] = message.include_workflows[j]; + } + if (message.include_states && message.include_states.length) { + object.include_states = []; + for (let j = 0; j < message.include_states.length; ++j) + object.include_states[j] = options.enums === String ? $root.binlogdata.VReplicationWorkflowState[message.include_states[j]] === undefined ? message.include_states[j] : $root.binlogdata.VReplicationWorkflowState[message.include_states[j]] : message.include_states[j]; + } + if (message.exclude_workflows && message.exclude_workflows.length) { + object.exclude_workflows = []; + for (let j = 0; j < message.exclude_workflows.length; ++j) + object.exclude_workflows[j] = message.exclude_workflows[j]; + } + if (message.exclude_states && message.exclude_states.length) { + object.exclude_states = []; + for (let j = 0; j < message.exclude_states.length; ++j) + object.exclude_states[j] = options.enums === String ? $root.binlogdata.VReplicationWorkflowState[message.exclude_states[j]] === undefined ? message.exclude_states[j] : $root.binlogdata.VReplicationWorkflowState[message.exclude_states[j]] : message.exclude_states[j]; + } + if (message.exclude_frozen != null && message.hasOwnProperty("exclude_frozen")) + object.exclude_frozen = message.exclude_frozen; + return object; + }; + + /** + * Converts this ReadVReplicationWorkflowsRequest to JSON. + * @function toJSON + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @instance + * @returns {Object.} JSON object + */ + ReadVReplicationWorkflowsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadVReplicationWorkflowsRequest + * @function getTypeUrl + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadVReplicationWorkflowsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/tabletmanagerdata.ReadVReplicationWorkflowsRequest"; + }; + + return ReadVReplicationWorkflowsRequest; + })(); + + tabletmanagerdata.ReadVReplicationWorkflowsResponse = (function() { + + /** + * Properties of a ReadVReplicationWorkflowsResponse. + * @memberof tabletmanagerdata + * @interface IReadVReplicationWorkflowsResponse + * @property {Array.|null} [workflows] ReadVReplicationWorkflowsResponse workflows + */ + + /** + * Constructs a new ReadVReplicationWorkflowsResponse. + * @memberof tabletmanagerdata + * @classdesc Represents a ReadVReplicationWorkflowsResponse. + * @implements IReadVReplicationWorkflowsResponse + * @constructor + * @param {tabletmanagerdata.IReadVReplicationWorkflowsResponse=} [properties] Properties to set + */ + function ReadVReplicationWorkflowsResponse(properties) { + this.workflows = []; + 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]]; + } + + /** + * ReadVReplicationWorkflowsResponse workflows. + * @member {Array.} workflows + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsResponse + * @instance + */ + ReadVReplicationWorkflowsResponse.prototype.workflows = $util.emptyArray; + + /** + * Creates a new ReadVReplicationWorkflowsResponse instance using the specified properties. + * @function create + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsResponse + * @static + * @param {tabletmanagerdata.IReadVReplicationWorkflowsResponse=} [properties] Properties to set + * @returns {tabletmanagerdata.ReadVReplicationWorkflowsResponse} ReadVReplicationWorkflowsResponse instance + */ + ReadVReplicationWorkflowsResponse.create = function create(properties) { + return new ReadVReplicationWorkflowsResponse(properties); + }; + + /** + * Encodes the specified ReadVReplicationWorkflowsResponse message. Does not implicitly {@link tabletmanagerdata.ReadVReplicationWorkflowsResponse.verify|verify} messages. + * @function encode + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsResponse + * @static + * @param {tabletmanagerdata.IReadVReplicationWorkflowsResponse} message ReadVReplicationWorkflowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadVReplicationWorkflowsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workflows != null && message.workflows.length) + for (let i = 0; i < message.workflows.length; ++i) + $root.tabletmanagerdata.ReadVReplicationWorkflowResponse.encode(message.workflows[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadVReplicationWorkflowsResponse message, length delimited. Does not implicitly {@link tabletmanagerdata.ReadVReplicationWorkflowsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsResponse + * @static + * @param {tabletmanagerdata.IReadVReplicationWorkflowsResponse} message ReadVReplicationWorkflowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadVReplicationWorkflowsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadVReplicationWorkflowsResponse message from the specified reader or buffer. + * @function decode + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tabletmanagerdata.ReadVReplicationWorkflowsResponse} ReadVReplicationWorkflowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadVReplicationWorkflowsResponse.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.tabletmanagerdata.ReadVReplicationWorkflowsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.workflows && message.workflows.length)) + message.workflows = []; + message.workflows.push($root.tabletmanagerdata.ReadVReplicationWorkflowResponse.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; } - if (message.time_throttled != null && message.hasOwnProperty("time_throttled")) { - let error = $root.vttime.Time.verify(message.time_throttled); + } + return message; + }; + + /** + * Decodes a ReadVReplicationWorkflowsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tabletmanagerdata.ReadVReplicationWorkflowsResponse} ReadVReplicationWorkflowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadVReplicationWorkflowsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadVReplicationWorkflowsResponse message. + * @function verify + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadVReplicationWorkflowsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workflows != null && message.hasOwnProperty("workflows")) { + if (!Array.isArray(message.workflows)) + return "workflows: array expected"; + for (let i = 0; i < message.workflows.length; ++i) { + let error = $root.tabletmanagerdata.ReadVReplicationWorkflowResponse.verify(message.workflows[i]); if (error) - return "time_throttled." + error; + return "workflows." + error; } - if (message.component_throttled != null && message.hasOwnProperty("component_throttled")) - if (!$util.isString(message.component_throttled)) - return "component_throttled: string expected"; - return null; - }; + } + return null; + }; - /** - * Creates a Stream message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @static - * @param {Object.} object Plain object - * @returns {tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream} Stream - */ - Stream.fromObject = function fromObject(object) { - if (object instanceof $root.tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream) - return object; - let message = new $root.tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream(); - if (object.id != null) - message.id = object.id | 0; - if (object.bls != null) { - if (typeof object.bls !== "object") - throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.bls: object expected"); - message.bls = $root.binlogdata.BinlogSource.fromObject(object.bls); + /** + * Creates a ReadVReplicationWorkflowsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsResponse + * @static + * @param {Object.} object Plain object + * @returns {tabletmanagerdata.ReadVReplicationWorkflowsResponse} ReadVReplicationWorkflowsResponse + */ + ReadVReplicationWorkflowsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.ReadVReplicationWorkflowsResponse) + return object; + let message = new $root.tabletmanagerdata.ReadVReplicationWorkflowsResponse(); + if (object.workflows) { + if (!Array.isArray(object.workflows)) + throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowsResponse.workflows: array expected"); + message.workflows = []; + for (let i = 0; i < object.workflows.length; ++i) { + if (typeof object.workflows[i] !== "object") + throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowsResponse.workflows: object expected"); + message.workflows[i] = $root.tabletmanagerdata.ReadVReplicationWorkflowResponse.fromObject(object.workflows[i]); } - if (object.pos != null) - message.pos = String(object.pos); - if (object.stop_pos != null) - message.stop_pos = String(object.stop_pos); - if (object.max_tps != null) - if ($util.Long) - (message.max_tps = $util.Long.fromValue(object.max_tps)).unsigned = false; - else if (typeof object.max_tps === "string") - message.max_tps = parseInt(object.max_tps, 10); - else if (typeof object.max_tps === "number") - message.max_tps = object.max_tps; - else if (typeof object.max_tps === "object") - message.max_tps = new $util.LongBits(object.max_tps.low >>> 0, object.max_tps.high >>> 0).toNumber(); - if (object.max_replication_lag != null) - if ($util.Long) - (message.max_replication_lag = $util.Long.fromValue(object.max_replication_lag)).unsigned = false; - else if (typeof object.max_replication_lag === "string") - message.max_replication_lag = parseInt(object.max_replication_lag, 10); - else if (typeof object.max_replication_lag === "number") - message.max_replication_lag = object.max_replication_lag; - else if (typeof object.max_replication_lag === "object") - message.max_replication_lag = new $util.LongBits(object.max_replication_lag.low >>> 0, object.max_replication_lag.high >>> 0).toNumber(); - if (object.time_updated != null) { - if (typeof object.time_updated !== "object") - throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_updated: object expected"); - message.time_updated = $root.vttime.Time.fromObject(object.time_updated); - } - if (object.transaction_timestamp != null) { - if (typeof object.transaction_timestamp !== "object") - throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.transaction_timestamp: object expected"); - message.transaction_timestamp = $root.vttime.Time.fromObject(object.transaction_timestamp); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; + } + return message; + }; + + /** + * Creates a plain object from a ReadVReplicationWorkflowsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsResponse + * @static + * @param {tabletmanagerdata.ReadVReplicationWorkflowsResponse} message ReadVReplicationWorkflowsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadVReplicationWorkflowsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.workflows = []; + if (message.workflows && message.workflows.length) { + object.workflows = []; + for (let j = 0; j < message.workflows.length; ++j) + object.workflows[j] = $root.tabletmanagerdata.ReadVReplicationWorkflowResponse.toObject(message.workflows[j], options); + } + return object; + }; + + /** + * Converts this ReadVReplicationWorkflowsResponse to JSON. + * @function toJSON + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsResponse + * @instance + * @returns {Object.} JSON object + */ + ReadVReplicationWorkflowsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadVReplicationWorkflowsResponse + * @function getTypeUrl + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadVReplicationWorkflowsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/tabletmanagerdata.ReadVReplicationWorkflowsResponse"; + }; + + return ReadVReplicationWorkflowsResponse; + })(); + + tabletmanagerdata.ReadVReplicationWorkflowRequest = (function() { + + /** + * Properties of a ReadVReplicationWorkflowRequest. + * @memberof tabletmanagerdata + * @interface IReadVReplicationWorkflowRequest + * @property {string|null} [workflow] ReadVReplicationWorkflowRequest workflow + */ + + /** + * Constructs a new ReadVReplicationWorkflowRequest. + * @memberof tabletmanagerdata + * @classdesc Represents a ReadVReplicationWorkflowRequest. + * @implements IReadVReplicationWorkflowRequest + * @constructor + * @param {tabletmanagerdata.IReadVReplicationWorkflowRequest=} [properties] Properties to set + */ + function ReadVReplicationWorkflowRequest(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]]; + } + + /** + * ReadVReplicationWorkflowRequest workflow. + * @member {string} workflow + * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest + * @instance + */ + ReadVReplicationWorkflowRequest.prototype.workflow = ""; + + /** + * Creates a new ReadVReplicationWorkflowRequest instance using the specified properties. + * @function create + * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest + * @static + * @param {tabletmanagerdata.IReadVReplicationWorkflowRequest=} [properties] Properties to set + * @returns {tabletmanagerdata.ReadVReplicationWorkflowRequest} ReadVReplicationWorkflowRequest instance + */ + ReadVReplicationWorkflowRequest.create = function create(properties) { + return new ReadVReplicationWorkflowRequest(properties); + }; + + /** + * Encodes the specified ReadVReplicationWorkflowRequest message. Does not implicitly {@link tabletmanagerdata.ReadVReplicationWorkflowRequest.verify|verify} messages. + * @function encode + * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest + * @static + * @param {tabletmanagerdata.IReadVReplicationWorkflowRequest} message ReadVReplicationWorkflowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadVReplicationWorkflowRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workflow != null && Object.hasOwnProperty.call(message, "workflow")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.workflow); + return writer; + }; + + /** + * Encodes the specified ReadVReplicationWorkflowRequest message, length delimited. Does not implicitly {@link tabletmanagerdata.ReadVReplicationWorkflowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest + * @static + * @param {tabletmanagerdata.IReadVReplicationWorkflowRequest} message ReadVReplicationWorkflowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadVReplicationWorkflowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadVReplicationWorkflowRequest message from the specified reader or buffer. + * @function decode + * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tabletmanagerdata.ReadVReplicationWorkflowRequest} ReadVReplicationWorkflowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadVReplicationWorkflowRequest.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.tabletmanagerdata.ReadVReplicationWorkflowRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.workflow = reader.string(); break; } + default: + reader.skipType(tag & 7); break; - case "Unknown": - case 0: - message.state = 0; - break; - case "Init": - case 1: - message.state = 1; - break; - case "Stopped": - case 2: - message.state = 2; - break; - case "Copying": - case 3: - message.state = 3; - break; - case "Running": - case 4: - message.state = 4; - break; - case "Error": - case 5: - message.state = 5; - break; - case "Lagging": - case 6: - message.state = 6; - break; - } - if (object.message != null) - message.message = String(object.message); - if (object.rows_copied != null) - if ($util.Long) - (message.rows_copied = $util.Long.fromValue(object.rows_copied)).unsigned = false; - else if (typeof object.rows_copied === "string") - message.rows_copied = parseInt(object.rows_copied, 10); - else if (typeof object.rows_copied === "number") - message.rows_copied = object.rows_copied; - else if (typeof object.rows_copied === "object") - message.rows_copied = new $util.LongBits(object.rows_copied.low >>> 0, object.rows_copied.high >>> 0).toNumber(); - if (object.time_heartbeat != null) { - if (typeof object.time_heartbeat !== "object") - throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_heartbeat: object expected"); - message.time_heartbeat = $root.vttime.Time.fromObject(object.time_heartbeat); - } - if (object.time_throttled != null) { - if (typeof object.time_throttled !== "object") - throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_throttled: object expected"); - message.time_throttled = $root.vttime.Time.fromObject(object.time_throttled); } - if (object.component_throttled != null) - message.component_throttled = String(object.component_throttled); - return message; - }; + } + return message; + }; - /** - * Creates a plain object from a Stream message. Also converts values to other types if specified. - * @function toObject - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @static - * @param {tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream} message Stream - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Stream.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.id = 0; - object.bls = null; - object.pos = ""; - object.stop_pos = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.max_tps = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.max_tps = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.max_replication_lag = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + /** + * Decodes a ReadVReplicationWorkflowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tabletmanagerdata.ReadVReplicationWorkflowRequest} ReadVReplicationWorkflowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadVReplicationWorkflowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadVReplicationWorkflowRequest message. + * @function verify + * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadVReplicationWorkflowRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workflow != null && message.hasOwnProperty("workflow")) + if (!$util.isString(message.workflow)) + return "workflow: string expected"; + return null; + }; + + /** + * Creates a ReadVReplicationWorkflowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest + * @static + * @param {Object.} object Plain object + * @returns {tabletmanagerdata.ReadVReplicationWorkflowRequest} ReadVReplicationWorkflowRequest + */ + ReadVReplicationWorkflowRequest.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.ReadVReplicationWorkflowRequest) + return object; + let message = new $root.tabletmanagerdata.ReadVReplicationWorkflowRequest(); + if (object.workflow != null) + message.workflow = String(object.workflow); + return message; + }; + + /** + * Creates a plain object from a ReadVReplicationWorkflowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest + * @static + * @param {tabletmanagerdata.ReadVReplicationWorkflowRequest} message ReadVReplicationWorkflowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadVReplicationWorkflowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.workflow = ""; + if (message.workflow != null && message.hasOwnProperty("workflow")) + object.workflow = message.workflow; + return object; + }; + + /** + * Converts this ReadVReplicationWorkflowRequest to JSON. + * @function toJSON + * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest + * @instance + * @returns {Object.} JSON object + */ + ReadVReplicationWorkflowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadVReplicationWorkflowRequest + * @function getTypeUrl + * @memberof tabletmanagerdata.ReadVReplicationWorkflowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadVReplicationWorkflowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/tabletmanagerdata.ReadVReplicationWorkflowRequest"; + }; + + return ReadVReplicationWorkflowRequest; + })(); + + tabletmanagerdata.ReadVReplicationWorkflowResponse = (function() { + + /** + * Properties of a ReadVReplicationWorkflowResponse. + * @memberof tabletmanagerdata + * @interface IReadVReplicationWorkflowResponse + * @property {string|null} [workflow] ReadVReplicationWorkflowResponse workflow + * @property {string|null} [cells] ReadVReplicationWorkflowResponse cells + * @property {Array.|null} [tablet_types] ReadVReplicationWorkflowResponse tablet_types + * @property {tabletmanagerdata.TabletSelectionPreference|null} [tablet_selection_preference] ReadVReplicationWorkflowResponse tablet_selection_preference + * @property {string|null} [db_name] ReadVReplicationWorkflowResponse db_name + * @property {string|null} [tags] ReadVReplicationWorkflowResponse tags + * @property {binlogdata.VReplicationWorkflowType|null} [workflow_type] ReadVReplicationWorkflowResponse workflow_type + * @property {binlogdata.VReplicationWorkflowSubType|null} [workflow_sub_type] ReadVReplicationWorkflowResponse workflow_sub_type + * @property {boolean|null} [defer_secondary_keys] ReadVReplicationWorkflowResponse defer_secondary_keys + * @property {Array.|null} [streams] ReadVReplicationWorkflowResponse streams + */ + + /** + * Constructs a new ReadVReplicationWorkflowResponse. + * @memberof tabletmanagerdata + * @classdesc Represents a ReadVReplicationWorkflowResponse. + * @implements IReadVReplicationWorkflowResponse + * @constructor + * @param {tabletmanagerdata.IReadVReplicationWorkflowResponse=} [properties] Properties to set + */ + function ReadVReplicationWorkflowResponse(properties) { + this.tablet_types = []; + this.streams = []; + 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]]; + } + + /** + * ReadVReplicationWorkflowResponse workflow. + * @member {string} workflow + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @instance + */ + ReadVReplicationWorkflowResponse.prototype.workflow = ""; + + /** + * ReadVReplicationWorkflowResponse cells. + * @member {string} cells + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @instance + */ + ReadVReplicationWorkflowResponse.prototype.cells = ""; + + /** + * ReadVReplicationWorkflowResponse tablet_types. + * @member {Array.} tablet_types + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @instance + */ + ReadVReplicationWorkflowResponse.prototype.tablet_types = $util.emptyArray; + + /** + * ReadVReplicationWorkflowResponse tablet_selection_preference. + * @member {tabletmanagerdata.TabletSelectionPreference} tablet_selection_preference + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @instance + */ + ReadVReplicationWorkflowResponse.prototype.tablet_selection_preference = 0; + + /** + * ReadVReplicationWorkflowResponse db_name. + * @member {string} db_name + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @instance + */ + ReadVReplicationWorkflowResponse.prototype.db_name = ""; + + /** + * ReadVReplicationWorkflowResponse tags. + * @member {string} tags + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @instance + */ + ReadVReplicationWorkflowResponse.prototype.tags = ""; + + /** + * ReadVReplicationWorkflowResponse workflow_type. + * @member {binlogdata.VReplicationWorkflowType} workflow_type + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @instance + */ + ReadVReplicationWorkflowResponse.prototype.workflow_type = 0; + + /** + * ReadVReplicationWorkflowResponse workflow_sub_type. + * @member {binlogdata.VReplicationWorkflowSubType} workflow_sub_type + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @instance + */ + ReadVReplicationWorkflowResponse.prototype.workflow_sub_type = 0; + + /** + * ReadVReplicationWorkflowResponse defer_secondary_keys. + * @member {boolean} defer_secondary_keys + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @instance + */ + ReadVReplicationWorkflowResponse.prototype.defer_secondary_keys = false; + + /** + * ReadVReplicationWorkflowResponse streams. + * @member {Array.} streams + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @instance + */ + ReadVReplicationWorkflowResponse.prototype.streams = $util.emptyArray; + + /** + * Creates a new ReadVReplicationWorkflowResponse instance using the specified properties. + * @function create + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @static + * @param {tabletmanagerdata.IReadVReplicationWorkflowResponse=} [properties] Properties to set + * @returns {tabletmanagerdata.ReadVReplicationWorkflowResponse} ReadVReplicationWorkflowResponse instance + */ + ReadVReplicationWorkflowResponse.create = function create(properties) { + return new ReadVReplicationWorkflowResponse(properties); + }; + + /** + * Encodes the specified ReadVReplicationWorkflowResponse message. Does not implicitly {@link tabletmanagerdata.ReadVReplicationWorkflowResponse.verify|verify} messages. + * @function encode + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @static + * @param {tabletmanagerdata.IReadVReplicationWorkflowResponse} message ReadVReplicationWorkflowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadVReplicationWorkflowResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workflow != null && Object.hasOwnProperty.call(message, "workflow")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.workflow); + if (message.cells != null && Object.hasOwnProperty.call(message, "cells")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.cells); + if (message.tablet_types != null && message.tablet_types.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (let i = 0; i < message.tablet_types.length; ++i) + writer.int32(message.tablet_types[i]); + writer.ldelim(); + } + if (message.tablet_selection_preference != null && Object.hasOwnProperty.call(message, "tablet_selection_preference")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.tablet_selection_preference); + if (message.db_name != null && Object.hasOwnProperty.call(message, "db_name")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.db_name); + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.tags); + if (message.workflow_type != null && Object.hasOwnProperty.call(message, "workflow_type")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.workflow_type); + if (message.workflow_sub_type != null && Object.hasOwnProperty.call(message, "workflow_sub_type")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.workflow_sub_type); + if (message.defer_secondary_keys != null && Object.hasOwnProperty.call(message, "defer_secondary_keys")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.defer_secondary_keys); + if (message.streams != null && message.streams.length) + for (let i = 0; i < message.streams.length; ++i) + $root.tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.encode(message.streams[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadVReplicationWorkflowResponse message, length delimited. Does not implicitly {@link tabletmanagerdata.ReadVReplicationWorkflowResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @static + * @param {tabletmanagerdata.IReadVReplicationWorkflowResponse} message ReadVReplicationWorkflowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadVReplicationWorkflowResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadVReplicationWorkflowResponse message from the specified reader or buffer. + * @function decode + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tabletmanagerdata.ReadVReplicationWorkflowResponse} ReadVReplicationWorkflowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadVReplicationWorkflowResponse.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.tabletmanagerdata.ReadVReplicationWorkflowResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.workflow = reader.string(); + break; + } + case 3: { + message.cells = reader.string(); + break; + } + case 4: { + if (!(message.tablet_types && message.tablet_types.length)) + message.tablet_types = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.tablet_types.push(reader.int32()); + } else + message.tablet_types.push(reader.int32()); + break; + } + case 5: { + message.tablet_selection_preference = reader.int32(); + break; + } + case 6: { + message.db_name = reader.string(); + break; + } + case 7: { + message.tags = reader.string(); + break; + } + case 8: { + message.workflow_type = reader.int32(); + break; + } + case 9: { + message.workflow_sub_type = reader.int32(); + break; + } + case 10: { + message.defer_secondary_keys = reader.bool(); + break; + } + case 11: { + if (!(message.streams && message.streams.length)) + message.streams = []; + message.streams.push($root.tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadVReplicationWorkflowResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tabletmanagerdata.ReadVReplicationWorkflowResponse} ReadVReplicationWorkflowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadVReplicationWorkflowResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadVReplicationWorkflowResponse message. + * @function verify + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadVReplicationWorkflowResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workflow != null && message.hasOwnProperty("workflow")) + if (!$util.isString(message.workflow)) + return "workflow: string expected"; + if (message.cells != null && message.hasOwnProperty("cells")) + if (!$util.isString(message.cells)) + return "cells: string expected"; + if (message.tablet_types != null && message.hasOwnProperty("tablet_types")) { + if (!Array.isArray(message.tablet_types)) + return "tablet_types: array expected"; + for (let i = 0; i < message.tablet_types.length; ++i) + switch (message.tablet_types[i]) { + default: + return "tablet_types: enum value[] expected"; + case 0: + case 1: + case 1: + case 2: + case 3: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message.tablet_selection_preference != null && message.hasOwnProperty("tablet_selection_preference")) + switch (message.tablet_selection_preference) { + default: + return "tablet_selection_preference: enum value expected"; + case 0: + case 1: + case 3: + break; + } + if (message.db_name != null && message.hasOwnProperty("db_name")) + if (!$util.isString(message.db_name)) + return "db_name: string expected"; + if (message.tags != null && message.hasOwnProperty("tags")) + if (!$util.isString(message.tags)) + return "tags: string expected"; + if (message.workflow_type != null && message.hasOwnProperty("workflow_type")) + switch (message.workflow_type) { + default: + return "workflow_type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.workflow_sub_type != null && message.hasOwnProperty("workflow_sub_type")) + switch (message.workflow_sub_type) { + default: + return "workflow_sub_type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defer_secondary_keys != null && message.hasOwnProperty("defer_secondary_keys")) + if (typeof message.defer_secondary_keys !== "boolean") + return "defer_secondary_keys: boolean expected"; + if (message.streams != null && message.hasOwnProperty("streams")) { + if (!Array.isArray(message.streams)) + return "streams: array expected"; + for (let i = 0; i < message.streams.length; ++i) { + let error = $root.tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.verify(message.streams[i]); + if (error) + return "streams." + error; + } + } + return null; + }; + + /** + * Creates a ReadVReplicationWorkflowResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @static + * @param {Object.} object Plain object + * @returns {tabletmanagerdata.ReadVReplicationWorkflowResponse} ReadVReplicationWorkflowResponse + */ + ReadVReplicationWorkflowResponse.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.ReadVReplicationWorkflowResponse) + return object; + let message = new $root.tabletmanagerdata.ReadVReplicationWorkflowResponse(); + if (object.workflow != null) + message.workflow = String(object.workflow); + if (object.cells != null) + message.cells = String(object.cells); + if (object.tablet_types) { + if (!Array.isArray(object.tablet_types)) + throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_types: array expected"); + message.tablet_types = []; + for (let i = 0; i < object.tablet_types.length; ++i) + switch (object.tablet_types[i]) { + default: + if (typeof object.tablet_types[i] === "number") { + message.tablet_types[i] = object.tablet_types[i]; + break; + } + case "UNKNOWN": + case 0: + message.tablet_types[i] = 0; + break; + case "PRIMARY": + case 1: + message.tablet_types[i] = 1; + break; + case "MASTER": + case 1: + message.tablet_types[i] = 1; + break; + case "REPLICA": + case 2: + message.tablet_types[i] = 2; + break; + case "RDONLY": + case 3: + message.tablet_types[i] = 3; + break; + case "BATCH": + case 3: + message.tablet_types[i] = 3; + break; + case "SPARE": + case 4: + message.tablet_types[i] = 4; + break; + case "EXPERIMENTAL": + case 5: + message.tablet_types[i] = 5; + break; + case "BACKUP": + case 6: + message.tablet_types[i] = 6; + break; + case "RESTORE": + case 7: + message.tablet_types[i] = 7; + break; + case "DRAINED": + case 8: + message.tablet_types[i] = 8; + break; + } + } + switch (object.tablet_selection_preference) { + default: + if (typeof object.tablet_selection_preference === "number") { + message.tablet_selection_preference = object.tablet_selection_preference; + break; + } + break; + case "ANY": + case 0: + message.tablet_selection_preference = 0; + break; + case "INORDER": + case 1: + message.tablet_selection_preference = 1; + break; + case "UNKNOWN": + case 3: + message.tablet_selection_preference = 3; + break; + } + if (object.db_name != null) + message.db_name = String(object.db_name); + if (object.tags != null) + message.tags = String(object.tags); + switch (object.workflow_type) { + default: + if (typeof object.workflow_type === "number") { + message.workflow_type = object.workflow_type; + break; + } + break; + case "Materialize": + case 0: + message.workflow_type = 0; + break; + case "MoveTables": + case 1: + message.workflow_type = 1; + break; + case "CreateLookupIndex": + case 2: + message.workflow_type = 2; + break; + case "Migrate": + case 3: + message.workflow_type = 3; + break; + case "Reshard": + case 4: + message.workflow_type = 4; + break; + case "OnlineDDL": + case 5: + message.workflow_type = 5; + break; + } + switch (object.workflow_sub_type) { + default: + if (typeof object.workflow_sub_type === "number") { + message.workflow_sub_type = object.workflow_sub_type; + break; + } + break; + case "None": + case 0: + message.workflow_sub_type = 0; + break; + case "Partial": + case 1: + message.workflow_sub_type = 1; + break; + case "AtomicCopy": + case 2: + message.workflow_sub_type = 2; + break; + } + if (object.defer_secondary_keys != null) + message.defer_secondary_keys = Boolean(object.defer_secondary_keys); + if (object.streams) { + if (!Array.isArray(object.streams)) + throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowResponse.streams: array expected"); + message.streams = []; + for (let i = 0; i < object.streams.length; ++i) { + if (typeof object.streams[i] !== "object") + throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowResponse.streams: object expected"); + message.streams[i] = $root.tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.fromObject(object.streams[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ReadVReplicationWorkflowResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @static + * @param {tabletmanagerdata.ReadVReplicationWorkflowResponse} message ReadVReplicationWorkflowResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadVReplicationWorkflowResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.tablet_types = []; + object.streams = []; + } + if (options.defaults) { + object.workflow = ""; + object.cells = ""; + object.tablet_selection_preference = options.enums === String ? "ANY" : 0; + object.db_name = ""; + object.tags = ""; + object.workflow_type = options.enums === String ? "Materialize" : 0; + object.workflow_sub_type = options.enums === String ? "None" : 0; + object.defer_secondary_keys = false; + } + if (message.workflow != null && message.hasOwnProperty("workflow")) + object.workflow = message.workflow; + if (message.cells != null && message.hasOwnProperty("cells")) + object.cells = message.cells; + if (message.tablet_types && message.tablet_types.length) { + object.tablet_types = []; + for (let j = 0; j < message.tablet_types.length; ++j) + object.tablet_types[j] = options.enums === String ? $root.topodata.TabletType[message.tablet_types[j]] === undefined ? message.tablet_types[j] : $root.topodata.TabletType[message.tablet_types[j]] : message.tablet_types[j]; + } + if (message.tablet_selection_preference != null && message.hasOwnProperty("tablet_selection_preference")) + object.tablet_selection_preference = options.enums === String ? $root.tabletmanagerdata.TabletSelectionPreference[message.tablet_selection_preference] === undefined ? message.tablet_selection_preference : $root.tabletmanagerdata.TabletSelectionPreference[message.tablet_selection_preference] : message.tablet_selection_preference; + if (message.db_name != null && message.hasOwnProperty("db_name")) + object.db_name = message.db_name; + if (message.tags != null && message.hasOwnProperty("tags")) + object.tags = message.tags; + if (message.workflow_type != null && message.hasOwnProperty("workflow_type")) + object.workflow_type = options.enums === String ? $root.binlogdata.VReplicationWorkflowType[message.workflow_type] === undefined ? message.workflow_type : $root.binlogdata.VReplicationWorkflowType[message.workflow_type] : message.workflow_type; + if (message.workflow_sub_type != null && message.hasOwnProperty("workflow_sub_type")) + object.workflow_sub_type = options.enums === String ? $root.binlogdata.VReplicationWorkflowSubType[message.workflow_sub_type] === undefined ? message.workflow_sub_type : $root.binlogdata.VReplicationWorkflowSubType[message.workflow_sub_type] : message.workflow_sub_type; + if (message.defer_secondary_keys != null && message.hasOwnProperty("defer_secondary_keys")) + object.defer_secondary_keys = message.defer_secondary_keys; + if (message.streams && message.streams.length) { + object.streams = []; + for (let j = 0; j < message.streams.length; ++j) + object.streams[j] = $root.tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.toObject(message.streams[j], options); + } + return object; + }; + + /** + * Converts this ReadVReplicationWorkflowResponse to JSON. + * @function toJSON + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @instance + * @returns {Object.} JSON object + */ + ReadVReplicationWorkflowResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadVReplicationWorkflowResponse + * @function getTypeUrl + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadVReplicationWorkflowResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/tabletmanagerdata.ReadVReplicationWorkflowResponse"; + }; + + ReadVReplicationWorkflowResponse.Stream = (function() { + + /** + * Properties of a Stream. + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @interface IStream + * @property {number|null} [id] Stream id + * @property {binlogdata.IBinlogSource|null} [bls] Stream bls + * @property {string|null} [pos] Stream pos + * @property {string|null} [stop_pos] Stream stop_pos + * @property {number|Long|null} [max_tps] Stream max_tps + * @property {number|Long|null} [max_replication_lag] Stream max_replication_lag + * @property {vttime.ITime|null} [time_updated] Stream time_updated + * @property {vttime.ITime|null} [transaction_timestamp] Stream transaction_timestamp + * @property {binlogdata.VReplicationWorkflowState|null} [state] Stream state + * @property {string|null} [message] Stream message + * @property {number|Long|null} [rows_copied] Stream rows_copied + * @property {vttime.ITime|null} [time_heartbeat] Stream time_heartbeat + * @property {vttime.ITime|null} [time_throttled] Stream time_throttled + * @property {string|null} [component_throttled] Stream component_throttled + */ + + /** + * Constructs a new Stream. + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse + * @classdesc Represents a Stream. + * @implements IStream + * @constructor + * @param {tabletmanagerdata.ReadVReplicationWorkflowResponse.IStream=} [properties] Properties to set + */ + function Stream(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]]; + } + + /** + * Stream id. + * @member {number} id + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @instance + */ + Stream.prototype.id = 0; + + /** + * Stream bls. + * @member {binlogdata.IBinlogSource|null|undefined} bls + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @instance + */ + Stream.prototype.bls = null; + + /** + * Stream pos. + * @member {string} pos + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @instance + */ + Stream.prototype.pos = ""; + + /** + * Stream stop_pos. + * @member {string} stop_pos + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @instance + */ + Stream.prototype.stop_pos = ""; + + /** + * Stream max_tps. + * @member {number|Long} max_tps + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @instance + */ + Stream.prototype.max_tps = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Stream max_replication_lag. + * @member {number|Long} max_replication_lag + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @instance + */ + Stream.prototype.max_replication_lag = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Stream time_updated. + * @member {vttime.ITime|null|undefined} time_updated + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @instance + */ + Stream.prototype.time_updated = null; + + /** + * Stream transaction_timestamp. + * @member {vttime.ITime|null|undefined} transaction_timestamp + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @instance + */ + Stream.prototype.transaction_timestamp = null; + + /** + * Stream state. + * @member {binlogdata.VReplicationWorkflowState} state + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @instance + */ + Stream.prototype.state = 0; + + /** + * Stream message. + * @member {string} message + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @instance + */ + Stream.prototype.message = ""; + + /** + * Stream rows_copied. + * @member {number|Long} rows_copied + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @instance + */ + Stream.prototype.rows_copied = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Stream time_heartbeat. + * @member {vttime.ITime|null|undefined} time_heartbeat + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @instance + */ + Stream.prototype.time_heartbeat = null; + + /** + * Stream time_throttled. + * @member {vttime.ITime|null|undefined} time_throttled + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @instance + */ + Stream.prototype.time_throttled = null; + + /** + * Stream component_throttled. + * @member {string} component_throttled + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @instance + */ + Stream.prototype.component_throttled = ""; + + /** + * Creates a new Stream instance using the specified properties. + * @function create + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @static + * @param {tabletmanagerdata.ReadVReplicationWorkflowResponse.IStream=} [properties] Properties to set + * @returns {tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream} Stream instance + */ + Stream.create = function create(properties) { + return new Stream(properties); + }; + + /** + * Encodes the specified Stream message. Does not implicitly {@link tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.verify|verify} messages. + * @function encode + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @static + * @param {tabletmanagerdata.ReadVReplicationWorkflowResponse.IStream} message Stream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stream.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id); + if (message.bls != null && Object.hasOwnProperty.call(message, "bls")) + $root.binlogdata.BinlogSource.encode(message.bls, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.pos != null && Object.hasOwnProperty.call(message, "pos")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pos); + if (message.stop_pos != null && Object.hasOwnProperty.call(message, "stop_pos")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.stop_pos); + if (message.max_tps != null && Object.hasOwnProperty.call(message, "max_tps")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.max_tps); + if (message.max_replication_lag != null && Object.hasOwnProperty.call(message, "max_replication_lag")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.max_replication_lag); + if (message.time_updated != null && Object.hasOwnProperty.call(message, "time_updated")) + $root.vttime.Time.encode(message.time_updated, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.transaction_timestamp != null && Object.hasOwnProperty.call(message, "transaction_timestamp")) + $root.vttime.Time.encode(message.transaction_timestamp, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.state); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.message); + if (message.rows_copied != null && Object.hasOwnProperty.call(message, "rows_copied")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.rows_copied); + if (message.time_heartbeat != null && Object.hasOwnProperty.call(message, "time_heartbeat")) + $root.vttime.Time.encode(message.time_heartbeat, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.time_throttled != null && Object.hasOwnProperty.call(message, "time_throttled")) + $root.vttime.Time.encode(message.time_throttled, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.component_throttled != null && Object.hasOwnProperty.call(message, "component_throttled")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.component_throttled); + return writer; + }; + + /** + * Encodes the specified Stream message, length delimited. Does not implicitly {@link tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.verify|verify} messages. + * @function encodeDelimited + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @static + * @param {tabletmanagerdata.ReadVReplicationWorkflowResponse.IStream} message Stream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stream.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Stream message from the specified reader or buffer. + * @function decode + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream} Stream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stream.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.tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.int32(); + break; + } + case 2: { + message.bls = $root.binlogdata.BinlogSource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.pos = reader.string(); + break; + } + case 4: { + message.stop_pos = reader.string(); + break; + } + case 5: { + message.max_tps = reader.int64(); + break; + } + case 6: { + message.max_replication_lag = reader.int64(); + break; + } + case 7: { + message.time_updated = $root.vttime.Time.decode(reader, reader.uint32()); + break; + } + case 8: { + message.transaction_timestamp = $root.vttime.Time.decode(reader, reader.uint32()); + break; + } + case 9: { + message.state = reader.int32(); + break; + } + case 10: { + message.message = reader.string(); + break; + } + case 11: { + message.rows_copied = reader.int64(); + break; + } + case 12: { + message.time_heartbeat = $root.vttime.Time.decode(reader, reader.uint32()); + break; + } + case 13: { + message.time_throttled = $root.vttime.Time.decode(reader, reader.uint32()); + break; + } + case 14: { + message.component_throttled = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Stream message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream} Stream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stream.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Stream message. + * @function verify + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Stream.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isInteger(message.id)) + return "id: integer expected"; + if (message.bls != null && message.hasOwnProperty("bls")) { + let error = $root.binlogdata.BinlogSource.verify(message.bls); + if (error) + return "bls." + error; + } + if (message.pos != null && message.hasOwnProperty("pos")) + if (!$util.isString(message.pos)) + return "pos: string expected"; + if (message.stop_pos != null && message.hasOwnProperty("stop_pos")) + if (!$util.isString(message.stop_pos)) + return "stop_pos: string expected"; + if (message.max_tps != null && message.hasOwnProperty("max_tps")) + if (!$util.isInteger(message.max_tps) && !(message.max_tps && $util.isInteger(message.max_tps.low) && $util.isInteger(message.max_tps.high))) + return "max_tps: integer|Long expected"; + if (message.max_replication_lag != null && message.hasOwnProperty("max_replication_lag")) + if (!$util.isInteger(message.max_replication_lag) && !(message.max_replication_lag && $util.isInteger(message.max_replication_lag.low) && $util.isInteger(message.max_replication_lag.high))) + return "max_replication_lag: integer|Long expected"; + if (message.time_updated != null && message.hasOwnProperty("time_updated")) { + let error = $root.vttime.Time.verify(message.time_updated); + if (error) + return "time_updated." + error; + } + if (message.transaction_timestamp != null && message.hasOwnProperty("transaction_timestamp")) { + let error = $root.vttime.Time.verify(message.transaction_timestamp); + if (error) + return "transaction_timestamp." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.rows_copied != null && message.hasOwnProperty("rows_copied")) + if (!$util.isInteger(message.rows_copied) && !(message.rows_copied && $util.isInteger(message.rows_copied.low) && $util.isInteger(message.rows_copied.high))) + return "rows_copied: integer|Long expected"; + if (message.time_heartbeat != null && message.hasOwnProperty("time_heartbeat")) { + let error = $root.vttime.Time.verify(message.time_heartbeat); + if (error) + return "time_heartbeat." + error; + } + if (message.time_throttled != null && message.hasOwnProperty("time_throttled")) { + let error = $root.vttime.Time.verify(message.time_throttled); + if (error) + return "time_throttled." + error; + } + if (message.component_throttled != null && message.hasOwnProperty("component_throttled")) + if (!$util.isString(message.component_throttled)) + return "component_throttled: string expected"; + return null; + }; + + /** + * Creates a Stream message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @static + * @param {Object.} object Plain object + * @returns {tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream} Stream + */ + Stream.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream) + return object; + let message = new $root.tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream(); + if (object.id != null) + message.id = object.id | 0; + if (object.bls != null) { + if (typeof object.bls !== "object") + throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.bls: object expected"); + message.bls = $root.binlogdata.BinlogSource.fromObject(object.bls); + } + if (object.pos != null) + message.pos = String(object.pos); + if (object.stop_pos != null) + message.stop_pos = String(object.stop_pos); + if (object.max_tps != null) + if ($util.Long) + (message.max_tps = $util.Long.fromValue(object.max_tps)).unsigned = false; + else if (typeof object.max_tps === "string") + message.max_tps = parseInt(object.max_tps, 10); + else if (typeof object.max_tps === "number") + message.max_tps = object.max_tps; + else if (typeof object.max_tps === "object") + message.max_tps = new $util.LongBits(object.max_tps.low >>> 0, object.max_tps.high >>> 0).toNumber(); + if (object.max_replication_lag != null) + if ($util.Long) + (message.max_replication_lag = $util.Long.fromValue(object.max_replication_lag)).unsigned = false; + else if (typeof object.max_replication_lag === "string") + message.max_replication_lag = parseInt(object.max_replication_lag, 10); + else if (typeof object.max_replication_lag === "number") + message.max_replication_lag = object.max_replication_lag; + else if (typeof object.max_replication_lag === "object") + message.max_replication_lag = new $util.LongBits(object.max_replication_lag.low >>> 0, object.max_replication_lag.high >>> 0).toNumber(); + if (object.time_updated != null) { + if (typeof object.time_updated !== "object") + throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_updated: object expected"); + message.time_updated = $root.vttime.Time.fromObject(object.time_updated); + } + if (object.transaction_timestamp != null) { + if (typeof object.transaction_timestamp !== "object") + throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.transaction_timestamp: object expected"); + message.transaction_timestamp = $root.vttime.Time.fromObject(object.transaction_timestamp); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "Unknown": + case 0: + message.state = 0; + break; + case "Init": + case 1: + message.state = 1; + break; + case "Stopped": + case 2: + message.state = 2; + break; + case "Copying": + case 3: + message.state = 3; + break; + case "Running": + case 4: + message.state = 4; + break; + case "Error": + case 5: + message.state = 5; + break; + case "Lagging": + case 6: + message.state = 6; + break; + } + if (object.message != null) + message.message = String(object.message); + if (object.rows_copied != null) + if ($util.Long) + (message.rows_copied = $util.Long.fromValue(object.rows_copied)).unsigned = false; + else if (typeof object.rows_copied === "string") + message.rows_copied = parseInt(object.rows_copied, 10); + else if (typeof object.rows_copied === "number") + message.rows_copied = object.rows_copied; + else if (typeof object.rows_copied === "object") + message.rows_copied = new $util.LongBits(object.rows_copied.low >>> 0, object.rows_copied.high >>> 0).toNumber(); + if (object.time_heartbeat != null) { + if (typeof object.time_heartbeat !== "object") + throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_heartbeat: object expected"); + message.time_heartbeat = $root.vttime.Time.fromObject(object.time_heartbeat); + } + if (object.time_throttled != null) { + if (typeof object.time_throttled !== "object") + throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_throttled: object expected"); + message.time_throttled = $root.vttime.Time.fromObject(object.time_throttled); + } + if (object.component_throttled != null) + message.component_throttled = String(object.component_throttled); + return message; + }; + + /** + * Creates a plain object from a Stream message. Also converts values to other types if specified. + * @function toObject + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @static + * @param {tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream} message Stream + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Stream.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.id = 0; + object.bls = null; + object.pos = ""; + object.stop_pos = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.max_tps = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.max_tps = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.max_replication_lag = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.max_replication_lag = options.longs === String ? "0" : 0; object.time_updated = null; @@ -64788,63 +65902,653 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { if (message.component_throttled != null && message.hasOwnProperty("component_throttled")) object.component_throttled = message.component_throttled; return object; - }; + }; + + /** + * Converts this Stream to JSON. + * @function toJSON + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @instance + * @returns {Object.} JSON object + */ + Stream.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Stream + * @function getTypeUrl + * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Stream.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream"; + }; + + return Stream; + })(); + + return ReadVReplicationWorkflowResponse; + })(); + + tabletmanagerdata.VDiffRequest = (function() { + + /** + * Properties of a VDiffRequest. + * @memberof tabletmanagerdata + * @interface IVDiffRequest + * @property {string|null} [keyspace] VDiffRequest keyspace + * @property {string|null} [workflow] VDiffRequest workflow + * @property {string|null} [action] VDiffRequest action + * @property {string|null} [action_arg] VDiffRequest action_arg + * @property {string|null} [vdiff_uuid] VDiffRequest vdiff_uuid + * @property {tabletmanagerdata.IVDiffOptions|null} [options] VDiffRequest options + */ + + /** + * Constructs a new VDiffRequest. + * @memberof tabletmanagerdata + * @classdesc Represents a VDiffRequest. + * @implements IVDiffRequest + * @constructor + * @param {tabletmanagerdata.IVDiffRequest=} [properties] Properties to set + */ + function VDiffRequest(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]]; + } + + /** + * VDiffRequest keyspace. + * @member {string} keyspace + * @memberof tabletmanagerdata.VDiffRequest + * @instance + */ + VDiffRequest.prototype.keyspace = ""; + + /** + * VDiffRequest workflow. + * @member {string} workflow + * @memberof tabletmanagerdata.VDiffRequest + * @instance + */ + VDiffRequest.prototype.workflow = ""; + + /** + * VDiffRequest action. + * @member {string} action + * @memberof tabletmanagerdata.VDiffRequest + * @instance + */ + VDiffRequest.prototype.action = ""; + + /** + * VDiffRequest action_arg. + * @member {string} action_arg + * @memberof tabletmanagerdata.VDiffRequest + * @instance + */ + VDiffRequest.prototype.action_arg = ""; + + /** + * VDiffRequest vdiff_uuid. + * @member {string} vdiff_uuid + * @memberof tabletmanagerdata.VDiffRequest + * @instance + */ + VDiffRequest.prototype.vdiff_uuid = ""; + + /** + * VDiffRequest options. + * @member {tabletmanagerdata.IVDiffOptions|null|undefined} options + * @memberof tabletmanagerdata.VDiffRequest + * @instance + */ + VDiffRequest.prototype.options = null; + + /** + * Creates a new VDiffRequest instance using the specified properties. + * @function create + * @memberof tabletmanagerdata.VDiffRequest + * @static + * @param {tabletmanagerdata.IVDiffRequest=} [properties] Properties to set + * @returns {tabletmanagerdata.VDiffRequest} VDiffRequest instance + */ + VDiffRequest.create = function create(properties) { + return new VDiffRequest(properties); + }; + + /** + * Encodes the specified VDiffRequest message. Does not implicitly {@link tabletmanagerdata.VDiffRequest.verify|verify} messages. + * @function encode + * @memberof tabletmanagerdata.VDiffRequest + * @static + * @param {tabletmanagerdata.IVDiffRequest} message VDiffRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VDiffRequest.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.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.action); + if (message.action_arg != null && Object.hasOwnProperty.call(message, "action_arg")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.action_arg); + if (message.vdiff_uuid != null && Object.hasOwnProperty.call(message, "vdiff_uuid")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.vdiff_uuid); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.tabletmanagerdata.VDiffOptions.encode(message.options, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VDiffRequest message, length delimited. Does not implicitly {@link tabletmanagerdata.VDiffRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof tabletmanagerdata.VDiffRequest + * @static + * @param {tabletmanagerdata.IVDiffRequest} message VDiffRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VDiffRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VDiffRequest message from the specified reader or buffer. + * @function decode + * @memberof tabletmanagerdata.VDiffRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tabletmanagerdata.VDiffRequest} VDiffRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VDiffRequest.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.tabletmanagerdata.VDiffRequest(); + 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.action = reader.string(); + break; + } + case 4: { + message.action_arg = reader.string(); + break; + } + case 5: { + message.vdiff_uuid = reader.string(); + break; + } + case 6: { + message.options = $root.tabletmanagerdata.VDiffOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VDiffRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tabletmanagerdata.VDiffRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tabletmanagerdata.VDiffRequest} VDiffRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VDiffRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VDiffRequest message. + * @function verify + * @memberof tabletmanagerdata.VDiffRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VDiffRequest.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.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.action_arg != null && message.hasOwnProperty("action_arg")) + if (!$util.isString(message.action_arg)) + return "action_arg: string expected"; + if (message.vdiff_uuid != null && message.hasOwnProperty("vdiff_uuid")) + if (!$util.isString(message.vdiff_uuid)) + return "vdiff_uuid: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + let error = $root.tabletmanagerdata.VDiffOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a VDiffRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tabletmanagerdata.VDiffRequest + * @static + * @param {Object.} object Plain object + * @returns {tabletmanagerdata.VDiffRequest} VDiffRequest + */ + VDiffRequest.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.VDiffRequest) + return object; + let message = new $root.tabletmanagerdata.VDiffRequest(); + if (object.keyspace != null) + message.keyspace = String(object.keyspace); + if (object.workflow != null) + message.workflow = String(object.workflow); + if (object.action != null) + message.action = String(object.action); + if (object.action_arg != null) + message.action_arg = String(object.action_arg); + if (object.vdiff_uuid != null) + message.vdiff_uuid = String(object.vdiff_uuid); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".tabletmanagerdata.VDiffRequest.options: object expected"); + message.options = $root.tabletmanagerdata.VDiffOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a VDiffRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof tabletmanagerdata.VDiffRequest + * @static + * @param {tabletmanagerdata.VDiffRequest} message VDiffRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VDiffRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.keyspace = ""; + object.workflow = ""; + object.action = ""; + object.action_arg = ""; + object.vdiff_uuid = ""; + object.options = null; + } + if (message.keyspace != null && message.hasOwnProperty("keyspace")) + object.keyspace = message.keyspace; + if (message.workflow != null && message.hasOwnProperty("workflow")) + object.workflow = message.workflow; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.action_arg != null && message.hasOwnProperty("action_arg")) + object.action_arg = message.action_arg; + if (message.vdiff_uuid != null && message.hasOwnProperty("vdiff_uuid")) + object.vdiff_uuid = message.vdiff_uuid; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.tabletmanagerdata.VDiffOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this VDiffRequest to JSON. + * @function toJSON + * @memberof tabletmanagerdata.VDiffRequest + * @instance + * @returns {Object.} JSON object + */ + VDiffRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VDiffRequest + * @function getTypeUrl + * @memberof tabletmanagerdata.VDiffRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VDiffRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/tabletmanagerdata.VDiffRequest"; + }; + + return VDiffRequest; + })(); + + tabletmanagerdata.VDiffResponse = (function() { + + /** + * Properties of a VDiffResponse. + * @memberof tabletmanagerdata + * @interface IVDiffResponse + * @property {number|Long|null} [id] VDiffResponse id + * @property {query.IQueryResult|null} [output] VDiffResponse output + * @property {string|null} [vdiff_uuid] VDiffResponse vdiff_uuid + */ + + /** + * Constructs a new VDiffResponse. + * @memberof tabletmanagerdata + * @classdesc Represents a VDiffResponse. + * @implements IVDiffResponse + * @constructor + * @param {tabletmanagerdata.IVDiffResponse=} [properties] Properties to set + */ + function VDiffResponse(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]]; + } + + /** + * VDiffResponse id. + * @member {number|Long} id + * @memberof tabletmanagerdata.VDiffResponse + * @instance + */ + VDiffResponse.prototype.id = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * VDiffResponse output. + * @member {query.IQueryResult|null|undefined} output + * @memberof tabletmanagerdata.VDiffResponse + * @instance + */ + VDiffResponse.prototype.output = null; + + /** + * VDiffResponse vdiff_uuid. + * @member {string} vdiff_uuid + * @memberof tabletmanagerdata.VDiffResponse + * @instance + */ + VDiffResponse.prototype.vdiff_uuid = ""; + + /** + * Creates a new VDiffResponse instance using the specified properties. + * @function create + * @memberof tabletmanagerdata.VDiffResponse + * @static + * @param {tabletmanagerdata.IVDiffResponse=} [properties] Properties to set + * @returns {tabletmanagerdata.VDiffResponse} VDiffResponse instance + */ + VDiffResponse.create = function create(properties) { + return new VDiffResponse(properties); + }; + + /** + * Encodes the specified VDiffResponse message. Does not implicitly {@link tabletmanagerdata.VDiffResponse.verify|verify} messages. + * @function encode + * @memberof tabletmanagerdata.VDiffResponse + * @static + * @param {tabletmanagerdata.IVDiffResponse} message VDiffResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VDiffResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.id); + if (message.output != null && Object.hasOwnProperty.call(message, "output")) + $root.query.QueryResult.encode(message.output, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.vdiff_uuid != null && Object.hasOwnProperty.call(message, "vdiff_uuid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.vdiff_uuid); + return writer; + }; + + /** + * Encodes the specified VDiffResponse message, length delimited. Does not implicitly {@link tabletmanagerdata.VDiffResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof tabletmanagerdata.VDiffResponse + * @static + * @param {tabletmanagerdata.IVDiffResponse} message VDiffResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VDiffResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VDiffResponse message from the specified reader or buffer. + * @function decode + * @memberof tabletmanagerdata.VDiffResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tabletmanagerdata.VDiffResponse} VDiffResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VDiffResponse.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.tabletmanagerdata.VDiffResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.int64(); + break; + } + case 2: { + message.output = $root.query.QueryResult.decode(reader, reader.uint32()); + break; + } + case 3: { + message.vdiff_uuid = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VDiffResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tabletmanagerdata.VDiffResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tabletmanagerdata.VDiffResponse} VDiffResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VDiffResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VDiffResponse message. + * @function verify + * @memberof tabletmanagerdata.VDiffResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VDiffResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + if (message.output != null && message.hasOwnProperty("output")) { + let error = $root.query.QueryResult.verify(message.output); + if (error) + return "output." + error; + } + if (message.vdiff_uuid != null && message.hasOwnProperty("vdiff_uuid")) + if (!$util.isString(message.vdiff_uuid)) + return "vdiff_uuid: string expected"; + return null; + }; + + /** + * Creates a VDiffResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tabletmanagerdata.VDiffResponse + * @static + * @param {Object.} object Plain object + * @returns {tabletmanagerdata.VDiffResponse} VDiffResponse + */ + VDiffResponse.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.VDiffResponse) + return object; + let message = new $root.tabletmanagerdata.VDiffResponse(); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = false; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(); + if (object.output != null) { + if (typeof object.output !== "object") + throw TypeError(".tabletmanagerdata.VDiffResponse.output: object expected"); + message.output = $root.query.QueryResult.fromObject(object.output); + } + if (object.vdiff_uuid != null) + message.vdiff_uuid = String(object.vdiff_uuid); + return message; + }; - /** - * Converts this Stream to JSON. - * @function toJSON - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @instance - * @returns {Object.} JSON object - */ - Stream.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a VDiffResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof tabletmanagerdata.VDiffResponse + * @static + * @param {tabletmanagerdata.VDiffResponse} message VDiffResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VDiffResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.id = options.longs === String ? "0" : 0; + object.output = null; + object.vdiff_uuid = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber() : message.id; + if (message.output != null && message.hasOwnProperty("output")) + object.output = $root.query.QueryResult.toObject(message.output, options); + if (message.vdiff_uuid != null && message.hasOwnProperty("vdiff_uuid")) + object.vdiff_uuid = message.vdiff_uuid; + return object; + }; - /** - * Gets the default type url for Stream - * @function getTypeUrl - * @memberof tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Stream.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream"; - }; + /** + * Converts this VDiffResponse to JSON. + * @function toJSON + * @memberof tabletmanagerdata.VDiffResponse + * @instance + * @returns {Object.} JSON object + */ + VDiffResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Stream; - })(); + /** + * Gets the default type url for VDiffResponse + * @function getTypeUrl + * @memberof tabletmanagerdata.VDiffResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VDiffResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/tabletmanagerdata.VDiffResponse"; + }; - return ReadVReplicationWorkflowResponse; + return VDiffResponse; })(); - tabletmanagerdata.VDiffRequest = (function() { + tabletmanagerdata.VDiffPickerOptions = (function() { /** - * Properties of a VDiffRequest. + * Properties of a VDiffPickerOptions. * @memberof tabletmanagerdata - * @interface IVDiffRequest - * @property {string|null} [keyspace] VDiffRequest keyspace - * @property {string|null} [workflow] VDiffRequest workflow - * @property {string|null} [action] VDiffRequest action - * @property {string|null} [action_arg] VDiffRequest action_arg - * @property {string|null} [vdiff_uuid] VDiffRequest vdiff_uuid - * @property {tabletmanagerdata.IVDiffOptions|null} [options] VDiffRequest options + * @interface IVDiffPickerOptions + * @property {string|null} [tablet_types] VDiffPickerOptions tablet_types + * @property {string|null} [source_cell] VDiffPickerOptions source_cell + * @property {string|null} [target_cell] VDiffPickerOptions target_cell */ /** - * Constructs a new VDiffRequest. + * Constructs a new VDiffPickerOptions. * @memberof tabletmanagerdata - * @classdesc Represents a VDiffRequest. - * @implements IVDiffRequest + * @classdesc Represents a VDiffPickerOptions. + * @implements IVDiffPickerOptions * @constructor - * @param {tabletmanagerdata.IVDiffRequest=} [properties] Properties to set + * @param {tabletmanagerdata.IVDiffPickerOptions=} [properties] Properties to set */ - function VDiffRequest(properties) { + function VDiffPickerOptions(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -64852,145 +66556,103 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { } /** - * VDiffRequest keyspace. - * @member {string} keyspace - * @memberof tabletmanagerdata.VDiffRequest - * @instance - */ - VDiffRequest.prototype.keyspace = ""; - - /** - * VDiffRequest workflow. - * @member {string} workflow - * @memberof tabletmanagerdata.VDiffRequest - * @instance - */ - VDiffRequest.prototype.workflow = ""; - - /** - * VDiffRequest action. - * @member {string} action - * @memberof tabletmanagerdata.VDiffRequest - * @instance - */ - VDiffRequest.prototype.action = ""; - - /** - * VDiffRequest action_arg. - * @member {string} action_arg - * @memberof tabletmanagerdata.VDiffRequest + * VDiffPickerOptions tablet_types. + * @member {string} tablet_types + * @memberof tabletmanagerdata.VDiffPickerOptions * @instance */ - VDiffRequest.prototype.action_arg = ""; + VDiffPickerOptions.prototype.tablet_types = ""; /** - * VDiffRequest vdiff_uuid. - * @member {string} vdiff_uuid - * @memberof tabletmanagerdata.VDiffRequest + * VDiffPickerOptions source_cell. + * @member {string} source_cell + * @memberof tabletmanagerdata.VDiffPickerOptions * @instance */ - VDiffRequest.prototype.vdiff_uuid = ""; + VDiffPickerOptions.prototype.source_cell = ""; /** - * VDiffRequest options. - * @member {tabletmanagerdata.IVDiffOptions|null|undefined} options - * @memberof tabletmanagerdata.VDiffRequest + * VDiffPickerOptions target_cell. + * @member {string} target_cell + * @memberof tabletmanagerdata.VDiffPickerOptions * @instance */ - VDiffRequest.prototype.options = null; + VDiffPickerOptions.prototype.target_cell = ""; /** - * Creates a new VDiffRequest instance using the specified properties. + * Creates a new VDiffPickerOptions instance using the specified properties. * @function create - * @memberof tabletmanagerdata.VDiffRequest + * @memberof tabletmanagerdata.VDiffPickerOptions * @static - * @param {tabletmanagerdata.IVDiffRequest=} [properties] Properties to set - * @returns {tabletmanagerdata.VDiffRequest} VDiffRequest instance + * @param {tabletmanagerdata.IVDiffPickerOptions=} [properties] Properties to set + * @returns {tabletmanagerdata.VDiffPickerOptions} VDiffPickerOptions instance */ - VDiffRequest.create = function create(properties) { - return new VDiffRequest(properties); + VDiffPickerOptions.create = function create(properties) { + return new VDiffPickerOptions(properties); }; /** - * Encodes the specified VDiffRequest message. Does not implicitly {@link tabletmanagerdata.VDiffRequest.verify|verify} messages. + * Encodes the specified VDiffPickerOptions message. Does not implicitly {@link tabletmanagerdata.VDiffPickerOptions.verify|verify} messages. * @function encode - * @memberof tabletmanagerdata.VDiffRequest + * @memberof tabletmanagerdata.VDiffPickerOptions * @static - * @param {tabletmanagerdata.IVDiffRequest} message VDiffRequest message or plain object to encode + * @param {tabletmanagerdata.IVDiffPickerOptions} message VDiffPickerOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VDiffRequest.encode = function encode(message, writer) { + VDiffPickerOptions.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.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.action); - if (message.action_arg != null && Object.hasOwnProperty.call(message, "action_arg")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.action_arg); - if (message.vdiff_uuid != null && Object.hasOwnProperty.call(message, "vdiff_uuid")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.vdiff_uuid); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.tabletmanagerdata.VDiffOptions.encode(message.options, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.tablet_types != null && Object.hasOwnProperty.call(message, "tablet_types")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tablet_types); + if (message.source_cell != null && Object.hasOwnProperty.call(message, "source_cell")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.source_cell); + if (message.target_cell != null && Object.hasOwnProperty.call(message, "target_cell")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target_cell); return writer; }; /** - * Encodes the specified VDiffRequest message, length delimited. Does not implicitly {@link tabletmanagerdata.VDiffRequest.verify|verify} messages. + * Encodes the specified VDiffPickerOptions message, length delimited. Does not implicitly {@link tabletmanagerdata.VDiffPickerOptions.verify|verify} messages. * @function encodeDelimited - * @memberof tabletmanagerdata.VDiffRequest + * @memberof tabletmanagerdata.VDiffPickerOptions * @static - * @param {tabletmanagerdata.IVDiffRequest} message VDiffRequest message or plain object to encode + * @param {tabletmanagerdata.IVDiffPickerOptions} message VDiffPickerOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VDiffRequest.encodeDelimited = function encodeDelimited(message, writer) { + VDiffPickerOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VDiffRequest message from the specified reader or buffer. + * Decodes a VDiffPickerOptions message from the specified reader or buffer. * @function decode - * @memberof tabletmanagerdata.VDiffRequest + * @memberof tabletmanagerdata.VDiffPickerOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {tabletmanagerdata.VDiffRequest} VDiffRequest + * @returns {tabletmanagerdata.VDiffPickerOptions} VDiffPickerOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VDiffRequest.decode = function decode(reader, length) { + VDiffPickerOptions.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.tabletmanagerdata.VDiffRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tabletmanagerdata.VDiffPickerOptions(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.keyspace = reader.string(); + message.tablet_types = reader.string(); break; } case 2: { - message.workflow = reader.string(); + message.source_cell = reader.string(); break; } case 3: { - message.action = reader.string(); - break; - } - case 4: { - message.action_arg = reader.string(); - break; - } - case 5: { - message.vdiff_uuid = reader.string(); - break; - } - case 6: { - message.options = $root.tabletmanagerdata.VDiffOptions.decode(reader, reader.uint32()); + message.target_cell = reader.string(); break; } default: @@ -65002,170 +66664,142 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { }; /** - * Decodes a VDiffRequest message from the specified reader or buffer, length delimited. + * Decodes a VDiffPickerOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof tabletmanagerdata.VDiffRequest + * @memberof tabletmanagerdata.VDiffPickerOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tabletmanagerdata.VDiffRequest} VDiffRequest + * @returns {tabletmanagerdata.VDiffPickerOptions} VDiffPickerOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VDiffRequest.decodeDelimited = function decodeDelimited(reader) { + VDiffPickerOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VDiffRequest message. + * Verifies a VDiffPickerOptions message. * @function verify - * @memberof tabletmanagerdata.VDiffRequest + * @memberof tabletmanagerdata.VDiffPickerOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VDiffRequest.verify = function verify(message) { + VDiffPickerOptions.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.action != null && message.hasOwnProperty("action")) - if (!$util.isString(message.action)) - return "action: string expected"; - if (message.action_arg != null && message.hasOwnProperty("action_arg")) - if (!$util.isString(message.action_arg)) - return "action_arg: string expected"; - if (message.vdiff_uuid != null && message.hasOwnProperty("vdiff_uuid")) - if (!$util.isString(message.vdiff_uuid)) - return "vdiff_uuid: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - let error = $root.tabletmanagerdata.VDiffOptions.verify(message.options); - if (error) - return "options." + error; - } + if (message.tablet_types != null && message.hasOwnProperty("tablet_types")) + if (!$util.isString(message.tablet_types)) + return "tablet_types: string expected"; + if (message.source_cell != null && message.hasOwnProperty("source_cell")) + if (!$util.isString(message.source_cell)) + return "source_cell: string expected"; + if (message.target_cell != null && message.hasOwnProperty("target_cell")) + if (!$util.isString(message.target_cell)) + return "target_cell: string expected"; return null; }; /** - * Creates a VDiffRequest message from a plain object. Also converts values to their respective internal types. + * Creates a VDiffPickerOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof tabletmanagerdata.VDiffRequest + * @memberof tabletmanagerdata.VDiffPickerOptions * @static * @param {Object.} object Plain object - * @returns {tabletmanagerdata.VDiffRequest} VDiffRequest + * @returns {tabletmanagerdata.VDiffPickerOptions} VDiffPickerOptions */ - VDiffRequest.fromObject = function fromObject(object) { - if (object instanceof $root.tabletmanagerdata.VDiffRequest) + VDiffPickerOptions.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.VDiffPickerOptions) return object; - let message = new $root.tabletmanagerdata.VDiffRequest(); - if (object.keyspace != null) - message.keyspace = String(object.keyspace); - if (object.workflow != null) - message.workflow = String(object.workflow); - if (object.action != null) - message.action = String(object.action); - if (object.action_arg != null) - message.action_arg = String(object.action_arg); - if (object.vdiff_uuid != null) - message.vdiff_uuid = String(object.vdiff_uuid); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".tabletmanagerdata.VDiffRequest.options: object expected"); - message.options = $root.tabletmanagerdata.VDiffOptions.fromObject(object.options); - } + let message = new $root.tabletmanagerdata.VDiffPickerOptions(); + if (object.tablet_types != null) + message.tablet_types = String(object.tablet_types); + if (object.source_cell != null) + message.source_cell = String(object.source_cell); + if (object.target_cell != null) + message.target_cell = String(object.target_cell); return message; }; /** - * Creates a plain object from a VDiffRequest message. Also converts values to other types if specified. + * Creates a plain object from a VDiffPickerOptions message. Also converts values to other types if specified. * @function toObject - * @memberof tabletmanagerdata.VDiffRequest + * @memberof tabletmanagerdata.VDiffPickerOptions * @static - * @param {tabletmanagerdata.VDiffRequest} message VDiffRequest + * @param {tabletmanagerdata.VDiffPickerOptions} message VDiffPickerOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VDiffRequest.toObject = function toObject(message, options) { + VDiffPickerOptions.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; if (options.defaults) { - object.keyspace = ""; - object.workflow = ""; - object.action = ""; - object.action_arg = ""; - object.vdiff_uuid = ""; - object.options = null; + object.tablet_types = ""; + object.source_cell = ""; + object.target_cell = ""; } - if (message.keyspace != null && message.hasOwnProperty("keyspace")) - object.keyspace = message.keyspace; - if (message.workflow != null && message.hasOwnProperty("workflow")) - object.workflow = message.workflow; - if (message.action != null && message.hasOwnProperty("action")) - object.action = message.action; - if (message.action_arg != null && message.hasOwnProperty("action_arg")) - object.action_arg = message.action_arg; - if (message.vdiff_uuid != null && message.hasOwnProperty("vdiff_uuid")) - object.vdiff_uuid = message.vdiff_uuid; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.tabletmanagerdata.VDiffOptions.toObject(message.options, options); + if (message.tablet_types != null && message.hasOwnProperty("tablet_types")) + object.tablet_types = message.tablet_types; + if (message.source_cell != null && message.hasOwnProperty("source_cell")) + object.source_cell = message.source_cell; + if (message.target_cell != null && message.hasOwnProperty("target_cell")) + object.target_cell = message.target_cell; return object; }; /** - * Converts this VDiffRequest to JSON. + * Converts this VDiffPickerOptions to JSON. * @function toJSON - * @memberof tabletmanagerdata.VDiffRequest + * @memberof tabletmanagerdata.VDiffPickerOptions * @instance * @returns {Object.} JSON object */ - VDiffRequest.prototype.toJSON = function toJSON() { + VDiffPickerOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for VDiffRequest + * Gets the default type url for VDiffPickerOptions * @function getTypeUrl - * @memberof tabletmanagerdata.VDiffRequest + * @memberof tabletmanagerdata.VDiffPickerOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - VDiffRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + VDiffPickerOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/tabletmanagerdata.VDiffRequest"; + return typeUrlPrefix + "/tabletmanagerdata.VDiffPickerOptions"; }; - return VDiffRequest; + return VDiffPickerOptions; })(); - tabletmanagerdata.VDiffResponse = (function() { + tabletmanagerdata.VDiffReportOptions = (function() { /** - * Properties of a VDiffResponse. + * Properties of a VDiffReportOptions. * @memberof tabletmanagerdata - * @interface IVDiffResponse - * @property {number|Long|null} [id] VDiffResponse id - * @property {query.IQueryResult|null} [output] VDiffResponse output - * @property {string|null} [vdiff_uuid] VDiffResponse vdiff_uuid + * @interface IVDiffReportOptions + * @property {boolean|null} [only_pks] VDiffReportOptions only_pks + * @property {boolean|null} [debug_query] VDiffReportOptions debug_query + * @property {string|null} [format] VDiffReportOptions format + * @property {number|Long|null} [max_sample_rows] VDiffReportOptions max_sample_rows */ /** - * Constructs a new VDiffResponse. + * Constructs a new VDiffReportOptions. * @memberof tabletmanagerdata - * @classdesc Represents a VDiffResponse. - * @implements IVDiffResponse + * @classdesc Represents a VDiffReportOptions. + * @implements IVDiffReportOptions * @constructor - * @param {tabletmanagerdata.IVDiffResponse=} [properties] Properties to set + * @param {tabletmanagerdata.IVDiffReportOptions=} [properties] Properties to set */ - function VDiffResponse(properties) { + function VDiffReportOptions(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -65173,103 +66807,117 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { } /** - * VDiffResponse id. - * @member {number|Long} id - * @memberof tabletmanagerdata.VDiffResponse + * VDiffReportOptions only_pks. + * @member {boolean} only_pks + * @memberof tabletmanagerdata.VDiffReportOptions * @instance */ - VDiffResponse.prototype.id = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + VDiffReportOptions.prototype.only_pks = false; /** - * VDiffResponse output. - * @member {query.IQueryResult|null|undefined} output - * @memberof tabletmanagerdata.VDiffResponse + * VDiffReportOptions debug_query. + * @member {boolean} debug_query + * @memberof tabletmanagerdata.VDiffReportOptions * @instance */ - VDiffResponse.prototype.output = null; + VDiffReportOptions.prototype.debug_query = false; /** - * VDiffResponse vdiff_uuid. - * @member {string} vdiff_uuid - * @memberof tabletmanagerdata.VDiffResponse + * VDiffReportOptions format. + * @member {string} format + * @memberof tabletmanagerdata.VDiffReportOptions + * @instance + */ + VDiffReportOptions.prototype.format = ""; + + /** + * VDiffReportOptions max_sample_rows. + * @member {number|Long} max_sample_rows + * @memberof tabletmanagerdata.VDiffReportOptions * @instance */ - VDiffResponse.prototype.vdiff_uuid = ""; + VDiffReportOptions.prototype.max_sample_rows = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new VDiffResponse instance using the specified properties. + * Creates a new VDiffReportOptions instance using the specified properties. * @function create - * @memberof tabletmanagerdata.VDiffResponse + * @memberof tabletmanagerdata.VDiffReportOptions * @static - * @param {tabletmanagerdata.IVDiffResponse=} [properties] Properties to set - * @returns {tabletmanagerdata.VDiffResponse} VDiffResponse instance + * @param {tabletmanagerdata.IVDiffReportOptions=} [properties] Properties to set + * @returns {tabletmanagerdata.VDiffReportOptions} VDiffReportOptions instance */ - VDiffResponse.create = function create(properties) { - return new VDiffResponse(properties); + VDiffReportOptions.create = function create(properties) { + return new VDiffReportOptions(properties); }; /** - * Encodes the specified VDiffResponse message. Does not implicitly {@link tabletmanagerdata.VDiffResponse.verify|verify} messages. + * Encodes the specified VDiffReportOptions message. Does not implicitly {@link tabletmanagerdata.VDiffReportOptions.verify|verify} messages. * @function encode - * @memberof tabletmanagerdata.VDiffResponse + * @memberof tabletmanagerdata.VDiffReportOptions * @static - * @param {tabletmanagerdata.IVDiffResponse} message VDiffResponse message or plain object to encode + * @param {tabletmanagerdata.IVDiffReportOptions} message VDiffReportOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VDiffResponse.encode = function encode(message, writer) { + VDiffReportOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.id); - if (message.output != null && Object.hasOwnProperty.call(message, "output")) - $root.query.QueryResult.encode(message.output, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.vdiff_uuid != null && Object.hasOwnProperty.call(message, "vdiff_uuid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.vdiff_uuid); + if (message.only_pks != null && Object.hasOwnProperty.call(message, "only_pks")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.only_pks); + if (message.debug_query != null && Object.hasOwnProperty.call(message, "debug_query")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.debug_query); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.format); + if (message.max_sample_rows != null && Object.hasOwnProperty.call(message, "max_sample_rows")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.max_sample_rows); return writer; }; /** - * Encodes the specified VDiffResponse message, length delimited. Does not implicitly {@link tabletmanagerdata.VDiffResponse.verify|verify} messages. + * Encodes the specified VDiffReportOptions message, length delimited. Does not implicitly {@link tabletmanagerdata.VDiffReportOptions.verify|verify} messages. * @function encodeDelimited - * @memberof tabletmanagerdata.VDiffResponse + * @memberof tabletmanagerdata.VDiffReportOptions * @static - * @param {tabletmanagerdata.IVDiffResponse} message VDiffResponse message or plain object to encode + * @param {tabletmanagerdata.IVDiffReportOptions} message VDiffReportOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VDiffResponse.encodeDelimited = function encodeDelimited(message, writer) { + VDiffReportOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VDiffResponse message from the specified reader or buffer. + * Decodes a VDiffReportOptions message from the specified reader or buffer. * @function decode - * @memberof tabletmanagerdata.VDiffResponse + * @memberof tabletmanagerdata.VDiffReportOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {tabletmanagerdata.VDiffResponse} VDiffResponse + * @returns {tabletmanagerdata.VDiffReportOptions} VDiffReportOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VDiffResponse.decode = function decode(reader, length) { + VDiffReportOptions.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.tabletmanagerdata.VDiffResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tabletmanagerdata.VDiffReportOptions(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.id = reader.int64(); + message.only_pks = reader.bool(); break; } case 2: { - message.output = $root.query.QueryResult.decode(reader, reader.uint32()); + message.debug_query = reader.bool(); break; } case 3: { - message.vdiff_uuid = reader.string(); + message.format = reader.string(); + break; + } + case 4: { + message.max_sample_rows = reader.int64(); break; } default: @@ -65281,264 +66929,357 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { }; /** - * Decodes a VDiffResponse message from the specified reader or buffer, length delimited. + * Decodes a VDiffReportOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof tabletmanagerdata.VDiffResponse + * @memberof tabletmanagerdata.VDiffReportOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tabletmanagerdata.VDiffResponse} VDiffResponse + * @returns {tabletmanagerdata.VDiffReportOptions} VDiffReportOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VDiffResponse.decodeDelimited = function decodeDelimited(reader) { + VDiffReportOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VDiffResponse message. + * Verifies a VDiffReportOptions message. * @function verify - * @memberof tabletmanagerdata.VDiffResponse + * @memberof tabletmanagerdata.VDiffReportOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VDiffResponse.verify = function verify(message) { + VDiffReportOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) - return "id: integer|Long expected"; - if (message.output != null && message.hasOwnProperty("output")) { - let error = $root.query.QueryResult.verify(message.output); - if (error) - return "output." + error; - } - if (message.vdiff_uuid != null && message.hasOwnProperty("vdiff_uuid")) - if (!$util.isString(message.vdiff_uuid)) - return "vdiff_uuid: string expected"; + if (message.only_pks != null && message.hasOwnProperty("only_pks")) + if (typeof message.only_pks !== "boolean") + return "only_pks: boolean expected"; + if (message.debug_query != null && message.hasOwnProperty("debug_query")) + if (typeof message.debug_query !== "boolean") + return "debug_query: boolean expected"; + if (message.format != null && message.hasOwnProperty("format")) + if (!$util.isString(message.format)) + return "format: string expected"; + if (message.max_sample_rows != null && message.hasOwnProperty("max_sample_rows")) + if (!$util.isInteger(message.max_sample_rows) && !(message.max_sample_rows && $util.isInteger(message.max_sample_rows.low) && $util.isInteger(message.max_sample_rows.high))) + return "max_sample_rows: integer|Long expected"; return null; }; /** - * Creates a VDiffResponse message from a plain object. Also converts values to their respective internal types. + * Creates a VDiffReportOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof tabletmanagerdata.VDiffResponse + * @memberof tabletmanagerdata.VDiffReportOptions * @static * @param {Object.} object Plain object - * @returns {tabletmanagerdata.VDiffResponse} VDiffResponse + * @returns {tabletmanagerdata.VDiffReportOptions} VDiffReportOptions */ - VDiffResponse.fromObject = function fromObject(object) { - if (object instanceof $root.tabletmanagerdata.VDiffResponse) + VDiffReportOptions.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.VDiffReportOptions) return object; - let message = new $root.tabletmanagerdata.VDiffResponse(); - if (object.id != null) + let message = new $root.tabletmanagerdata.VDiffReportOptions(); + if (object.only_pks != null) + message.only_pks = Boolean(object.only_pks); + if (object.debug_query != null) + message.debug_query = Boolean(object.debug_query); + if (object.format != null) + message.format = String(object.format); + if (object.max_sample_rows != null) if ($util.Long) - (message.id = $util.Long.fromValue(object.id)).unsigned = false; - else if (typeof object.id === "string") - message.id = parseInt(object.id, 10); - else if (typeof object.id === "number") - message.id = object.id; - else if (typeof object.id === "object") - message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(); - if (object.output != null) { - if (typeof object.output !== "object") - throw TypeError(".tabletmanagerdata.VDiffResponse.output: object expected"); - message.output = $root.query.QueryResult.fromObject(object.output); - } - if (object.vdiff_uuid != null) - message.vdiff_uuid = String(object.vdiff_uuid); + (message.max_sample_rows = $util.Long.fromValue(object.max_sample_rows)).unsigned = false; + else if (typeof object.max_sample_rows === "string") + message.max_sample_rows = parseInt(object.max_sample_rows, 10); + else if (typeof object.max_sample_rows === "number") + message.max_sample_rows = object.max_sample_rows; + else if (typeof object.max_sample_rows === "object") + message.max_sample_rows = new $util.LongBits(object.max_sample_rows.low >>> 0, object.max_sample_rows.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a VDiffResponse message. Also converts values to other types if specified. + * Creates a plain object from a VDiffReportOptions message. Also converts values to other types if specified. * @function toObject - * @memberof tabletmanagerdata.VDiffResponse + * @memberof tabletmanagerdata.VDiffReportOptions * @static - * @param {tabletmanagerdata.VDiffResponse} message VDiffResponse + * @param {tabletmanagerdata.VDiffReportOptions} message VDiffReportOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VDiffResponse.toObject = function toObject(message, options) { + VDiffReportOptions.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; if (options.defaults) { + object.only_pks = false; + object.debug_query = false; + object.format = ""; if ($util.Long) { let long = new $util.Long(0, 0, false); - object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.max_sample_rows = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.id = options.longs === String ? "0" : 0; - object.output = null; - object.vdiff_uuid = ""; + object.max_sample_rows = options.longs === String ? "0" : 0; } - if (message.id != null && message.hasOwnProperty("id")) - if (typeof message.id === "number") - object.id = options.longs === String ? String(message.id) : message.id; + if (message.only_pks != null && message.hasOwnProperty("only_pks")) + object.only_pks = message.only_pks; + if (message.debug_query != null && message.hasOwnProperty("debug_query")) + object.debug_query = message.debug_query; + if (message.format != null && message.hasOwnProperty("format")) + object.format = message.format; + if (message.max_sample_rows != null && message.hasOwnProperty("max_sample_rows")) + if (typeof message.max_sample_rows === "number") + object.max_sample_rows = options.longs === String ? String(message.max_sample_rows) : message.max_sample_rows; else - object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber() : message.id; - if (message.output != null && message.hasOwnProperty("output")) - object.output = $root.query.QueryResult.toObject(message.output, options); - if (message.vdiff_uuid != null && message.hasOwnProperty("vdiff_uuid")) - object.vdiff_uuid = message.vdiff_uuid; + object.max_sample_rows = options.longs === String ? $util.Long.prototype.toString.call(message.max_sample_rows) : options.longs === Number ? new $util.LongBits(message.max_sample_rows.low >>> 0, message.max_sample_rows.high >>> 0).toNumber() : message.max_sample_rows; return object; }; /** - * Converts this VDiffResponse to JSON. - * @function toJSON - * @memberof tabletmanagerdata.VDiffResponse + * Converts this VDiffReportOptions to JSON. + * @function toJSON + * @memberof tabletmanagerdata.VDiffReportOptions + * @instance + * @returns {Object.} JSON object + */ + VDiffReportOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VDiffReportOptions + * @function getTypeUrl + * @memberof tabletmanagerdata.VDiffReportOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VDiffReportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/tabletmanagerdata.VDiffReportOptions"; + }; + + return VDiffReportOptions; + })(); + + tabletmanagerdata.VDiffCoreOptions = (function() { + + /** + * Properties of a VDiffCoreOptions. + * @memberof tabletmanagerdata + * @interface IVDiffCoreOptions + * @property {string|null} [tables] VDiffCoreOptions tables + * @property {boolean|null} [auto_retry] VDiffCoreOptions auto_retry + * @property {number|Long|null} [max_rows] VDiffCoreOptions max_rows + * @property {boolean|null} [checksum] VDiffCoreOptions checksum + * @property {number|Long|null} [sample_pct] VDiffCoreOptions sample_pct + * @property {number|Long|null} [timeout_seconds] VDiffCoreOptions timeout_seconds + * @property {number|Long|null} [max_extra_rows_to_compare] VDiffCoreOptions max_extra_rows_to_compare + * @property {boolean|null} [update_table_stats] VDiffCoreOptions update_table_stats + * @property {number|Long|null} [max_diff_seconds] VDiffCoreOptions max_diff_seconds + */ + + /** + * Constructs a new VDiffCoreOptions. + * @memberof tabletmanagerdata + * @classdesc Represents a VDiffCoreOptions. + * @implements IVDiffCoreOptions + * @constructor + * @param {tabletmanagerdata.IVDiffCoreOptions=} [properties] Properties to set + */ + function VDiffCoreOptions(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]]; + } + + /** + * VDiffCoreOptions tables. + * @member {string} tables + * @memberof tabletmanagerdata.VDiffCoreOptions + * @instance + */ + VDiffCoreOptions.prototype.tables = ""; + + /** + * VDiffCoreOptions auto_retry. + * @member {boolean} auto_retry + * @memberof tabletmanagerdata.VDiffCoreOptions + * @instance + */ + VDiffCoreOptions.prototype.auto_retry = false; + + /** + * VDiffCoreOptions max_rows. + * @member {number|Long} max_rows + * @memberof tabletmanagerdata.VDiffCoreOptions * @instance - * @returns {Object.} JSON object */ - VDiffResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + VDiffCoreOptions.prototype.max_rows = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Gets the default type url for VDiffResponse - * @function getTypeUrl - * @memberof tabletmanagerdata.VDiffResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * VDiffCoreOptions checksum. + * @member {boolean} checksum + * @memberof tabletmanagerdata.VDiffCoreOptions + * @instance */ - VDiffResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/tabletmanagerdata.VDiffResponse"; - }; - - return VDiffResponse; - })(); - - tabletmanagerdata.VDiffPickerOptions = (function() { + VDiffCoreOptions.prototype.checksum = false; /** - * Properties of a VDiffPickerOptions. - * @memberof tabletmanagerdata - * @interface IVDiffPickerOptions - * @property {string|null} [tablet_types] VDiffPickerOptions tablet_types - * @property {string|null} [source_cell] VDiffPickerOptions source_cell - * @property {string|null} [target_cell] VDiffPickerOptions target_cell + * VDiffCoreOptions sample_pct. + * @member {number|Long} sample_pct + * @memberof tabletmanagerdata.VDiffCoreOptions + * @instance */ + VDiffCoreOptions.prototype.sample_pct = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Constructs a new VDiffPickerOptions. - * @memberof tabletmanagerdata - * @classdesc Represents a VDiffPickerOptions. - * @implements IVDiffPickerOptions - * @constructor - * @param {tabletmanagerdata.IVDiffPickerOptions=} [properties] Properties to set + * VDiffCoreOptions timeout_seconds. + * @member {number|Long} timeout_seconds + * @memberof tabletmanagerdata.VDiffCoreOptions + * @instance */ - function VDiffPickerOptions(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]]; - } + VDiffCoreOptions.prototype.timeout_seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * VDiffPickerOptions tablet_types. - * @member {string} tablet_types - * @memberof tabletmanagerdata.VDiffPickerOptions + * VDiffCoreOptions max_extra_rows_to_compare. + * @member {number|Long} max_extra_rows_to_compare + * @memberof tabletmanagerdata.VDiffCoreOptions * @instance */ - VDiffPickerOptions.prototype.tablet_types = ""; + VDiffCoreOptions.prototype.max_extra_rows_to_compare = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * VDiffPickerOptions source_cell. - * @member {string} source_cell - * @memberof tabletmanagerdata.VDiffPickerOptions + * VDiffCoreOptions update_table_stats. + * @member {boolean} update_table_stats + * @memberof tabletmanagerdata.VDiffCoreOptions * @instance */ - VDiffPickerOptions.prototype.source_cell = ""; + VDiffCoreOptions.prototype.update_table_stats = false; /** - * VDiffPickerOptions target_cell. - * @member {string} target_cell - * @memberof tabletmanagerdata.VDiffPickerOptions + * VDiffCoreOptions max_diff_seconds. + * @member {number|Long} max_diff_seconds + * @memberof tabletmanagerdata.VDiffCoreOptions * @instance */ - VDiffPickerOptions.prototype.target_cell = ""; + VDiffCoreOptions.prototype.max_diff_seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new VDiffPickerOptions instance using the specified properties. + * Creates a new VDiffCoreOptions instance using the specified properties. * @function create - * @memberof tabletmanagerdata.VDiffPickerOptions + * @memberof tabletmanagerdata.VDiffCoreOptions * @static - * @param {tabletmanagerdata.IVDiffPickerOptions=} [properties] Properties to set - * @returns {tabletmanagerdata.VDiffPickerOptions} VDiffPickerOptions instance + * @param {tabletmanagerdata.IVDiffCoreOptions=} [properties] Properties to set + * @returns {tabletmanagerdata.VDiffCoreOptions} VDiffCoreOptions instance */ - VDiffPickerOptions.create = function create(properties) { - return new VDiffPickerOptions(properties); + VDiffCoreOptions.create = function create(properties) { + return new VDiffCoreOptions(properties); }; /** - * Encodes the specified VDiffPickerOptions message. Does not implicitly {@link tabletmanagerdata.VDiffPickerOptions.verify|verify} messages. + * Encodes the specified VDiffCoreOptions message. Does not implicitly {@link tabletmanagerdata.VDiffCoreOptions.verify|verify} messages. * @function encode - * @memberof tabletmanagerdata.VDiffPickerOptions + * @memberof tabletmanagerdata.VDiffCoreOptions * @static - * @param {tabletmanagerdata.IVDiffPickerOptions} message VDiffPickerOptions message or plain object to encode + * @param {tabletmanagerdata.IVDiffCoreOptions} message VDiffCoreOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VDiffPickerOptions.encode = function encode(message, writer) { + VDiffCoreOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.tablet_types != null && Object.hasOwnProperty.call(message, "tablet_types")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tablet_types); - if (message.source_cell != null && Object.hasOwnProperty.call(message, "source_cell")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.source_cell); - if (message.target_cell != null && Object.hasOwnProperty.call(message, "target_cell")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.target_cell); + if (message.tables != null && Object.hasOwnProperty.call(message, "tables")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tables); + if (message.auto_retry != null && Object.hasOwnProperty.call(message, "auto_retry")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.auto_retry); + if (message.max_rows != null && Object.hasOwnProperty.call(message, "max_rows")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.max_rows); + if (message.checksum != null && Object.hasOwnProperty.call(message, "checksum")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.checksum); + if (message.sample_pct != null && Object.hasOwnProperty.call(message, "sample_pct")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.sample_pct); + if (message.timeout_seconds != null && Object.hasOwnProperty.call(message, "timeout_seconds")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.timeout_seconds); + if (message.max_extra_rows_to_compare != null && Object.hasOwnProperty.call(message, "max_extra_rows_to_compare")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.max_extra_rows_to_compare); + if (message.update_table_stats != null && Object.hasOwnProperty.call(message, "update_table_stats")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.update_table_stats); + if (message.max_diff_seconds != null && Object.hasOwnProperty.call(message, "max_diff_seconds")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.max_diff_seconds); return writer; }; /** - * Encodes the specified VDiffPickerOptions message, length delimited. Does not implicitly {@link tabletmanagerdata.VDiffPickerOptions.verify|verify} messages. + * Encodes the specified VDiffCoreOptions message, length delimited. Does not implicitly {@link tabletmanagerdata.VDiffCoreOptions.verify|verify} messages. * @function encodeDelimited - * @memberof tabletmanagerdata.VDiffPickerOptions + * @memberof tabletmanagerdata.VDiffCoreOptions * @static - * @param {tabletmanagerdata.IVDiffPickerOptions} message VDiffPickerOptions message or plain object to encode + * @param {tabletmanagerdata.IVDiffCoreOptions} message VDiffCoreOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VDiffPickerOptions.encodeDelimited = function encodeDelimited(message, writer) { + VDiffCoreOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VDiffPickerOptions message from the specified reader or buffer. + * Decodes a VDiffCoreOptions message from the specified reader or buffer. * @function decode - * @memberof tabletmanagerdata.VDiffPickerOptions + * @memberof tabletmanagerdata.VDiffCoreOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {tabletmanagerdata.VDiffPickerOptions} VDiffPickerOptions + * @returns {tabletmanagerdata.VDiffCoreOptions} VDiffCoreOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VDiffPickerOptions.decode = function decode(reader, length) { + VDiffCoreOptions.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.tabletmanagerdata.VDiffPickerOptions(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tabletmanagerdata.VDiffCoreOptions(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.tablet_types = reader.string(); + message.tables = reader.string(); break; } case 2: { - message.source_cell = reader.string(); + message.auto_retry = reader.bool(); break; } case 3: { - message.target_cell = reader.string(); + message.max_rows = reader.int64(); + break; + } + case 4: { + message.checksum = reader.bool(); + break; + } + case 5: { + message.sample_pct = reader.int64(); + break; + } + case 6: { + message.timeout_seconds = reader.int64(); + break; + } + case 7: { + message.max_extra_rows_to_compare = reader.int64(); + break; + } + case 8: { + message.update_table_stats = reader.bool(); + break; + } + case 9: { + message.max_diff_seconds = reader.int64(); break; } default: @@ -65550,142 +67291,259 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { }; /** - * Decodes a VDiffPickerOptions message from the specified reader or buffer, length delimited. + * Decodes a VDiffCoreOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof tabletmanagerdata.VDiffPickerOptions + * @memberof tabletmanagerdata.VDiffCoreOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tabletmanagerdata.VDiffPickerOptions} VDiffPickerOptions + * @returns {tabletmanagerdata.VDiffCoreOptions} VDiffCoreOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VDiffPickerOptions.decodeDelimited = function decodeDelimited(reader) { + VDiffCoreOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VDiffPickerOptions message. + * Verifies a VDiffCoreOptions message. * @function verify - * @memberof tabletmanagerdata.VDiffPickerOptions + * @memberof tabletmanagerdata.VDiffCoreOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VDiffPickerOptions.verify = function verify(message) { + VDiffCoreOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.tablet_types != null && message.hasOwnProperty("tablet_types")) - if (!$util.isString(message.tablet_types)) - return "tablet_types: string expected"; - if (message.source_cell != null && message.hasOwnProperty("source_cell")) - if (!$util.isString(message.source_cell)) - return "source_cell: string expected"; - if (message.target_cell != null && message.hasOwnProperty("target_cell")) - if (!$util.isString(message.target_cell)) - return "target_cell: string expected"; + if (message.tables != null && message.hasOwnProperty("tables")) + if (!$util.isString(message.tables)) + return "tables: string expected"; + if (message.auto_retry != null && message.hasOwnProperty("auto_retry")) + if (typeof message.auto_retry !== "boolean") + return "auto_retry: boolean expected"; + if (message.max_rows != null && message.hasOwnProperty("max_rows")) + if (!$util.isInteger(message.max_rows) && !(message.max_rows && $util.isInteger(message.max_rows.low) && $util.isInteger(message.max_rows.high))) + return "max_rows: integer|Long expected"; + if (message.checksum != null && message.hasOwnProperty("checksum")) + if (typeof message.checksum !== "boolean") + return "checksum: boolean expected"; + if (message.sample_pct != null && message.hasOwnProperty("sample_pct")) + if (!$util.isInteger(message.sample_pct) && !(message.sample_pct && $util.isInteger(message.sample_pct.low) && $util.isInteger(message.sample_pct.high))) + return "sample_pct: integer|Long expected"; + if (message.timeout_seconds != null && message.hasOwnProperty("timeout_seconds")) + if (!$util.isInteger(message.timeout_seconds) && !(message.timeout_seconds && $util.isInteger(message.timeout_seconds.low) && $util.isInteger(message.timeout_seconds.high))) + return "timeout_seconds: integer|Long expected"; + if (message.max_extra_rows_to_compare != null && message.hasOwnProperty("max_extra_rows_to_compare")) + if (!$util.isInteger(message.max_extra_rows_to_compare) && !(message.max_extra_rows_to_compare && $util.isInteger(message.max_extra_rows_to_compare.low) && $util.isInteger(message.max_extra_rows_to_compare.high))) + return "max_extra_rows_to_compare: integer|Long expected"; + if (message.update_table_stats != null && message.hasOwnProperty("update_table_stats")) + if (typeof message.update_table_stats !== "boolean") + return "update_table_stats: boolean expected"; + if (message.max_diff_seconds != null && message.hasOwnProperty("max_diff_seconds")) + if (!$util.isInteger(message.max_diff_seconds) && !(message.max_diff_seconds && $util.isInteger(message.max_diff_seconds.low) && $util.isInteger(message.max_diff_seconds.high))) + return "max_diff_seconds: integer|Long expected"; return null; }; /** - * Creates a VDiffPickerOptions message from a plain object. Also converts values to their respective internal types. + * Creates a VDiffCoreOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof tabletmanagerdata.VDiffPickerOptions + * @memberof tabletmanagerdata.VDiffCoreOptions * @static * @param {Object.} object Plain object - * @returns {tabletmanagerdata.VDiffPickerOptions} VDiffPickerOptions + * @returns {tabletmanagerdata.VDiffCoreOptions} VDiffCoreOptions */ - VDiffPickerOptions.fromObject = function fromObject(object) { - if (object instanceof $root.tabletmanagerdata.VDiffPickerOptions) + VDiffCoreOptions.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.VDiffCoreOptions) return object; - let message = new $root.tabletmanagerdata.VDiffPickerOptions(); - if (object.tablet_types != null) - message.tablet_types = String(object.tablet_types); - if (object.source_cell != null) - message.source_cell = String(object.source_cell); - if (object.target_cell != null) - message.target_cell = String(object.target_cell); + let message = new $root.tabletmanagerdata.VDiffCoreOptions(); + if (object.tables != null) + message.tables = String(object.tables); + if (object.auto_retry != null) + message.auto_retry = Boolean(object.auto_retry); + if (object.max_rows != null) + if ($util.Long) + (message.max_rows = $util.Long.fromValue(object.max_rows)).unsigned = false; + else if (typeof object.max_rows === "string") + message.max_rows = parseInt(object.max_rows, 10); + else if (typeof object.max_rows === "number") + message.max_rows = object.max_rows; + else if (typeof object.max_rows === "object") + message.max_rows = new $util.LongBits(object.max_rows.low >>> 0, object.max_rows.high >>> 0).toNumber(); + if (object.checksum != null) + message.checksum = Boolean(object.checksum); + if (object.sample_pct != null) + if ($util.Long) + (message.sample_pct = $util.Long.fromValue(object.sample_pct)).unsigned = false; + else if (typeof object.sample_pct === "string") + message.sample_pct = parseInt(object.sample_pct, 10); + else if (typeof object.sample_pct === "number") + message.sample_pct = object.sample_pct; + else if (typeof object.sample_pct === "object") + message.sample_pct = new $util.LongBits(object.sample_pct.low >>> 0, object.sample_pct.high >>> 0).toNumber(); + if (object.timeout_seconds != null) + if ($util.Long) + (message.timeout_seconds = $util.Long.fromValue(object.timeout_seconds)).unsigned = false; + else if (typeof object.timeout_seconds === "string") + message.timeout_seconds = parseInt(object.timeout_seconds, 10); + else if (typeof object.timeout_seconds === "number") + message.timeout_seconds = object.timeout_seconds; + else if (typeof object.timeout_seconds === "object") + message.timeout_seconds = new $util.LongBits(object.timeout_seconds.low >>> 0, object.timeout_seconds.high >>> 0).toNumber(); + if (object.max_extra_rows_to_compare != null) + if ($util.Long) + (message.max_extra_rows_to_compare = $util.Long.fromValue(object.max_extra_rows_to_compare)).unsigned = false; + else if (typeof object.max_extra_rows_to_compare === "string") + message.max_extra_rows_to_compare = parseInt(object.max_extra_rows_to_compare, 10); + else if (typeof object.max_extra_rows_to_compare === "number") + message.max_extra_rows_to_compare = object.max_extra_rows_to_compare; + else if (typeof object.max_extra_rows_to_compare === "object") + message.max_extra_rows_to_compare = new $util.LongBits(object.max_extra_rows_to_compare.low >>> 0, object.max_extra_rows_to_compare.high >>> 0).toNumber(); + if (object.update_table_stats != null) + message.update_table_stats = Boolean(object.update_table_stats); + if (object.max_diff_seconds != null) + if ($util.Long) + (message.max_diff_seconds = $util.Long.fromValue(object.max_diff_seconds)).unsigned = false; + else if (typeof object.max_diff_seconds === "string") + message.max_diff_seconds = parseInt(object.max_diff_seconds, 10); + else if (typeof object.max_diff_seconds === "number") + message.max_diff_seconds = object.max_diff_seconds; + else if (typeof object.max_diff_seconds === "object") + message.max_diff_seconds = new $util.LongBits(object.max_diff_seconds.low >>> 0, object.max_diff_seconds.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a VDiffPickerOptions message. Also converts values to other types if specified. + * Creates a plain object from a VDiffCoreOptions message. Also converts values to other types if specified. * @function toObject - * @memberof tabletmanagerdata.VDiffPickerOptions + * @memberof tabletmanagerdata.VDiffCoreOptions * @static - * @param {tabletmanagerdata.VDiffPickerOptions} message VDiffPickerOptions + * @param {tabletmanagerdata.VDiffCoreOptions} message VDiffCoreOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VDiffPickerOptions.toObject = function toObject(message, options) { + VDiffCoreOptions.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; if (options.defaults) { - object.tablet_types = ""; - object.source_cell = ""; - object.target_cell = ""; + object.tables = ""; + object.auto_retry = false; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.max_rows = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.max_rows = options.longs === String ? "0" : 0; + object.checksum = false; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.sample_pct = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sample_pct = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.timeout_seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timeout_seconds = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.max_extra_rows_to_compare = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.max_extra_rows_to_compare = options.longs === String ? "0" : 0; + object.update_table_stats = false; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.max_diff_seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.max_diff_seconds = options.longs === String ? "0" : 0; } - if (message.tablet_types != null && message.hasOwnProperty("tablet_types")) - object.tablet_types = message.tablet_types; - if (message.source_cell != null && message.hasOwnProperty("source_cell")) - object.source_cell = message.source_cell; - if (message.target_cell != null && message.hasOwnProperty("target_cell")) - object.target_cell = message.target_cell; + if (message.tables != null && message.hasOwnProperty("tables")) + object.tables = message.tables; + if (message.auto_retry != null && message.hasOwnProperty("auto_retry")) + object.auto_retry = message.auto_retry; + if (message.max_rows != null && message.hasOwnProperty("max_rows")) + if (typeof message.max_rows === "number") + object.max_rows = options.longs === String ? String(message.max_rows) : message.max_rows; + else + object.max_rows = options.longs === String ? $util.Long.prototype.toString.call(message.max_rows) : options.longs === Number ? new $util.LongBits(message.max_rows.low >>> 0, message.max_rows.high >>> 0).toNumber() : message.max_rows; + if (message.checksum != null && message.hasOwnProperty("checksum")) + object.checksum = message.checksum; + if (message.sample_pct != null && message.hasOwnProperty("sample_pct")) + if (typeof message.sample_pct === "number") + object.sample_pct = options.longs === String ? String(message.sample_pct) : message.sample_pct; + else + object.sample_pct = options.longs === String ? $util.Long.prototype.toString.call(message.sample_pct) : options.longs === Number ? new $util.LongBits(message.sample_pct.low >>> 0, message.sample_pct.high >>> 0).toNumber() : message.sample_pct; + if (message.timeout_seconds != null && message.hasOwnProperty("timeout_seconds")) + if (typeof message.timeout_seconds === "number") + object.timeout_seconds = options.longs === String ? String(message.timeout_seconds) : message.timeout_seconds; + else + object.timeout_seconds = options.longs === String ? $util.Long.prototype.toString.call(message.timeout_seconds) : options.longs === Number ? new $util.LongBits(message.timeout_seconds.low >>> 0, message.timeout_seconds.high >>> 0).toNumber() : message.timeout_seconds; + if (message.max_extra_rows_to_compare != null && message.hasOwnProperty("max_extra_rows_to_compare")) + if (typeof message.max_extra_rows_to_compare === "number") + object.max_extra_rows_to_compare = options.longs === String ? String(message.max_extra_rows_to_compare) : message.max_extra_rows_to_compare; + else + object.max_extra_rows_to_compare = options.longs === String ? $util.Long.prototype.toString.call(message.max_extra_rows_to_compare) : options.longs === Number ? new $util.LongBits(message.max_extra_rows_to_compare.low >>> 0, message.max_extra_rows_to_compare.high >>> 0).toNumber() : message.max_extra_rows_to_compare; + if (message.update_table_stats != null && message.hasOwnProperty("update_table_stats")) + object.update_table_stats = message.update_table_stats; + if (message.max_diff_seconds != null && message.hasOwnProperty("max_diff_seconds")) + if (typeof message.max_diff_seconds === "number") + object.max_diff_seconds = options.longs === String ? String(message.max_diff_seconds) : message.max_diff_seconds; + else + object.max_diff_seconds = options.longs === String ? $util.Long.prototype.toString.call(message.max_diff_seconds) : options.longs === Number ? new $util.LongBits(message.max_diff_seconds.low >>> 0, message.max_diff_seconds.high >>> 0).toNumber() : message.max_diff_seconds; return object; }; /** - * Converts this VDiffPickerOptions to JSON. + * Converts this VDiffCoreOptions to JSON. * @function toJSON - * @memberof tabletmanagerdata.VDiffPickerOptions + * @memberof tabletmanagerdata.VDiffCoreOptions * @instance * @returns {Object.} JSON object */ - VDiffPickerOptions.prototype.toJSON = function toJSON() { + VDiffCoreOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for VDiffPickerOptions + * Gets the default type url for VDiffCoreOptions * @function getTypeUrl - * @memberof tabletmanagerdata.VDiffPickerOptions + * @memberof tabletmanagerdata.VDiffCoreOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - VDiffPickerOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + VDiffCoreOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/tabletmanagerdata.VDiffPickerOptions"; + return typeUrlPrefix + "/tabletmanagerdata.VDiffCoreOptions"; }; - return VDiffPickerOptions; + return VDiffCoreOptions; })(); - tabletmanagerdata.VDiffReportOptions = (function() { + tabletmanagerdata.VDiffOptions = (function() { /** - * Properties of a VDiffReportOptions. + * Properties of a VDiffOptions. * @memberof tabletmanagerdata - * @interface IVDiffReportOptions - * @property {boolean|null} [only_pks] VDiffReportOptions only_pks - * @property {boolean|null} [debug_query] VDiffReportOptions debug_query - * @property {string|null} [format] VDiffReportOptions format - * @property {number|Long|null} [max_sample_rows] VDiffReportOptions max_sample_rows + * @interface IVDiffOptions + * @property {tabletmanagerdata.IVDiffPickerOptions|null} [picker_options] VDiffOptions picker_options + * @property {tabletmanagerdata.IVDiffCoreOptions|null} [core_options] VDiffOptions core_options + * @property {tabletmanagerdata.IVDiffReportOptions|null} [report_options] VDiffOptions report_options */ /** - * Constructs a new VDiffReportOptions. + * Constructs a new VDiffOptions. * @memberof tabletmanagerdata - * @classdesc Represents a VDiffReportOptions. - * @implements IVDiffReportOptions + * @classdesc Represents a VDiffOptions. + * @implements IVDiffOptions * @constructor - * @param {tabletmanagerdata.IVDiffReportOptions=} [properties] Properties to set + * @param {tabletmanagerdata.IVDiffOptions=} [properties] Properties to set */ - function VDiffReportOptions(properties) { + function VDiffOptions(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -65693,117 +67551,103 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { } /** - * VDiffReportOptions only_pks. - * @member {boolean} only_pks - * @memberof tabletmanagerdata.VDiffReportOptions - * @instance - */ - VDiffReportOptions.prototype.only_pks = false; - - /** - * VDiffReportOptions debug_query. - * @member {boolean} debug_query - * @memberof tabletmanagerdata.VDiffReportOptions + * VDiffOptions picker_options. + * @member {tabletmanagerdata.IVDiffPickerOptions|null|undefined} picker_options + * @memberof tabletmanagerdata.VDiffOptions * @instance */ - VDiffReportOptions.prototype.debug_query = false; + VDiffOptions.prototype.picker_options = null; /** - * VDiffReportOptions format. - * @member {string} format - * @memberof tabletmanagerdata.VDiffReportOptions + * VDiffOptions core_options. + * @member {tabletmanagerdata.IVDiffCoreOptions|null|undefined} core_options + * @memberof tabletmanagerdata.VDiffOptions * @instance */ - VDiffReportOptions.prototype.format = ""; + VDiffOptions.prototype.core_options = null; /** - * VDiffReportOptions max_sample_rows. - * @member {number|Long} max_sample_rows - * @memberof tabletmanagerdata.VDiffReportOptions + * VDiffOptions report_options. + * @member {tabletmanagerdata.IVDiffReportOptions|null|undefined} report_options + * @memberof tabletmanagerdata.VDiffOptions * @instance */ - VDiffReportOptions.prototype.max_sample_rows = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + VDiffOptions.prototype.report_options = null; /** - * Creates a new VDiffReportOptions instance using the specified properties. + * Creates a new VDiffOptions instance using the specified properties. * @function create - * @memberof tabletmanagerdata.VDiffReportOptions + * @memberof tabletmanagerdata.VDiffOptions * @static - * @param {tabletmanagerdata.IVDiffReportOptions=} [properties] Properties to set - * @returns {tabletmanagerdata.VDiffReportOptions} VDiffReportOptions instance + * @param {tabletmanagerdata.IVDiffOptions=} [properties] Properties to set + * @returns {tabletmanagerdata.VDiffOptions} VDiffOptions instance */ - VDiffReportOptions.create = function create(properties) { - return new VDiffReportOptions(properties); + VDiffOptions.create = function create(properties) { + return new VDiffOptions(properties); }; /** - * Encodes the specified VDiffReportOptions message. Does not implicitly {@link tabletmanagerdata.VDiffReportOptions.verify|verify} messages. + * Encodes the specified VDiffOptions message. Does not implicitly {@link tabletmanagerdata.VDiffOptions.verify|verify} messages. * @function encode - * @memberof tabletmanagerdata.VDiffReportOptions + * @memberof tabletmanagerdata.VDiffOptions * @static - * @param {tabletmanagerdata.IVDiffReportOptions} message VDiffReportOptions message or plain object to encode + * @param {tabletmanagerdata.IVDiffOptions} message VDiffOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VDiffReportOptions.encode = function encode(message, writer) { + VDiffOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.only_pks != null && Object.hasOwnProperty.call(message, "only_pks")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.only_pks); - if (message.debug_query != null && Object.hasOwnProperty.call(message, "debug_query")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.debug_query); - if (message.format != null && Object.hasOwnProperty.call(message, "format")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.format); - if (message.max_sample_rows != null && Object.hasOwnProperty.call(message, "max_sample_rows")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.max_sample_rows); + if (message.picker_options != null && Object.hasOwnProperty.call(message, "picker_options")) + $root.tabletmanagerdata.VDiffPickerOptions.encode(message.picker_options, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.core_options != null && Object.hasOwnProperty.call(message, "core_options")) + $root.tabletmanagerdata.VDiffCoreOptions.encode(message.core_options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.report_options != null && Object.hasOwnProperty.call(message, "report_options")) + $root.tabletmanagerdata.VDiffReportOptions.encode(message.report_options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified VDiffReportOptions message, length delimited. Does not implicitly {@link tabletmanagerdata.VDiffReportOptions.verify|verify} messages. + * Encodes the specified VDiffOptions message, length delimited. Does not implicitly {@link tabletmanagerdata.VDiffOptions.verify|verify} messages. * @function encodeDelimited - * @memberof tabletmanagerdata.VDiffReportOptions + * @memberof tabletmanagerdata.VDiffOptions * @static - * @param {tabletmanagerdata.IVDiffReportOptions} message VDiffReportOptions message or plain object to encode + * @param {tabletmanagerdata.IVDiffOptions} message VDiffOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VDiffReportOptions.encodeDelimited = function encodeDelimited(message, writer) { + VDiffOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VDiffReportOptions message from the specified reader or buffer. + * Decodes a VDiffOptions message from the specified reader or buffer. * @function decode - * @memberof tabletmanagerdata.VDiffReportOptions + * @memberof tabletmanagerdata.VDiffOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {tabletmanagerdata.VDiffReportOptions} VDiffReportOptions + * @returns {tabletmanagerdata.VDiffOptions} VDiffOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VDiffReportOptions.decode = function decode(reader, length) { + VDiffOptions.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.tabletmanagerdata.VDiffReportOptions(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tabletmanagerdata.VDiffOptions(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.only_pks = reader.bool(); + message.picker_options = $root.tabletmanagerdata.VDiffPickerOptions.decode(reader, reader.uint32()); break; } case 2: { - message.debug_query = reader.bool(); - break; - } - case 3: { - message.format = reader.string(); + message.core_options = $root.tabletmanagerdata.VDiffCoreOptions.decode(reader, reader.uint32()); break; - } - case 4: { - message.max_sample_rows = reader.int64(); + } + case 3: { + message.report_options = $root.tabletmanagerdata.VDiffReportOptions.decode(reader, reader.uint32()); break; } default: @@ -65815,169 +67659,163 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { }; /** - * Decodes a VDiffReportOptions message from the specified reader or buffer, length delimited. + * Decodes a VDiffOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof tabletmanagerdata.VDiffReportOptions + * @memberof tabletmanagerdata.VDiffOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tabletmanagerdata.VDiffReportOptions} VDiffReportOptions + * @returns {tabletmanagerdata.VDiffOptions} VDiffOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VDiffReportOptions.decodeDelimited = function decodeDelimited(reader) { + VDiffOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VDiffReportOptions message. + * Verifies a VDiffOptions message. * @function verify - * @memberof tabletmanagerdata.VDiffReportOptions + * @memberof tabletmanagerdata.VDiffOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VDiffReportOptions.verify = function verify(message) { + VDiffOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.only_pks != null && message.hasOwnProperty("only_pks")) - if (typeof message.only_pks !== "boolean") - return "only_pks: boolean expected"; - if (message.debug_query != null && message.hasOwnProperty("debug_query")) - if (typeof message.debug_query !== "boolean") - return "debug_query: boolean expected"; - if (message.format != null && message.hasOwnProperty("format")) - if (!$util.isString(message.format)) - return "format: string expected"; - if (message.max_sample_rows != null && message.hasOwnProperty("max_sample_rows")) - if (!$util.isInteger(message.max_sample_rows) && !(message.max_sample_rows && $util.isInteger(message.max_sample_rows.low) && $util.isInteger(message.max_sample_rows.high))) - return "max_sample_rows: integer|Long expected"; + if (message.picker_options != null && message.hasOwnProperty("picker_options")) { + let error = $root.tabletmanagerdata.VDiffPickerOptions.verify(message.picker_options); + if (error) + return "picker_options." + error; + } + if (message.core_options != null && message.hasOwnProperty("core_options")) { + let error = $root.tabletmanagerdata.VDiffCoreOptions.verify(message.core_options); + if (error) + return "core_options." + error; + } + if (message.report_options != null && message.hasOwnProperty("report_options")) { + let error = $root.tabletmanagerdata.VDiffReportOptions.verify(message.report_options); + if (error) + return "report_options." + error; + } return null; }; /** - * Creates a VDiffReportOptions message from a plain object. Also converts values to their respective internal types. + * Creates a VDiffOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof tabletmanagerdata.VDiffReportOptions + * @memberof tabletmanagerdata.VDiffOptions * @static * @param {Object.} object Plain object - * @returns {tabletmanagerdata.VDiffReportOptions} VDiffReportOptions + * @returns {tabletmanagerdata.VDiffOptions} VDiffOptions */ - VDiffReportOptions.fromObject = function fromObject(object) { - if (object instanceof $root.tabletmanagerdata.VDiffReportOptions) + VDiffOptions.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.VDiffOptions) return object; - let message = new $root.tabletmanagerdata.VDiffReportOptions(); - if (object.only_pks != null) - message.only_pks = Boolean(object.only_pks); - if (object.debug_query != null) - message.debug_query = Boolean(object.debug_query); - if (object.format != null) - message.format = String(object.format); - if (object.max_sample_rows != null) - if ($util.Long) - (message.max_sample_rows = $util.Long.fromValue(object.max_sample_rows)).unsigned = false; - else if (typeof object.max_sample_rows === "string") - message.max_sample_rows = parseInt(object.max_sample_rows, 10); - else if (typeof object.max_sample_rows === "number") - message.max_sample_rows = object.max_sample_rows; - else if (typeof object.max_sample_rows === "object") - message.max_sample_rows = new $util.LongBits(object.max_sample_rows.low >>> 0, object.max_sample_rows.high >>> 0).toNumber(); + let message = new $root.tabletmanagerdata.VDiffOptions(); + if (object.picker_options != null) { + if (typeof object.picker_options !== "object") + throw TypeError(".tabletmanagerdata.VDiffOptions.picker_options: object expected"); + message.picker_options = $root.tabletmanagerdata.VDiffPickerOptions.fromObject(object.picker_options); + } + if (object.core_options != null) { + if (typeof object.core_options !== "object") + throw TypeError(".tabletmanagerdata.VDiffOptions.core_options: object expected"); + message.core_options = $root.tabletmanagerdata.VDiffCoreOptions.fromObject(object.core_options); + } + if (object.report_options != null) { + if (typeof object.report_options !== "object") + throw TypeError(".tabletmanagerdata.VDiffOptions.report_options: object expected"); + message.report_options = $root.tabletmanagerdata.VDiffReportOptions.fromObject(object.report_options); + } return message; }; /** - * Creates a plain object from a VDiffReportOptions message. Also converts values to other types if specified. + * Creates a plain object from a VDiffOptions message. Also converts values to other types if specified. * @function toObject - * @memberof tabletmanagerdata.VDiffReportOptions + * @memberof tabletmanagerdata.VDiffOptions * @static - * @param {tabletmanagerdata.VDiffReportOptions} message VDiffReportOptions + * @param {tabletmanagerdata.VDiffOptions} message VDiffOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VDiffReportOptions.toObject = function toObject(message, options) { + VDiffOptions.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; if (options.defaults) { - object.only_pks = false; - object.debug_query = false; - object.format = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.max_sample_rows = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.max_sample_rows = options.longs === String ? "0" : 0; + object.picker_options = null; + object.core_options = null; + object.report_options = null; } - if (message.only_pks != null && message.hasOwnProperty("only_pks")) - object.only_pks = message.only_pks; - if (message.debug_query != null && message.hasOwnProperty("debug_query")) - object.debug_query = message.debug_query; - if (message.format != null && message.hasOwnProperty("format")) - object.format = message.format; - if (message.max_sample_rows != null && message.hasOwnProperty("max_sample_rows")) - if (typeof message.max_sample_rows === "number") - object.max_sample_rows = options.longs === String ? String(message.max_sample_rows) : message.max_sample_rows; - else - object.max_sample_rows = options.longs === String ? $util.Long.prototype.toString.call(message.max_sample_rows) : options.longs === Number ? new $util.LongBits(message.max_sample_rows.low >>> 0, message.max_sample_rows.high >>> 0).toNumber() : message.max_sample_rows; + if (message.picker_options != null && message.hasOwnProperty("picker_options")) + object.picker_options = $root.tabletmanagerdata.VDiffPickerOptions.toObject(message.picker_options, options); + if (message.core_options != null && message.hasOwnProperty("core_options")) + object.core_options = $root.tabletmanagerdata.VDiffCoreOptions.toObject(message.core_options, options); + if (message.report_options != null && message.hasOwnProperty("report_options")) + object.report_options = $root.tabletmanagerdata.VDiffReportOptions.toObject(message.report_options, options); return object; }; /** - * Converts this VDiffReportOptions to JSON. + * Converts this VDiffOptions to JSON. * @function toJSON - * @memberof tabletmanagerdata.VDiffReportOptions + * @memberof tabletmanagerdata.VDiffOptions * @instance * @returns {Object.} JSON object */ - VDiffReportOptions.prototype.toJSON = function toJSON() { + VDiffOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for VDiffReportOptions + * Gets the default type url for VDiffOptions * @function getTypeUrl - * @memberof tabletmanagerdata.VDiffReportOptions + * @memberof tabletmanagerdata.VDiffOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - VDiffReportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + VDiffOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/tabletmanagerdata.VDiffReportOptions"; + return typeUrlPrefix + "/tabletmanagerdata.VDiffOptions"; }; - return VDiffReportOptions; + return VDiffOptions; })(); - tabletmanagerdata.VDiffCoreOptions = (function() { + tabletmanagerdata.UpdateVReplicationWorkflowRequest = (function() { /** - * Properties of a VDiffCoreOptions. + * Properties of an UpdateVReplicationWorkflowRequest. * @memberof tabletmanagerdata - * @interface IVDiffCoreOptions - * @property {string|null} [tables] VDiffCoreOptions tables - * @property {boolean|null} [auto_retry] VDiffCoreOptions auto_retry - * @property {number|Long|null} [max_rows] VDiffCoreOptions max_rows - * @property {boolean|null} [checksum] VDiffCoreOptions checksum - * @property {number|Long|null} [sample_pct] VDiffCoreOptions sample_pct - * @property {number|Long|null} [timeout_seconds] VDiffCoreOptions timeout_seconds - * @property {number|Long|null} [max_extra_rows_to_compare] VDiffCoreOptions max_extra_rows_to_compare - * @property {boolean|null} [update_table_stats] VDiffCoreOptions update_table_stats - * @property {number|Long|null} [max_diff_seconds] VDiffCoreOptions max_diff_seconds + * @interface IUpdateVReplicationWorkflowRequest + * @property {string|null} [workflow] UpdateVReplicationWorkflowRequest workflow + * @property {Array.|null} [cells] UpdateVReplicationWorkflowRequest cells + * @property {Array.|null} [tablet_types] UpdateVReplicationWorkflowRequest tablet_types + * @property {tabletmanagerdata.TabletSelectionPreference|null} [tablet_selection_preference] UpdateVReplicationWorkflowRequest tablet_selection_preference + * @property {binlogdata.OnDDLAction|null} [on_ddl] UpdateVReplicationWorkflowRequest on_ddl + * @property {binlogdata.VReplicationWorkflowState|null} [state] UpdateVReplicationWorkflowRequest state + * @property {Array.|null} [shards] UpdateVReplicationWorkflowRequest shards */ /** - * Constructs a new VDiffCoreOptions. + * Constructs a new UpdateVReplicationWorkflowRequest. * @memberof tabletmanagerdata - * @classdesc Represents a VDiffCoreOptions. - * @implements IVDiffCoreOptions + * @classdesc Represents an UpdateVReplicationWorkflowRequest. + * @implements IUpdateVReplicationWorkflowRequest * @constructor - * @param {tabletmanagerdata.IVDiffCoreOptions=} [properties] Properties to set + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowRequest=} [properties] Properties to set */ - function VDiffCoreOptions(properties) { + function UpdateVReplicationWorkflowRequest(properties) { + this.cells = []; + this.tablet_types = []; + this.shards = []; if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -65985,451 +67823,551 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { } /** - * VDiffCoreOptions tables. - * @member {string} tables - * @memberof tabletmanagerdata.VDiffCoreOptions - * @instance - */ - VDiffCoreOptions.prototype.tables = ""; - - /** - * VDiffCoreOptions auto_retry. - * @member {boolean} auto_retry - * @memberof tabletmanagerdata.VDiffCoreOptions - * @instance - */ - VDiffCoreOptions.prototype.auto_retry = false; - - /** - * VDiffCoreOptions max_rows. - * @member {number|Long} max_rows - * @memberof tabletmanagerdata.VDiffCoreOptions + * UpdateVReplicationWorkflowRequest workflow. + * @member {string} workflow + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest * @instance */ - VDiffCoreOptions.prototype.max_rows = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + UpdateVReplicationWorkflowRequest.prototype.workflow = ""; /** - * VDiffCoreOptions checksum. - * @member {boolean} checksum - * @memberof tabletmanagerdata.VDiffCoreOptions + * UpdateVReplicationWorkflowRequest cells. + * @member {Array.} cells + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest * @instance */ - VDiffCoreOptions.prototype.checksum = false; + UpdateVReplicationWorkflowRequest.prototype.cells = $util.emptyArray; /** - * VDiffCoreOptions sample_pct. - * @member {number|Long} sample_pct - * @memberof tabletmanagerdata.VDiffCoreOptions + * UpdateVReplicationWorkflowRequest tablet_types. + * @member {Array.} tablet_types + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest * @instance */ - VDiffCoreOptions.prototype.sample_pct = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + UpdateVReplicationWorkflowRequest.prototype.tablet_types = $util.emptyArray; /** - * VDiffCoreOptions timeout_seconds. - * @member {number|Long} timeout_seconds - * @memberof tabletmanagerdata.VDiffCoreOptions + * UpdateVReplicationWorkflowRequest tablet_selection_preference. + * @member {tabletmanagerdata.TabletSelectionPreference} tablet_selection_preference + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest * @instance */ - VDiffCoreOptions.prototype.timeout_seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + UpdateVReplicationWorkflowRequest.prototype.tablet_selection_preference = 0; /** - * VDiffCoreOptions max_extra_rows_to_compare. - * @member {number|Long} max_extra_rows_to_compare - * @memberof tabletmanagerdata.VDiffCoreOptions + * UpdateVReplicationWorkflowRequest on_ddl. + * @member {binlogdata.OnDDLAction} on_ddl + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest * @instance */ - VDiffCoreOptions.prototype.max_extra_rows_to_compare = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + UpdateVReplicationWorkflowRequest.prototype.on_ddl = 0; /** - * VDiffCoreOptions update_table_stats. - * @member {boolean} update_table_stats - * @memberof tabletmanagerdata.VDiffCoreOptions + * UpdateVReplicationWorkflowRequest state. + * @member {binlogdata.VReplicationWorkflowState} state + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest * @instance */ - VDiffCoreOptions.prototype.update_table_stats = false; + UpdateVReplicationWorkflowRequest.prototype.state = 0; /** - * VDiffCoreOptions max_diff_seconds. - * @member {number|Long} max_diff_seconds - * @memberof tabletmanagerdata.VDiffCoreOptions + * UpdateVReplicationWorkflowRequest shards. + * @member {Array.} shards + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest * @instance */ - VDiffCoreOptions.prototype.max_diff_seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + UpdateVReplicationWorkflowRequest.prototype.shards = $util.emptyArray; /** - * Creates a new VDiffCoreOptions instance using the specified properties. + * Creates a new UpdateVReplicationWorkflowRequest instance using the specified properties. * @function create - * @memberof tabletmanagerdata.VDiffCoreOptions + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest * @static - * @param {tabletmanagerdata.IVDiffCoreOptions=} [properties] Properties to set - * @returns {tabletmanagerdata.VDiffCoreOptions} VDiffCoreOptions instance + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowRequest=} [properties] Properties to set + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowRequest} UpdateVReplicationWorkflowRequest instance */ - VDiffCoreOptions.create = function create(properties) { - return new VDiffCoreOptions(properties); + UpdateVReplicationWorkflowRequest.create = function create(properties) { + return new UpdateVReplicationWorkflowRequest(properties); }; /** - * Encodes the specified VDiffCoreOptions message. Does not implicitly {@link tabletmanagerdata.VDiffCoreOptions.verify|verify} messages. + * Encodes the specified UpdateVReplicationWorkflowRequest message. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowRequest.verify|verify} messages. * @function encode - * @memberof tabletmanagerdata.VDiffCoreOptions + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest * @static - * @param {tabletmanagerdata.IVDiffCoreOptions} message VDiffCoreOptions message or plain object to encode + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowRequest} message UpdateVReplicationWorkflowRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VDiffCoreOptions.encode = function encode(message, writer) { + UpdateVReplicationWorkflowRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.tables != null && Object.hasOwnProperty.call(message, "tables")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tables); - if (message.auto_retry != null && Object.hasOwnProperty.call(message, "auto_retry")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.auto_retry); - if (message.max_rows != null && Object.hasOwnProperty.call(message, "max_rows")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.max_rows); - if (message.checksum != null && Object.hasOwnProperty.call(message, "checksum")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.checksum); - if (message.sample_pct != null && Object.hasOwnProperty.call(message, "sample_pct")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.sample_pct); - if (message.timeout_seconds != null && Object.hasOwnProperty.call(message, "timeout_seconds")) - writer.uint32(/* id 6, wireType 0 =*/48).int64(message.timeout_seconds); - if (message.max_extra_rows_to_compare != null && Object.hasOwnProperty.call(message, "max_extra_rows_to_compare")) - writer.uint32(/* id 7, wireType 0 =*/56).int64(message.max_extra_rows_to_compare); - if (message.update_table_stats != null && Object.hasOwnProperty.call(message, "update_table_stats")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.update_table_stats); - if (message.max_diff_seconds != null && Object.hasOwnProperty.call(message, "max_diff_seconds")) - writer.uint32(/* id 9, wireType 0 =*/72).int64(message.max_diff_seconds); + if (message.workflow != null && Object.hasOwnProperty.call(message, "workflow")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.workflow); + if (message.cells != null && message.cells.length) + for (let i = 0; i < message.cells.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cells[i]); + if (message.tablet_types != null && message.tablet_types.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (let i = 0; i < message.tablet_types.length; ++i) + writer.int32(message.tablet_types[i]); + writer.ldelim(); + } + if (message.tablet_selection_preference != null && Object.hasOwnProperty.call(message, "tablet_selection_preference")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.tablet_selection_preference); + if (message.on_ddl != null && Object.hasOwnProperty.call(message, "on_ddl")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.on_ddl); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.shards != null && message.shards.length) + for (let i = 0; i < message.shards.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.shards[i]); return writer; }; /** - * Encodes the specified VDiffCoreOptions message, length delimited. Does not implicitly {@link tabletmanagerdata.VDiffCoreOptions.verify|verify} messages. + * Encodes the specified UpdateVReplicationWorkflowRequest message, length delimited. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowRequest.verify|verify} messages. * @function encodeDelimited - * @memberof tabletmanagerdata.VDiffCoreOptions + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest * @static - * @param {tabletmanagerdata.IVDiffCoreOptions} message VDiffCoreOptions message or plain object to encode + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowRequest} message UpdateVReplicationWorkflowRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VDiffCoreOptions.encodeDelimited = function encodeDelimited(message, writer) { + UpdateVReplicationWorkflowRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VDiffCoreOptions message from the specified reader or buffer. + * Decodes an UpdateVReplicationWorkflowRequest message from the specified reader or buffer. * @function decode - * @memberof tabletmanagerdata.VDiffCoreOptions + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {tabletmanagerdata.VDiffCoreOptions} VDiffCoreOptions + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowRequest} UpdateVReplicationWorkflowRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VDiffCoreOptions.decode = function decode(reader, length) { + UpdateVReplicationWorkflowRequest.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.tabletmanagerdata.VDiffCoreOptions(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tabletmanagerdata.UpdateVReplicationWorkflowRequest(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.tables = reader.string(); + message.workflow = reader.string(); break; } case 2: { - message.auto_retry = reader.bool(); + if (!(message.cells && message.cells.length)) + message.cells = []; + message.cells.push(reader.string()); + break; + } + case 3: { + if (!(message.tablet_types && message.tablet_types.length)) + message.tablet_types = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.tablet_types.push(reader.int32()); + } else + message.tablet_types.push(reader.int32()); + break; + } + case 4: { + message.tablet_selection_preference = reader.int32(); + break; + } + case 5: { + message.on_ddl = reader.int32(); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + case 7: { + if (!(message.shards && message.shards.length)) + message.shards = []; + message.shards.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateVReplicationWorkflowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowRequest} UpdateVReplicationWorkflowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateVReplicationWorkflowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateVReplicationWorkflowRequest message. + * @function verify + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateVReplicationWorkflowRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workflow != null && message.hasOwnProperty("workflow")) + if (!$util.isString(message.workflow)) + return "workflow: string expected"; + if (message.cells != null && message.hasOwnProperty("cells")) { + if (!Array.isArray(message.cells)) + return "cells: array expected"; + for (let i = 0; i < message.cells.length; ++i) + if (!$util.isString(message.cells[i])) + return "cells: string[] expected"; + } + if (message.tablet_types != null && message.hasOwnProperty("tablet_types")) { + if (!Array.isArray(message.tablet_types)) + return "tablet_types: array expected"; + for (let i = 0; i < message.tablet_types.length; ++i) + switch (message.tablet_types[i]) { + default: + return "tablet_types: enum value[] expected"; + case 0: + case 1: + case 1: + case 2: + case 3: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message.tablet_selection_preference != null && message.hasOwnProperty("tablet_selection_preference")) + switch (message.tablet_selection_preference) { + default: + return "tablet_selection_preference: enum value expected"; + case 0: + case 1: + case 3: + break; + } + if (message.on_ddl != null && message.hasOwnProperty("on_ddl")) + switch (message.on_ddl) { + default: + return "on_ddl: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.shards != null && message.hasOwnProperty("shards")) { + if (!Array.isArray(message.shards)) + return "shards: array expected"; + for (let i = 0; i < message.shards.length; ++i) + if (!$util.isString(message.shards[i])) + return "shards: string[] expected"; + } + return null; + }; + + /** + * Creates an UpdateVReplicationWorkflowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest + * @static + * @param {Object.} object Plain object + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowRequest} UpdateVReplicationWorkflowRequest + */ + UpdateVReplicationWorkflowRequest.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.UpdateVReplicationWorkflowRequest) + return object; + let message = new $root.tabletmanagerdata.UpdateVReplicationWorkflowRequest(); + if (object.workflow != null) + message.workflow = String(object.workflow); + if (object.cells) { + if (!Array.isArray(object.cells)) + throw TypeError(".tabletmanagerdata.UpdateVReplicationWorkflowRequest.cells: array expected"); + message.cells = []; + for (let i = 0; i < object.cells.length; ++i) + message.cells[i] = String(object.cells[i]); + } + if (object.tablet_types) { + if (!Array.isArray(object.tablet_types)) + throw TypeError(".tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_types: array expected"); + message.tablet_types = []; + for (let i = 0; i < object.tablet_types.length; ++i) + switch (object.tablet_types[i]) { + default: + if (typeof object.tablet_types[i] === "number") { + message.tablet_types[i] = object.tablet_types[i]; + break; + } + case "UNKNOWN": + case 0: + message.tablet_types[i] = 0; + break; + case "PRIMARY": + case 1: + message.tablet_types[i] = 1; + break; + case "MASTER": + case 1: + message.tablet_types[i] = 1; + break; + case "REPLICA": + case 2: + message.tablet_types[i] = 2; break; - } - case 3: { - message.max_rows = reader.int64(); + case "RDONLY": + case 3: + message.tablet_types[i] = 3; break; - } - case 4: { - message.checksum = reader.bool(); + case "BATCH": + case 3: + message.tablet_types[i] = 3; break; - } - case 5: { - message.sample_pct = reader.int64(); + case "SPARE": + case 4: + message.tablet_types[i] = 4; break; - } - case 6: { - message.timeout_seconds = reader.int64(); + case "EXPERIMENTAL": + case 5: + message.tablet_types[i] = 5; break; - } - case 7: { - message.max_extra_rows_to_compare = reader.int64(); + case "BACKUP": + case 6: + message.tablet_types[i] = 6; break; - } - case 8: { - message.update_table_stats = reader.bool(); + case "RESTORE": + case 7: + message.tablet_types[i] = 7; break; - } - case 9: { - message.max_diff_seconds = reader.int64(); + case "DRAINED": + case 8: + message.tablet_types[i] = 8; break; } - default: - reader.skipType(tag & 7); + } + switch (object.tablet_selection_preference) { + default: + if (typeof object.tablet_selection_preference === "number") { + message.tablet_selection_preference = object.tablet_selection_preference; break; } + break; + case "ANY": + case 0: + message.tablet_selection_preference = 0; + break; + case "INORDER": + case 1: + message.tablet_selection_preference = 1; + break; + case "UNKNOWN": + case 3: + message.tablet_selection_preference = 3; + break; + } + switch (object.on_ddl) { + default: + if (typeof object.on_ddl === "number") { + message.on_ddl = object.on_ddl; + break; + } + break; + case "IGNORE": + case 0: + message.on_ddl = 0; + break; + case "STOP": + case 1: + message.on_ddl = 1; + break; + case "EXEC": + case 2: + message.on_ddl = 2; + break; + case "EXEC_IGNORE": + case 3: + message.on_ddl = 3; + break; + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "Unknown": + case 0: + message.state = 0; + break; + case "Init": + case 1: + message.state = 1; + break; + case "Stopped": + case 2: + message.state = 2; + break; + case "Copying": + case 3: + message.state = 3; + break; + case "Running": + case 4: + message.state = 4; + break; + case "Error": + case 5: + message.state = 5; + break; + case "Lagging": + case 6: + message.state = 6; + break; + } + if (object.shards) { + if (!Array.isArray(object.shards)) + throw TypeError(".tabletmanagerdata.UpdateVReplicationWorkflowRequest.shards: array expected"); + message.shards = []; + for (let i = 0; i < object.shards.length; ++i) + message.shards[i] = String(object.shards[i]); } return message; }; /** - * Decodes a VDiffCoreOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tabletmanagerdata.VDiffCoreOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tabletmanagerdata.VDiffCoreOptions} VDiffCoreOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VDiffCoreOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VDiffCoreOptions message. - * @function verify - * @memberof tabletmanagerdata.VDiffCoreOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VDiffCoreOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tables != null && message.hasOwnProperty("tables")) - if (!$util.isString(message.tables)) - return "tables: string expected"; - if (message.auto_retry != null && message.hasOwnProperty("auto_retry")) - if (typeof message.auto_retry !== "boolean") - return "auto_retry: boolean expected"; - if (message.max_rows != null && message.hasOwnProperty("max_rows")) - if (!$util.isInteger(message.max_rows) && !(message.max_rows && $util.isInteger(message.max_rows.low) && $util.isInteger(message.max_rows.high))) - return "max_rows: integer|Long expected"; - if (message.checksum != null && message.hasOwnProperty("checksum")) - if (typeof message.checksum !== "boolean") - return "checksum: boolean expected"; - if (message.sample_pct != null && message.hasOwnProperty("sample_pct")) - if (!$util.isInteger(message.sample_pct) && !(message.sample_pct && $util.isInteger(message.sample_pct.low) && $util.isInteger(message.sample_pct.high))) - return "sample_pct: integer|Long expected"; - if (message.timeout_seconds != null && message.hasOwnProperty("timeout_seconds")) - if (!$util.isInteger(message.timeout_seconds) && !(message.timeout_seconds && $util.isInteger(message.timeout_seconds.low) && $util.isInteger(message.timeout_seconds.high))) - return "timeout_seconds: integer|Long expected"; - if (message.max_extra_rows_to_compare != null && message.hasOwnProperty("max_extra_rows_to_compare")) - if (!$util.isInteger(message.max_extra_rows_to_compare) && !(message.max_extra_rows_to_compare && $util.isInteger(message.max_extra_rows_to_compare.low) && $util.isInteger(message.max_extra_rows_to_compare.high))) - return "max_extra_rows_to_compare: integer|Long expected"; - if (message.update_table_stats != null && message.hasOwnProperty("update_table_stats")) - if (typeof message.update_table_stats !== "boolean") - return "update_table_stats: boolean expected"; - if (message.max_diff_seconds != null && message.hasOwnProperty("max_diff_seconds")) - if (!$util.isInteger(message.max_diff_seconds) && !(message.max_diff_seconds && $util.isInteger(message.max_diff_seconds.low) && $util.isInteger(message.max_diff_seconds.high))) - return "max_diff_seconds: integer|Long expected"; - return null; - }; - - /** - * Creates a VDiffCoreOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tabletmanagerdata.VDiffCoreOptions - * @static - * @param {Object.} object Plain object - * @returns {tabletmanagerdata.VDiffCoreOptions} VDiffCoreOptions - */ - VDiffCoreOptions.fromObject = function fromObject(object) { - if (object instanceof $root.tabletmanagerdata.VDiffCoreOptions) - return object; - let message = new $root.tabletmanagerdata.VDiffCoreOptions(); - if (object.tables != null) - message.tables = String(object.tables); - if (object.auto_retry != null) - message.auto_retry = Boolean(object.auto_retry); - if (object.max_rows != null) - if ($util.Long) - (message.max_rows = $util.Long.fromValue(object.max_rows)).unsigned = false; - else if (typeof object.max_rows === "string") - message.max_rows = parseInt(object.max_rows, 10); - else if (typeof object.max_rows === "number") - message.max_rows = object.max_rows; - else if (typeof object.max_rows === "object") - message.max_rows = new $util.LongBits(object.max_rows.low >>> 0, object.max_rows.high >>> 0).toNumber(); - if (object.checksum != null) - message.checksum = Boolean(object.checksum); - if (object.sample_pct != null) - if ($util.Long) - (message.sample_pct = $util.Long.fromValue(object.sample_pct)).unsigned = false; - else if (typeof object.sample_pct === "string") - message.sample_pct = parseInt(object.sample_pct, 10); - else if (typeof object.sample_pct === "number") - message.sample_pct = object.sample_pct; - else if (typeof object.sample_pct === "object") - message.sample_pct = new $util.LongBits(object.sample_pct.low >>> 0, object.sample_pct.high >>> 0).toNumber(); - if (object.timeout_seconds != null) - if ($util.Long) - (message.timeout_seconds = $util.Long.fromValue(object.timeout_seconds)).unsigned = false; - else if (typeof object.timeout_seconds === "string") - message.timeout_seconds = parseInt(object.timeout_seconds, 10); - else if (typeof object.timeout_seconds === "number") - message.timeout_seconds = object.timeout_seconds; - else if (typeof object.timeout_seconds === "object") - message.timeout_seconds = new $util.LongBits(object.timeout_seconds.low >>> 0, object.timeout_seconds.high >>> 0).toNumber(); - if (object.max_extra_rows_to_compare != null) - if ($util.Long) - (message.max_extra_rows_to_compare = $util.Long.fromValue(object.max_extra_rows_to_compare)).unsigned = false; - else if (typeof object.max_extra_rows_to_compare === "string") - message.max_extra_rows_to_compare = parseInt(object.max_extra_rows_to_compare, 10); - else if (typeof object.max_extra_rows_to_compare === "number") - message.max_extra_rows_to_compare = object.max_extra_rows_to_compare; - else if (typeof object.max_extra_rows_to_compare === "object") - message.max_extra_rows_to_compare = new $util.LongBits(object.max_extra_rows_to_compare.low >>> 0, object.max_extra_rows_to_compare.high >>> 0).toNumber(); - if (object.update_table_stats != null) - message.update_table_stats = Boolean(object.update_table_stats); - if (object.max_diff_seconds != null) - if ($util.Long) - (message.max_diff_seconds = $util.Long.fromValue(object.max_diff_seconds)).unsigned = false; - else if (typeof object.max_diff_seconds === "string") - message.max_diff_seconds = parseInt(object.max_diff_seconds, 10); - else if (typeof object.max_diff_seconds === "number") - message.max_diff_seconds = object.max_diff_seconds; - else if (typeof object.max_diff_seconds === "object") - message.max_diff_seconds = new $util.LongBits(object.max_diff_seconds.low >>> 0, object.max_diff_seconds.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a VDiffCoreOptions message. Also converts values to other types if specified. + * Creates a plain object from an UpdateVReplicationWorkflowRequest message. Also converts values to other types if specified. * @function toObject - * @memberof tabletmanagerdata.VDiffCoreOptions + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest * @static - * @param {tabletmanagerdata.VDiffCoreOptions} message VDiffCoreOptions + * @param {tabletmanagerdata.UpdateVReplicationWorkflowRequest} message UpdateVReplicationWorkflowRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VDiffCoreOptions.toObject = function toObject(message, options) { + UpdateVReplicationWorkflowRequest.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; + if (options.arrays || options.defaults) { + object.cells = []; + object.tablet_types = []; + object.shards = []; + } if (options.defaults) { - object.tables = ""; - object.auto_retry = false; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.max_rows = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.max_rows = options.longs === String ? "0" : 0; - object.checksum = false; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.sample_pct = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sample_pct = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.timeout_seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timeout_seconds = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.max_extra_rows_to_compare = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.max_extra_rows_to_compare = options.longs === String ? "0" : 0; - object.update_table_stats = false; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.max_diff_seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.max_diff_seconds = options.longs === String ? "0" : 0; + object.workflow = ""; + object.tablet_selection_preference = options.enums === String ? "ANY" : 0; + object.on_ddl = options.enums === String ? "IGNORE" : 0; + object.state = options.enums === String ? "Unknown" : 0; + } + if (message.workflow != null && message.hasOwnProperty("workflow")) + object.workflow = message.workflow; + if (message.cells && message.cells.length) { + object.cells = []; + for (let j = 0; j < message.cells.length; ++j) + object.cells[j] = message.cells[j]; + } + if (message.tablet_types && message.tablet_types.length) { + object.tablet_types = []; + for (let j = 0; j < message.tablet_types.length; ++j) + object.tablet_types[j] = options.enums === String ? $root.topodata.TabletType[message.tablet_types[j]] === undefined ? message.tablet_types[j] : $root.topodata.TabletType[message.tablet_types[j]] : message.tablet_types[j]; + } + if (message.tablet_selection_preference != null && message.hasOwnProperty("tablet_selection_preference")) + object.tablet_selection_preference = options.enums === String ? $root.tabletmanagerdata.TabletSelectionPreference[message.tablet_selection_preference] === undefined ? message.tablet_selection_preference : $root.tabletmanagerdata.TabletSelectionPreference[message.tablet_selection_preference] : message.tablet_selection_preference; + if (message.on_ddl != null && message.hasOwnProperty("on_ddl")) + object.on_ddl = options.enums === String ? $root.binlogdata.OnDDLAction[message.on_ddl] === undefined ? message.on_ddl : $root.binlogdata.OnDDLAction[message.on_ddl] : message.on_ddl; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.binlogdata.VReplicationWorkflowState[message.state] === undefined ? message.state : $root.binlogdata.VReplicationWorkflowState[message.state] : message.state; + if (message.shards && message.shards.length) { + object.shards = []; + for (let j = 0; j < message.shards.length; ++j) + object.shards[j] = message.shards[j]; } - if (message.tables != null && message.hasOwnProperty("tables")) - object.tables = message.tables; - if (message.auto_retry != null && message.hasOwnProperty("auto_retry")) - object.auto_retry = message.auto_retry; - if (message.max_rows != null && message.hasOwnProperty("max_rows")) - if (typeof message.max_rows === "number") - object.max_rows = options.longs === String ? String(message.max_rows) : message.max_rows; - else - object.max_rows = options.longs === String ? $util.Long.prototype.toString.call(message.max_rows) : options.longs === Number ? new $util.LongBits(message.max_rows.low >>> 0, message.max_rows.high >>> 0).toNumber() : message.max_rows; - if (message.checksum != null && message.hasOwnProperty("checksum")) - object.checksum = message.checksum; - if (message.sample_pct != null && message.hasOwnProperty("sample_pct")) - if (typeof message.sample_pct === "number") - object.sample_pct = options.longs === String ? String(message.sample_pct) : message.sample_pct; - else - object.sample_pct = options.longs === String ? $util.Long.prototype.toString.call(message.sample_pct) : options.longs === Number ? new $util.LongBits(message.sample_pct.low >>> 0, message.sample_pct.high >>> 0).toNumber() : message.sample_pct; - if (message.timeout_seconds != null && message.hasOwnProperty("timeout_seconds")) - if (typeof message.timeout_seconds === "number") - object.timeout_seconds = options.longs === String ? String(message.timeout_seconds) : message.timeout_seconds; - else - object.timeout_seconds = options.longs === String ? $util.Long.prototype.toString.call(message.timeout_seconds) : options.longs === Number ? new $util.LongBits(message.timeout_seconds.low >>> 0, message.timeout_seconds.high >>> 0).toNumber() : message.timeout_seconds; - if (message.max_extra_rows_to_compare != null && message.hasOwnProperty("max_extra_rows_to_compare")) - if (typeof message.max_extra_rows_to_compare === "number") - object.max_extra_rows_to_compare = options.longs === String ? String(message.max_extra_rows_to_compare) : message.max_extra_rows_to_compare; - else - object.max_extra_rows_to_compare = options.longs === String ? $util.Long.prototype.toString.call(message.max_extra_rows_to_compare) : options.longs === Number ? new $util.LongBits(message.max_extra_rows_to_compare.low >>> 0, message.max_extra_rows_to_compare.high >>> 0).toNumber() : message.max_extra_rows_to_compare; - if (message.update_table_stats != null && message.hasOwnProperty("update_table_stats")) - object.update_table_stats = message.update_table_stats; - if (message.max_diff_seconds != null && message.hasOwnProperty("max_diff_seconds")) - if (typeof message.max_diff_seconds === "number") - object.max_diff_seconds = options.longs === String ? String(message.max_diff_seconds) : message.max_diff_seconds; - else - object.max_diff_seconds = options.longs === String ? $util.Long.prototype.toString.call(message.max_diff_seconds) : options.longs === Number ? new $util.LongBits(message.max_diff_seconds.low >>> 0, message.max_diff_seconds.high >>> 0).toNumber() : message.max_diff_seconds; return object; }; /** - * Converts this VDiffCoreOptions to JSON. + * Converts this UpdateVReplicationWorkflowRequest to JSON. * @function toJSON - * @memberof tabletmanagerdata.VDiffCoreOptions + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest * @instance * @returns {Object.} JSON object */ - VDiffCoreOptions.prototype.toJSON = function toJSON() { + UpdateVReplicationWorkflowRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for VDiffCoreOptions + * Gets the default type url for UpdateVReplicationWorkflowRequest * @function getTypeUrl - * @memberof tabletmanagerdata.VDiffCoreOptions + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - VDiffCoreOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateVReplicationWorkflowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/tabletmanagerdata.VDiffCoreOptions"; + return typeUrlPrefix + "/tabletmanagerdata.UpdateVReplicationWorkflowRequest"; }; - return VDiffCoreOptions; + return UpdateVReplicationWorkflowRequest; })(); - tabletmanagerdata.VDiffOptions = (function() { + tabletmanagerdata.UpdateVReplicationWorkflowResponse = (function() { /** - * Properties of a VDiffOptions. + * Properties of an UpdateVReplicationWorkflowResponse. * @memberof tabletmanagerdata - * @interface IVDiffOptions - * @property {tabletmanagerdata.IVDiffPickerOptions|null} [picker_options] VDiffOptions picker_options - * @property {tabletmanagerdata.IVDiffCoreOptions|null} [core_options] VDiffOptions core_options - * @property {tabletmanagerdata.IVDiffReportOptions|null} [report_options] VDiffOptions report_options + * @interface IUpdateVReplicationWorkflowResponse + * @property {query.IQueryResult|null} [result] UpdateVReplicationWorkflowResponse result */ /** - * Constructs a new VDiffOptions. + * Constructs a new UpdateVReplicationWorkflowResponse. * @memberof tabletmanagerdata - * @classdesc Represents a VDiffOptions. - * @implements IVDiffOptions + * @classdesc Represents an UpdateVReplicationWorkflowResponse. + * @implements IUpdateVReplicationWorkflowResponse * @constructor - * @param {tabletmanagerdata.IVDiffOptions=} [properties] Properties to set + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowResponse=} [properties] Properties to set */ - function VDiffOptions(properties) { + function UpdateVReplicationWorkflowResponse(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -66437,103 +68375,75 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { } /** - * VDiffOptions picker_options. - * @member {tabletmanagerdata.IVDiffPickerOptions|null|undefined} picker_options - * @memberof tabletmanagerdata.VDiffOptions - * @instance - */ - VDiffOptions.prototype.picker_options = null; - - /** - * VDiffOptions core_options. - * @member {tabletmanagerdata.IVDiffCoreOptions|null|undefined} core_options - * @memberof tabletmanagerdata.VDiffOptions - * @instance - */ - VDiffOptions.prototype.core_options = null; - - /** - * VDiffOptions report_options. - * @member {tabletmanagerdata.IVDiffReportOptions|null|undefined} report_options - * @memberof tabletmanagerdata.VDiffOptions + * UpdateVReplicationWorkflowResponse result. + * @member {query.IQueryResult|null|undefined} result + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse * @instance */ - VDiffOptions.prototype.report_options = null; + UpdateVReplicationWorkflowResponse.prototype.result = null; /** - * Creates a new VDiffOptions instance using the specified properties. + * Creates a new UpdateVReplicationWorkflowResponse instance using the specified properties. * @function create - * @memberof tabletmanagerdata.VDiffOptions + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse * @static - * @param {tabletmanagerdata.IVDiffOptions=} [properties] Properties to set - * @returns {tabletmanagerdata.VDiffOptions} VDiffOptions instance + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowResponse=} [properties] Properties to set + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowResponse} UpdateVReplicationWorkflowResponse instance */ - VDiffOptions.create = function create(properties) { - return new VDiffOptions(properties); + UpdateVReplicationWorkflowResponse.create = function create(properties) { + return new UpdateVReplicationWorkflowResponse(properties); }; /** - * Encodes the specified VDiffOptions message. Does not implicitly {@link tabletmanagerdata.VDiffOptions.verify|verify} messages. + * Encodes the specified UpdateVReplicationWorkflowResponse message. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowResponse.verify|verify} messages. * @function encode - * @memberof tabletmanagerdata.VDiffOptions + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse * @static - * @param {tabletmanagerdata.IVDiffOptions} message VDiffOptions message or plain object to encode + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowResponse} message UpdateVReplicationWorkflowResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VDiffOptions.encode = function encode(message, writer) { + UpdateVReplicationWorkflowResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.picker_options != null && Object.hasOwnProperty.call(message, "picker_options")) - $root.tabletmanagerdata.VDiffPickerOptions.encode(message.picker_options, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.core_options != null && Object.hasOwnProperty.call(message, "core_options")) - $root.tabletmanagerdata.VDiffCoreOptions.encode(message.core_options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.report_options != null && Object.hasOwnProperty.call(message, "report_options")) - $root.tabletmanagerdata.VDiffReportOptions.encode(message.report_options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.query.QueryResult.encode(message.result, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified VDiffOptions message, length delimited. Does not implicitly {@link tabletmanagerdata.VDiffOptions.verify|verify} messages. + * Encodes the specified UpdateVReplicationWorkflowResponse message, length delimited. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowResponse.verify|verify} messages. * @function encodeDelimited - * @memberof tabletmanagerdata.VDiffOptions + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse * @static - * @param {tabletmanagerdata.IVDiffOptions} message VDiffOptions message or plain object to encode + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowResponse} message UpdateVReplicationWorkflowResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VDiffOptions.encodeDelimited = function encodeDelimited(message, writer) { + UpdateVReplicationWorkflowResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VDiffOptions message from the specified reader or buffer. + * Decodes an UpdateVReplicationWorkflowResponse message from the specified reader or buffer. * @function decode - * @memberof tabletmanagerdata.VDiffOptions + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {tabletmanagerdata.VDiffOptions} VDiffOptions + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowResponse} UpdateVReplicationWorkflowResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VDiffOptions.decode = function decode(reader, length) { + UpdateVReplicationWorkflowResponse.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.tabletmanagerdata.VDiffOptions(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tabletmanagerdata.UpdateVReplicationWorkflowResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.picker_options = $root.tabletmanagerdata.VDiffPickerOptions.decode(reader, reader.uint32()); - break; - } - case 2: { - message.core_options = $root.tabletmanagerdata.VDiffCoreOptions.decode(reader, reader.uint32()); - break; - } - case 3: { - message.report_options = $root.tabletmanagerdata.VDiffReportOptions.decode(reader, reader.uint32()); + message.result = $root.query.QueryResult.decode(reader, reader.uint32()); break; } default: @@ -66545,163 +68455,134 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { }; /** - * Decodes a VDiffOptions message from the specified reader or buffer, length delimited. + * Decodes an UpdateVReplicationWorkflowResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof tabletmanagerdata.VDiffOptions + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tabletmanagerdata.VDiffOptions} VDiffOptions + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowResponse} UpdateVReplicationWorkflowResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VDiffOptions.decodeDelimited = function decodeDelimited(reader) { + UpdateVReplicationWorkflowResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VDiffOptions message. + * Verifies an UpdateVReplicationWorkflowResponse message. * @function verify - * @memberof tabletmanagerdata.VDiffOptions + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VDiffOptions.verify = function verify(message) { + UpdateVReplicationWorkflowResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.picker_options != null && message.hasOwnProperty("picker_options")) { - let error = $root.tabletmanagerdata.VDiffPickerOptions.verify(message.picker_options); - if (error) - return "picker_options." + error; - } - if (message.core_options != null && message.hasOwnProperty("core_options")) { - let error = $root.tabletmanagerdata.VDiffCoreOptions.verify(message.core_options); - if (error) - return "core_options." + error; - } - if (message.report_options != null && message.hasOwnProperty("report_options")) { - let error = $root.tabletmanagerdata.VDiffReportOptions.verify(message.report_options); + if (message.result != null && message.hasOwnProperty("result")) { + let error = $root.query.QueryResult.verify(message.result); if (error) - return "report_options." + error; + return "result." + error; } return null; }; /** - * Creates a VDiffOptions message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateVReplicationWorkflowResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof tabletmanagerdata.VDiffOptions + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse * @static * @param {Object.} object Plain object - * @returns {tabletmanagerdata.VDiffOptions} VDiffOptions + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowResponse} UpdateVReplicationWorkflowResponse */ - VDiffOptions.fromObject = function fromObject(object) { - if (object instanceof $root.tabletmanagerdata.VDiffOptions) + UpdateVReplicationWorkflowResponse.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.UpdateVReplicationWorkflowResponse) return object; - let message = new $root.tabletmanagerdata.VDiffOptions(); - if (object.picker_options != null) { - if (typeof object.picker_options !== "object") - throw TypeError(".tabletmanagerdata.VDiffOptions.picker_options: object expected"); - message.picker_options = $root.tabletmanagerdata.VDiffPickerOptions.fromObject(object.picker_options); - } - if (object.core_options != null) { - if (typeof object.core_options !== "object") - throw TypeError(".tabletmanagerdata.VDiffOptions.core_options: object expected"); - message.core_options = $root.tabletmanagerdata.VDiffCoreOptions.fromObject(object.core_options); - } - if (object.report_options != null) { - if (typeof object.report_options !== "object") - throw TypeError(".tabletmanagerdata.VDiffOptions.report_options: object expected"); - message.report_options = $root.tabletmanagerdata.VDiffReportOptions.fromObject(object.report_options); + let message = new $root.tabletmanagerdata.UpdateVReplicationWorkflowResponse(); + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".tabletmanagerdata.UpdateVReplicationWorkflowResponse.result: object expected"); + message.result = $root.query.QueryResult.fromObject(object.result); } return message; }; /** - * Creates a plain object from a VDiffOptions message. Also converts values to other types if specified. + * Creates a plain object from an UpdateVReplicationWorkflowResponse message. Also converts values to other types if specified. * @function toObject - * @memberof tabletmanagerdata.VDiffOptions + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse * @static - * @param {tabletmanagerdata.VDiffOptions} message VDiffOptions + * @param {tabletmanagerdata.UpdateVReplicationWorkflowResponse} message UpdateVReplicationWorkflowResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VDiffOptions.toObject = function toObject(message, options) { + UpdateVReplicationWorkflowResponse.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.defaults) { - object.picker_options = null; - object.core_options = null; - object.report_options = null; - } - if (message.picker_options != null && message.hasOwnProperty("picker_options")) - object.picker_options = $root.tabletmanagerdata.VDiffPickerOptions.toObject(message.picker_options, options); - if (message.core_options != null && message.hasOwnProperty("core_options")) - object.core_options = $root.tabletmanagerdata.VDiffCoreOptions.toObject(message.core_options, options); - if (message.report_options != null && message.hasOwnProperty("report_options")) - object.report_options = $root.tabletmanagerdata.VDiffReportOptions.toObject(message.report_options, options); + if (options.defaults) + object.result = null; + if (message.result != null && message.hasOwnProperty("result")) + object.result = $root.query.QueryResult.toObject(message.result, options); return object; }; /** - * Converts this VDiffOptions to JSON. + * Converts this UpdateVReplicationWorkflowResponse to JSON. * @function toJSON - * @memberof tabletmanagerdata.VDiffOptions + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse * @instance * @returns {Object.} JSON object */ - VDiffOptions.prototype.toJSON = function toJSON() { + UpdateVReplicationWorkflowResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for VDiffOptions + * Gets the default type url for UpdateVReplicationWorkflowResponse * @function getTypeUrl - * @memberof tabletmanagerdata.VDiffOptions + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - VDiffOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateVReplicationWorkflowResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/tabletmanagerdata.VDiffOptions"; + return typeUrlPrefix + "/tabletmanagerdata.UpdateVReplicationWorkflowResponse"; }; - return VDiffOptions; + return UpdateVReplicationWorkflowResponse; })(); - tabletmanagerdata.UpdateVReplicationWorkflowRequest = (function() { + tabletmanagerdata.UpdateVReplicationWorkflowsRequest = (function() { /** - * Properties of an UpdateVReplicationWorkflowRequest. + * Properties of an UpdateVReplicationWorkflowsRequest. * @memberof tabletmanagerdata - * @interface IUpdateVReplicationWorkflowRequest - * @property {string|null} [workflow] UpdateVReplicationWorkflowRequest workflow - * @property {Array.|null} [cells] UpdateVReplicationWorkflowRequest cells - * @property {Array.|null} [tablet_types] UpdateVReplicationWorkflowRequest tablet_types - * @property {tabletmanagerdata.TabletSelectionPreference|null} [tablet_selection_preference] UpdateVReplicationWorkflowRequest tablet_selection_preference - * @property {binlogdata.OnDDLAction|null} [on_ddl] UpdateVReplicationWorkflowRequest on_ddl - * @property {binlogdata.VReplicationWorkflowState|null} [state] UpdateVReplicationWorkflowRequest state - * @property {Array.|null} [shards] UpdateVReplicationWorkflowRequest shards + * @interface IUpdateVReplicationWorkflowsRequest + * @property {boolean|null} [all_workflows] UpdateVReplicationWorkflowsRequest all_workflows + * @property {Array.|null} [include_workflows] UpdateVReplicationWorkflowsRequest include_workflows + * @property {Array.|null} [exclude_workflows] UpdateVReplicationWorkflowsRequest exclude_workflows + * @property {binlogdata.VReplicationWorkflowState|null} [state] UpdateVReplicationWorkflowsRequest state + * @property {string|null} [message] UpdateVReplicationWorkflowsRequest message + * @property {string|null} [stop_position] UpdateVReplicationWorkflowsRequest stop_position */ /** - * Constructs a new UpdateVReplicationWorkflowRequest. + * Constructs a new UpdateVReplicationWorkflowsRequest. * @memberof tabletmanagerdata - * @classdesc Represents an UpdateVReplicationWorkflowRequest. - * @implements IUpdateVReplicationWorkflowRequest + * @classdesc Represents an UpdateVReplicationWorkflowsRequest. + * @implements IUpdateVReplicationWorkflowsRequest * @constructor - * @param {tabletmanagerdata.IUpdateVReplicationWorkflowRequest=} [properties] Properties to set + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsRequest=} [properties] Properties to set */ - function UpdateVReplicationWorkflowRequest(properties) { - this.cells = []; - this.tablet_types = []; - this.shards = []; + function UpdateVReplicationWorkflowsRequest(properties) { + this.include_workflows = []; + this.exclude_workflows = []; if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -66709,263 +68590,205 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { } /** - * UpdateVReplicationWorkflowRequest workflow. - * @member {string} workflow - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest - * @instance - */ - UpdateVReplicationWorkflowRequest.prototype.workflow = ""; - - /** - * UpdateVReplicationWorkflowRequest cells. - * @member {Array.} cells - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest + * UpdateVReplicationWorkflowsRequest all_workflows. + * @member {boolean} all_workflows + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @instance */ - UpdateVReplicationWorkflowRequest.prototype.cells = $util.emptyArray; + UpdateVReplicationWorkflowsRequest.prototype.all_workflows = false; /** - * UpdateVReplicationWorkflowRequest tablet_types. - * @member {Array.} tablet_types - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest + * UpdateVReplicationWorkflowsRequest include_workflows. + * @member {Array.} include_workflows + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @instance */ - UpdateVReplicationWorkflowRequest.prototype.tablet_types = $util.emptyArray; + UpdateVReplicationWorkflowsRequest.prototype.include_workflows = $util.emptyArray; /** - * UpdateVReplicationWorkflowRequest tablet_selection_preference. - * @member {tabletmanagerdata.TabletSelectionPreference} tablet_selection_preference - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest + * UpdateVReplicationWorkflowsRequest exclude_workflows. + * @member {Array.} exclude_workflows + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @instance */ - UpdateVReplicationWorkflowRequest.prototype.tablet_selection_preference = 0; + UpdateVReplicationWorkflowsRequest.prototype.exclude_workflows = $util.emptyArray; /** - * UpdateVReplicationWorkflowRequest on_ddl. - * @member {binlogdata.OnDDLAction} on_ddl - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest + * UpdateVReplicationWorkflowsRequest state. + * @member {binlogdata.VReplicationWorkflowState} state + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @instance */ - UpdateVReplicationWorkflowRequest.prototype.on_ddl = 0; + UpdateVReplicationWorkflowsRequest.prototype.state = 0; /** - * UpdateVReplicationWorkflowRequest state. - * @member {binlogdata.VReplicationWorkflowState} state - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest + * UpdateVReplicationWorkflowsRequest message. + * @member {string} message + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @instance */ - UpdateVReplicationWorkflowRequest.prototype.state = 0; + UpdateVReplicationWorkflowsRequest.prototype.message = ""; /** - * UpdateVReplicationWorkflowRequest shards. - * @member {Array.} shards - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest + * UpdateVReplicationWorkflowsRequest stop_position. + * @member {string} stop_position + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @instance */ - UpdateVReplicationWorkflowRequest.prototype.shards = $util.emptyArray; + UpdateVReplicationWorkflowsRequest.prototype.stop_position = ""; /** - * Creates a new UpdateVReplicationWorkflowRequest instance using the specified properties. + * Creates a new UpdateVReplicationWorkflowsRequest instance using the specified properties. * @function create - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @static - * @param {tabletmanagerdata.IUpdateVReplicationWorkflowRequest=} [properties] Properties to set - * @returns {tabletmanagerdata.UpdateVReplicationWorkflowRequest} UpdateVReplicationWorkflowRequest instance + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsRequest=} [properties] Properties to set + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsRequest} UpdateVReplicationWorkflowsRequest instance */ - UpdateVReplicationWorkflowRequest.create = function create(properties) { - return new UpdateVReplicationWorkflowRequest(properties); + UpdateVReplicationWorkflowsRequest.create = function create(properties) { + return new UpdateVReplicationWorkflowsRequest(properties); }; /** - * Encodes the specified UpdateVReplicationWorkflowRequest message. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowRequest.verify|verify} messages. + * Encodes the specified UpdateVReplicationWorkflowsRequest message. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsRequest.verify|verify} messages. * @function encode - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @static - * @param {tabletmanagerdata.IUpdateVReplicationWorkflowRequest} message UpdateVReplicationWorkflowRequest message or plain object to encode + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsRequest} message UpdateVReplicationWorkflowsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateVReplicationWorkflowRequest.encode = function encode(message, writer) { + UpdateVReplicationWorkflowsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.workflow != null && Object.hasOwnProperty.call(message, "workflow")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.workflow); - if (message.cells != null && message.cells.length) - for (let i = 0; i < message.cells.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.cells[i]); - if (message.tablet_types != null && message.tablet_types.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (let i = 0; i < message.tablet_types.length; ++i) - writer.int32(message.tablet_types[i]); - writer.ldelim(); - } - if (message.tablet_selection_preference != null && Object.hasOwnProperty.call(message, "tablet_selection_preference")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.tablet_selection_preference); - if (message.on_ddl != null && Object.hasOwnProperty.call(message, "on_ddl")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.on_ddl); + if (message.all_workflows != null && Object.hasOwnProperty.call(message, "all_workflows")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.all_workflows); + if (message.include_workflows != null && message.include_workflows.length) + for (let i = 0; i < message.include_workflows.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.include_workflows[i]); + if (message.exclude_workflows != null && message.exclude_workflows.length) + for (let i = 0; i < message.exclude_workflows.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exclude_workflows[i]); if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); - if (message.shards != null && message.shards.length) - for (let i = 0; i < message.shards.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.shards[i]); + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.message); + if (message.stop_position != null && Object.hasOwnProperty.call(message, "stop_position")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.stop_position); return writer; }; /** - * Encodes the specified UpdateVReplicationWorkflowRequest message, length delimited. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowRequest.verify|verify} messages. + * Encodes the specified UpdateVReplicationWorkflowsRequest message, length delimited. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @static - * @param {tabletmanagerdata.IUpdateVReplicationWorkflowRequest} message UpdateVReplicationWorkflowRequest message or plain object to encode + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsRequest} message UpdateVReplicationWorkflowsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateVReplicationWorkflowRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateVReplicationWorkflowsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateVReplicationWorkflowRequest message from the specified reader or buffer. + * Decodes an UpdateVReplicationWorkflowsRequest message from the specified reader or buffer. * @function decode - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {tabletmanagerdata.UpdateVReplicationWorkflowRequest} UpdateVReplicationWorkflowRequest + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsRequest} UpdateVReplicationWorkflowsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateVReplicationWorkflowRequest.decode = function decode(reader, length) { + UpdateVReplicationWorkflowsRequest.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.tabletmanagerdata.UpdateVReplicationWorkflowRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tabletmanagerdata.UpdateVReplicationWorkflowsRequest(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.workflow = reader.string(); + message.all_workflows = reader.bool(); break; } case 2: { - if (!(message.cells && message.cells.length)) - message.cells = []; - message.cells.push(reader.string()); + if (!(message.include_workflows && message.include_workflows.length)) + message.include_workflows = []; + message.include_workflows.push(reader.string()); break; } case 3: { - if (!(message.tablet_types && message.tablet_types.length)) - message.tablet_types = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.tablet_types.push(reader.int32()); - } else - message.tablet_types.push(reader.int32()); + if (!(message.exclude_workflows && message.exclude_workflows.length)) + message.exclude_workflows = []; + message.exclude_workflows.push(reader.string()); break; } case 4: { - message.tablet_selection_preference = reader.int32(); + message.state = reader.int32(); break; } case 5: { - message.on_ddl = reader.int32(); + message.message = reader.string(); break; } case 6: { - message.state = reader.int32(); - break; - } - case 7: { - if (!(message.shards && message.shards.length)) - message.shards = []; - message.shards.push(reader.string()); + message.stop_position = reader.string(); break; } default: reader.skipType(tag & 7); break; } - } - return message; - }; - - /** - * Decodes an UpdateVReplicationWorkflowRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tabletmanagerdata.UpdateVReplicationWorkflowRequest} UpdateVReplicationWorkflowRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateVReplicationWorkflowRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateVReplicationWorkflowRequest message. - * @function verify - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateVReplicationWorkflowRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.workflow != null && message.hasOwnProperty("workflow")) - if (!$util.isString(message.workflow)) - return "workflow: string expected"; - if (message.cells != null && message.hasOwnProperty("cells")) { - if (!Array.isArray(message.cells)) - return "cells: array expected"; - for (let i = 0; i < message.cells.length; ++i) - if (!$util.isString(message.cells[i])) - return "cells: string[] expected"; - } - if (message.tablet_types != null && message.hasOwnProperty("tablet_types")) { - if (!Array.isArray(message.tablet_types)) - return "tablet_types: array expected"; - for (let i = 0; i < message.tablet_types.length; ++i) - switch (message.tablet_types[i]) { - default: - return "tablet_types: enum value[] expected"; - case 0: - case 1: - case 1: - case 2: - case 3: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - } - if (message.tablet_selection_preference != null && message.hasOwnProperty("tablet_selection_preference")) - switch (message.tablet_selection_preference) { - default: - return "tablet_selection_preference: enum value expected"; - case 0: - case 1: - case 3: - break; - } - if (message.on_ddl != null && message.hasOwnProperty("on_ddl")) - switch (message.on_ddl) { - default: - return "on_ddl: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } + } + return message; + }; + + /** + * Decodes an UpdateVReplicationWorkflowsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsRequest} UpdateVReplicationWorkflowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateVReplicationWorkflowsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateVReplicationWorkflowsRequest message. + * @function verify + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateVReplicationWorkflowsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.all_workflows != null && message.hasOwnProperty("all_workflows")) + if (typeof message.all_workflows !== "boolean") + return "all_workflows: boolean expected"; + if (message.include_workflows != null && message.hasOwnProperty("include_workflows")) { + if (!Array.isArray(message.include_workflows)) + return "include_workflows: array expected"; + for (let i = 0; i < message.include_workflows.length; ++i) + if (!$util.isString(message.include_workflows[i])) + return "include_workflows: string[] expected"; + } + if (message.exclude_workflows != null && message.hasOwnProperty("exclude_workflows")) { + if (!Array.isArray(message.exclude_workflows)) + return "exclude_workflows: array expected"; + for (let i = 0; i < message.exclude_workflows.length; ++i) + if (!$util.isString(message.exclude_workflows[i])) + return "exclude_workflows: string[] expected"; + } if (message.state != null && message.hasOwnProperty("state")) switch (message.state) { default: @@ -66979,137 +68802,42 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { case 6: break; } - if (message.shards != null && message.hasOwnProperty("shards")) { - if (!Array.isArray(message.shards)) - return "shards: array expected"; - for (let i = 0; i < message.shards.length; ++i) - if (!$util.isString(message.shards[i])) - return "shards: string[] expected"; - } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.stop_position != null && message.hasOwnProperty("stop_position")) + if (!$util.isString(message.stop_position)) + return "stop_position: string expected"; return null; }; /** - * Creates an UpdateVReplicationWorkflowRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateVReplicationWorkflowsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @static * @param {Object.} object Plain object - * @returns {tabletmanagerdata.UpdateVReplicationWorkflowRequest} UpdateVReplicationWorkflowRequest + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsRequest} UpdateVReplicationWorkflowsRequest */ - UpdateVReplicationWorkflowRequest.fromObject = function fromObject(object) { - if (object instanceof $root.tabletmanagerdata.UpdateVReplicationWorkflowRequest) + UpdateVReplicationWorkflowsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.UpdateVReplicationWorkflowsRequest) return object; - let message = new $root.tabletmanagerdata.UpdateVReplicationWorkflowRequest(); - if (object.workflow != null) - message.workflow = String(object.workflow); - if (object.cells) { - if (!Array.isArray(object.cells)) - throw TypeError(".tabletmanagerdata.UpdateVReplicationWorkflowRequest.cells: array expected"); - message.cells = []; - for (let i = 0; i < object.cells.length; ++i) - message.cells[i] = String(object.cells[i]); - } - if (object.tablet_types) { - if (!Array.isArray(object.tablet_types)) - throw TypeError(".tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_types: array expected"); - message.tablet_types = []; - for (let i = 0; i < object.tablet_types.length; ++i) - switch (object.tablet_types[i]) { - default: - if (typeof object.tablet_types[i] === "number") { - message.tablet_types[i] = object.tablet_types[i]; - break; - } - case "UNKNOWN": - case 0: - message.tablet_types[i] = 0; - break; - case "PRIMARY": - case 1: - message.tablet_types[i] = 1; - break; - case "MASTER": - case 1: - message.tablet_types[i] = 1; - break; - case "REPLICA": - case 2: - message.tablet_types[i] = 2; - break; - case "RDONLY": - case 3: - message.tablet_types[i] = 3; - break; - case "BATCH": - case 3: - message.tablet_types[i] = 3; - break; - case "SPARE": - case 4: - message.tablet_types[i] = 4; - break; - case "EXPERIMENTAL": - case 5: - message.tablet_types[i] = 5; - break; - case "BACKUP": - case 6: - message.tablet_types[i] = 6; - break; - case "RESTORE": - case 7: - message.tablet_types[i] = 7; - break; - case "DRAINED": - case 8: - message.tablet_types[i] = 8; - break; - } - } - switch (object.tablet_selection_preference) { - default: - if (typeof object.tablet_selection_preference === "number") { - message.tablet_selection_preference = object.tablet_selection_preference; - break; - } - break; - case "ANY": - case 0: - message.tablet_selection_preference = 0; - break; - case "INORDER": - case 1: - message.tablet_selection_preference = 1; - break; - case "UNKNOWN": - case 3: - message.tablet_selection_preference = 3; - break; + let message = new $root.tabletmanagerdata.UpdateVReplicationWorkflowsRequest(); + if (object.all_workflows != null) + message.all_workflows = Boolean(object.all_workflows); + if (object.include_workflows) { + if (!Array.isArray(object.include_workflows)) + throw TypeError(".tabletmanagerdata.UpdateVReplicationWorkflowsRequest.include_workflows: array expected"); + message.include_workflows = []; + for (let i = 0; i < object.include_workflows.length; ++i) + message.include_workflows[i] = String(object.include_workflows[i]); } - switch (object.on_ddl) { - default: - if (typeof object.on_ddl === "number") { - message.on_ddl = object.on_ddl; - break; - } - break; - case "IGNORE": - case 0: - message.on_ddl = 0; - break; - case "STOP": - case 1: - message.on_ddl = 1; - break; - case "EXEC": - case 2: - message.on_ddl = 2; - break; - case "EXEC_IGNORE": - case 3: - message.on_ddl = 3; - break; + if (object.exclude_workflows) { + if (!Array.isArray(object.exclude_workflows)) + throw TypeError(".tabletmanagerdata.UpdateVReplicationWorkflowsRequest.exclude_workflows: array expected"); + message.exclude_workflows = []; + for (let i = 0; i < object.exclude_workflows.length; ++i) + message.exclude_workflows[i] = String(object.exclude_workflows[i]); } switch (object.state) { default: @@ -67147,113 +68875,104 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { message.state = 6; break; } - if (object.shards) { - if (!Array.isArray(object.shards)) - throw TypeError(".tabletmanagerdata.UpdateVReplicationWorkflowRequest.shards: array expected"); - message.shards = []; - for (let i = 0; i < object.shards.length; ++i) - message.shards[i] = String(object.shards[i]); - } + if (object.message != null) + message.message = String(object.message); + if (object.stop_position != null) + message.stop_position = String(object.stop_position); return message; }; /** - * Creates a plain object from an UpdateVReplicationWorkflowRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateVReplicationWorkflowsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @static - * @param {tabletmanagerdata.UpdateVReplicationWorkflowRequest} message UpdateVReplicationWorkflowRequest + * @param {tabletmanagerdata.UpdateVReplicationWorkflowsRequest} message UpdateVReplicationWorkflowsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateVReplicationWorkflowRequest.toObject = function toObject(message, options) { + UpdateVReplicationWorkflowsRequest.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; if (options.arrays || options.defaults) { - object.cells = []; - object.tablet_types = []; - object.shards = []; + object.include_workflows = []; + object.exclude_workflows = []; } if (options.defaults) { - object.workflow = ""; - object.tablet_selection_preference = options.enums === String ? "ANY" : 0; - object.on_ddl = options.enums === String ? "IGNORE" : 0; + object.all_workflows = false; object.state = options.enums === String ? "Unknown" : 0; + object.message = ""; + object.stop_position = ""; } - if (message.workflow != null && message.hasOwnProperty("workflow")) - object.workflow = message.workflow; - if (message.cells && message.cells.length) { - object.cells = []; - for (let j = 0; j < message.cells.length; ++j) - object.cells[j] = message.cells[j]; + if (message.all_workflows != null && message.hasOwnProperty("all_workflows")) + object.all_workflows = message.all_workflows; + if (message.include_workflows && message.include_workflows.length) { + object.include_workflows = []; + for (let j = 0; j < message.include_workflows.length; ++j) + object.include_workflows[j] = message.include_workflows[j]; } - if (message.tablet_types && message.tablet_types.length) { - object.tablet_types = []; - for (let j = 0; j < message.tablet_types.length; ++j) - object.tablet_types[j] = options.enums === String ? $root.topodata.TabletType[message.tablet_types[j]] === undefined ? message.tablet_types[j] : $root.topodata.TabletType[message.tablet_types[j]] : message.tablet_types[j]; + if (message.exclude_workflows && message.exclude_workflows.length) { + object.exclude_workflows = []; + for (let j = 0; j < message.exclude_workflows.length; ++j) + object.exclude_workflows[j] = message.exclude_workflows[j]; } - if (message.tablet_selection_preference != null && message.hasOwnProperty("tablet_selection_preference")) - object.tablet_selection_preference = options.enums === String ? $root.tabletmanagerdata.TabletSelectionPreference[message.tablet_selection_preference] === undefined ? message.tablet_selection_preference : $root.tabletmanagerdata.TabletSelectionPreference[message.tablet_selection_preference] : message.tablet_selection_preference; - if (message.on_ddl != null && message.hasOwnProperty("on_ddl")) - object.on_ddl = options.enums === String ? $root.binlogdata.OnDDLAction[message.on_ddl] === undefined ? message.on_ddl : $root.binlogdata.OnDDLAction[message.on_ddl] : message.on_ddl; if (message.state != null && message.hasOwnProperty("state")) object.state = options.enums === String ? $root.binlogdata.VReplicationWorkflowState[message.state] === undefined ? message.state : $root.binlogdata.VReplicationWorkflowState[message.state] : message.state; - if (message.shards && message.shards.length) { - object.shards = []; - for (let j = 0; j < message.shards.length; ++j) - object.shards[j] = message.shards[j]; - } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.stop_position != null && message.hasOwnProperty("stop_position")) + object.stop_position = message.stop_position; return object; }; /** - * Converts this UpdateVReplicationWorkflowRequest to JSON. + * Converts this UpdateVReplicationWorkflowsRequest to JSON. * @function toJSON - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @instance * @returns {Object.} JSON object */ - UpdateVReplicationWorkflowRequest.prototype.toJSON = function toJSON() { + UpdateVReplicationWorkflowsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateVReplicationWorkflowRequest + * Gets the default type url for UpdateVReplicationWorkflowsRequest * @function getTypeUrl - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateVReplicationWorkflowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateVReplicationWorkflowsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/tabletmanagerdata.UpdateVReplicationWorkflowRequest"; + return typeUrlPrefix + "/tabletmanagerdata.UpdateVReplicationWorkflowsRequest"; }; - return UpdateVReplicationWorkflowRequest; + return UpdateVReplicationWorkflowsRequest; })(); - tabletmanagerdata.UpdateVReplicationWorkflowResponse = (function() { + tabletmanagerdata.UpdateVReplicationWorkflowsResponse = (function() { /** - * Properties of an UpdateVReplicationWorkflowResponse. + * Properties of an UpdateVReplicationWorkflowsResponse. * @memberof tabletmanagerdata - * @interface IUpdateVReplicationWorkflowResponse - * @property {query.IQueryResult|null} [result] UpdateVReplicationWorkflowResponse result + * @interface IUpdateVReplicationWorkflowsResponse + * @property {query.IQueryResult|null} [result] UpdateVReplicationWorkflowsResponse result */ /** - * Constructs a new UpdateVReplicationWorkflowResponse. + * Constructs a new UpdateVReplicationWorkflowsResponse. * @memberof tabletmanagerdata - * @classdesc Represents an UpdateVReplicationWorkflowResponse. - * @implements IUpdateVReplicationWorkflowResponse + * @classdesc Represents an UpdateVReplicationWorkflowsResponse. + * @implements IUpdateVReplicationWorkflowsResponse * @constructor - * @param {tabletmanagerdata.IUpdateVReplicationWorkflowResponse=} [properties] Properties to set + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsResponse=} [properties] Properties to set */ - function UpdateVReplicationWorkflowResponse(properties) { + function UpdateVReplicationWorkflowsResponse(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -67261,35 +68980,35 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { } /** - * UpdateVReplicationWorkflowResponse result. + * UpdateVReplicationWorkflowsResponse result. * @member {query.IQueryResult|null|undefined} result - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsResponse * @instance */ - UpdateVReplicationWorkflowResponse.prototype.result = null; + UpdateVReplicationWorkflowsResponse.prototype.result = null; /** - * Creates a new UpdateVReplicationWorkflowResponse instance using the specified properties. + * Creates a new UpdateVReplicationWorkflowsResponse instance using the specified properties. * @function create - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsResponse * @static - * @param {tabletmanagerdata.IUpdateVReplicationWorkflowResponse=} [properties] Properties to set - * @returns {tabletmanagerdata.UpdateVReplicationWorkflowResponse} UpdateVReplicationWorkflowResponse instance + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsResponse=} [properties] Properties to set + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsResponse} UpdateVReplicationWorkflowsResponse instance */ - UpdateVReplicationWorkflowResponse.create = function create(properties) { - return new UpdateVReplicationWorkflowResponse(properties); + UpdateVReplicationWorkflowsResponse.create = function create(properties) { + return new UpdateVReplicationWorkflowsResponse(properties); }; /** - * Encodes the specified UpdateVReplicationWorkflowResponse message. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowResponse.verify|verify} messages. + * Encodes the specified UpdateVReplicationWorkflowsResponse message. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsResponse.verify|verify} messages. * @function encode - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsResponse * @static - * @param {tabletmanagerdata.IUpdateVReplicationWorkflowResponse} message UpdateVReplicationWorkflowResponse message or plain object to encode + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsResponse} message UpdateVReplicationWorkflowsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateVReplicationWorkflowResponse.encode = function encode(message, writer) { + UpdateVReplicationWorkflowsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.result != null && Object.hasOwnProperty.call(message, "result")) @@ -67298,33 +69017,33 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { }; /** - * Encodes the specified UpdateVReplicationWorkflowResponse message, length delimited. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowResponse.verify|verify} messages. + * Encodes the specified UpdateVReplicationWorkflowsResponse message, length delimited. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsResponse * @static - * @param {tabletmanagerdata.IUpdateVReplicationWorkflowResponse} message UpdateVReplicationWorkflowResponse message or plain object to encode + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsResponse} message UpdateVReplicationWorkflowsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateVReplicationWorkflowResponse.encodeDelimited = function encodeDelimited(message, writer) { + UpdateVReplicationWorkflowsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateVReplicationWorkflowResponse message from the specified reader or buffer. + * Decodes an UpdateVReplicationWorkflowsResponse message from the specified reader or buffer. * @function decode - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {tabletmanagerdata.UpdateVReplicationWorkflowResponse} UpdateVReplicationWorkflowResponse + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsResponse} UpdateVReplicationWorkflowsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateVReplicationWorkflowResponse.decode = function decode(reader, length) { + UpdateVReplicationWorkflowsResponse.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.tabletmanagerdata.UpdateVReplicationWorkflowResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tabletmanagerdata.UpdateVReplicationWorkflowsResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { @@ -67341,30 +69060,30 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { }; /** - * Decodes an UpdateVReplicationWorkflowResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateVReplicationWorkflowsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tabletmanagerdata.UpdateVReplicationWorkflowResponse} UpdateVReplicationWorkflowResponse + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsResponse} UpdateVReplicationWorkflowsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateVReplicationWorkflowResponse.decodeDelimited = function decodeDelimited(reader) { + UpdateVReplicationWorkflowsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateVReplicationWorkflowResponse message. + * Verifies an UpdateVReplicationWorkflowsResponse message. * @function verify - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateVReplicationWorkflowResponse.verify = function verify(message) { + UpdateVReplicationWorkflowsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.result != null && message.hasOwnProperty("result")) { @@ -67376,35 +69095,35 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { }; /** - * Creates an UpdateVReplicationWorkflowResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateVReplicationWorkflowsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsResponse * @static * @param {Object.} object Plain object - * @returns {tabletmanagerdata.UpdateVReplicationWorkflowResponse} UpdateVReplicationWorkflowResponse + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsResponse} UpdateVReplicationWorkflowsResponse */ - UpdateVReplicationWorkflowResponse.fromObject = function fromObject(object) { - if (object instanceof $root.tabletmanagerdata.UpdateVReplicationWorkflowResponse) + UpdateVReplicationWorkflowsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.UpdateVReplicationWorkflowsResponse) return object; - let message = new $root.tabletmanagerdata.UpdateVReplicationWorkflowResponse(); + let message = new $root.tabletmanagerdata.UpdateVReplicationWorkflowsResponse(); if (object.result != null) { if (typeof object.result !== "object") - throw TypeError(".tabletmanagerdata.UpdateVReplicationWorkflowResponse.result: object expected"); + throw TypeError(".tabletmanagerdata.UpdateVReplicationWorkflowsResponse.result: object expected"); message.result = $root.query.QueryResult.fromObject(object.result); } return message; }; /** - * Creates a plain object from an UpdateVReplicationWorkflowResponse message. Also converts values to other types if specified. + * Creates a plain object from an UpdateVReplicationWorkflowsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsResponse * @static - * @param {tabletmanagerdata.UpdateVReplicationWorkflowResponse} message UpdateVReplicationWorkflowResponse + * @param {tabletmanagerdata.UpdateVReplicationWorkflowsResponse} message UpdateVReplicationWorkflowsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateVReplicationWorkflowResponse.toObject = function toObject(message, options) { + UpdateVReplicationWorkflowsResponse.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; @@ -67416,32 +69135,32 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { }; /** - * Converts this UpdateVReplicationWorkflowResponse to JSON. + * Converts this UpdateVReplicationWorkflowsResponse to JSON. * @function toJSON - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsResponse * @instance * @returns {Object.} JSON object */ - UpdateVReplicationWorkflowResponse.prototype.toJSON = function toJSON() { + UpdateVReplicationWorkflowsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateVReplicationWorkflowResponse + * Gets the default type url for UpdateVReplicationWorkflowsResponse * @function getTypeUrl - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowResponse + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateVReplicationWorkflowResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateVReplicationWorkflowsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/tabletmanagerdata.UpdateVReplicationWorkflowResponse"; + return typeUrlPrefix + "/tabletmanagerdata.UpdateVReplicationWorkflowsResponse"; }; - return UpdateVReplicationWorkflowResponse; + return UpdateVReplicationWorkflowsResponse; })(); tabletmanagerdata.ResetSequencesRequest = (function() {