From 52daf18e0ebf8dfd2af3912bb70dcc94b96c3d3b Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 1 Nov 2023 23:11:11 -0400 Subject: [PATCH 01/35] Generalize new workflow creation path Signed-off-by: Matt Lord --- go/vt/vtctl/workflow/materializer.go | 19 +++++-------------- go/vt/vtctl/workflow/materializer_test.go | 13 +++++++++++-- go/vt/vtctl/workflow/server.go | 11 ++++++++++- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/go/vt/vtctl/workflow/materializer.go b/go/vt/vtctl/workflow/materializer.go index 6be5ac7f445..f441871b711 100644 --- a/go/vt/vtctl/workflow/materializer.go +++ b/go/vt/vtctl/workflow/materializer.go @@ -78,7 +78,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 } @@ -95,6 +95,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) @@ -113,22 +114,12 @@ 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) + req.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, - }) + + _, err = mz.tmc.CreateVReplicationWorkflow(mz.ctx, targetPrimary.Tablet, req) return err }) } diff --git a/go/vt/vtctl/workflow/materializer_test.go b/go/vt/vtctl/workflow/materializer_test.go index fc39bb4d30b..996ca6602cf 100644 --- a/go/vt/vtctl/workflow/materializer_test.go +++ b/go/vt/vtctl/workflow/materializer_test.go @@ -3564,8 +3564,17 @@ func TestKeyRangesEqualOptimization(t *testing.T) { ms: ms, workflowType: workflowType, } - 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/server.go b/go/vt/vtctl/workflow/server.go index c26a38c4811..c8e33f29523 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -1386,7 +1386,16 @@ func (s *Server) moveTablesCreate(ctx context.Context, req *vtctldatapb.MoveTabl ms: ms, workflowType: workflowType, } - 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 } From e9b94d8d96421ea852f5ea67da34340212eae317 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 1 Nov 2023 23:23:34 -0400 Subject: [PATCH 02/35] Move first VReplication usage Signed-off-by: Matt Lord --- go/vt/vtctl/workflow/materializer.go | 17 +++++-- go/vt/vtctl/workflow/server.go | 67 +++++++++++++--------------- 2 files changed, 45 insertions(+), 39 deletions(-) diff --git a/go/vt/vtctl/workflow/materializer.go b/go/vt/vtctl/workflow/materializer.go index f441871b711..d8b43b4b66c 100644 --- a/go/vt/vtctl/workflow/materializer.go +++ b/go/vt/vtctl/workflow/materializer.go @@ -25,6 +25,7 @@ import ( "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" @@ -39,6 +40,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" ) @@ -565,9 +567,18 @@ func (mz *materializer) startStreams(ctx context.Context) error { 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) + req := &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), + } + if _, err := mz.tmc.UpdateVReplicationWorkflow(ctx, targetPrimary.Tablet, req); err != nil { + return vterrors.Wrap(err, "failed to update workflow") } return nil }) diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index c8e33f29523..bc27a859345 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -408,6 +408,19 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows where, ) + /* + readReq := &tabletmanagerdatapb.ReadVReplicationWorkflowRequest{ + Workflow: req.Workflow, + } + callback := func(ctx context.Context, tablet *topo.TabletInfo) (*querypb.QueryResult, error) { + res, err := s.tmc.ReadVReplicationWorkflow(ctx, tablet.Tablet, readReq) + if err != nil { + return nil, err + } + return res, err + } + */ + vx := vexec.NewVExec(req.Keyspace, "", s.ts, s.tmc) results, err := vx.QueryContext(ctx, query) if err != nil { @@ -1167,42 +1180,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) } } } @@ -2225,25 +2225,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 From 12e1a600919cea8427408f931a038aa19dd2742f Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Thu, 2 Nov 2023 12:56:15 -0400 Subject: [PATCH 03/35] Correct generalized create flow Signed-off-by: Matt Lord --- go/vt/vtctl/workflow/materializer.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/go/vt/vtctl/workflow/materializer.go b/go/vt/vtctl/workflow/materializer.go index d8b43b4b66c..59b4d811c8a 100644 --- a/go/vt/vtctl/workflow/materializer.go +++ b/go/vt/vtctl/workflow/materializer.go @@ -116,12 +116,15 @@ func (mz *materializer) createWorkflowStreams(req *tabletmanagerdatapb.CreateVRe if len(sourceShards) == 1 && key.KeyRangeEqual(sourceShards[0].KeyRange, target.KeyRange) { streamKeyRangesEqual = true } - req.BinlogSource, 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, req) + _, err = mz.tmc.CreateVReplicationWorkflow(mz.ctx, targetPrimary.Tablet, tabletReq) return err }) } From 1045dd5c5d3f110c4be1a3297b4d5aa113bd2947 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Thu, 2 Nov 2023 15:22:35 -0400 Subject: [PATCH 04/35] Get Materialize creation working w/o VReplicationExec Signed-off-by: Matt Lord --- go/textutil/strings.go | 6 ++- go/vt/vtctl/workflow/materializer.go | 13 +++++++ go/vt/vtctl/workflow/server.go | 20 +++++++++- .../tabletmanager/rpc_vreplication.go | 2 + .../tabletmanager/rpc_vreplication_test.go | 38 +++++++++++++------ 5 files changed, 65 insertions(+), 14 deletions(-) diff --git a/go/textutil/strings.go b/go/textutil/strings.go index bb2e24ba477..ac35541f52f 100644 --- a/go/textutil/strings.go +++ b/go/textutil/strings.go @@ -23,8 +23,8 @@ import ( "unicode" "vitess.io/vitess/go/sqltypes" - "vitess.io/vitess/go/vt/proto/binlogdata" + binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata" topodatapb "vitess.io/vitess/go/vt/proto/topodata" ) @@ -94,7 +94,7 @@ func ValueIsSimulatedNull(val any) bool { return cval == SimulatedNullString case []string: return len(cval) == 1 && cval[0] == sqltypes.NULL.String() - case binlogdata.OnDDLAction: + case binlogdatapb.OnDDLAction: return int32(cval) == int32(SimulatedNullInt) case int: return cval == SimulatedNullInt @@ -104,6 +104,8 @@ func ValueIsSimulatedNull(val any) bool { return int64(cval) == int64(SimulatedNullInt) case []topodatapb.TabletType: return len(cval) == 1 && cval[0] == topodatapb.TabletType(SimulatedNullInt) + case binlogdatapb.VReplicationWorkflowState: + return int32(cval) == int32(SimulatedNullInt) default: return false } diff --git a/go/vt/vtctl/workflow/materializer.go b/go/vt/vtctl/workflow/materializer.go index 59b4d811c8a..e3cc4257998 100644 --- a/go/vt/vtctl/workflow/materializer.go +++ b/go/vt/vtctl/workflow/materializer.go @@ -66,6 +66,19 @@ type materializer struct { workflowType binlogdatapb.VReplicationWorkflowType } +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: diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index bc27a859345..9e009fbec8b 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -1248,7 +1248,25 @@ func (s *Server) Materialize(ctx context.Context, ms *vtctldatapb.MaterializeSet ms: ms, } - err := mz.createMaterializerStreams() + tsp := tabletmanagerdatapb.TabletSelectionPreference_INORDER + tt, inOrder, err := discovery.ParseTabletTypesAndOrder(ms.TabletTypes) + if err != nil { + return err + } + if inOrder { + tsp = tabletmanagerdatapb.TabletSelectionPreference_INORDER + } + + err = mz.createWorkflowStreams(&tabletmanagerdatapb.CreateVReplicationWorkflowRequest{ + Workflow: ms.Workflow, + Cells: strings.Split(ms.Cell, ","), + TabletTypes: tt, + TabletSelectionPreference: tsp, + WorkflowType: mz.getWorkflowType(), + DeferSecondaryKeys: ms.DeferSecondaryKeys, + AutoStart: true, + StopAfterCopy: ms.StopAfterCopy, + }) if err != nil { return err } diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication.go b/go/vt/vttablet/tabletmanager/rpc_vreplication.go index bbcea8bd0d6..852adee7169 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -26,6 +26,7 @@ import ( "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/textutil" "vitess.io/vitess/go/vt/discovery" + "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/proto/vttime" "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/topo/topoproto" @@ -300,6 +301,7 @@ func (tm *TabletManager) UpdateVReplicationWorkflow(ctx context.Context, req *ta } if !textutil.ValueIsSimulatedNull(req.State) { state = binlogdatapb.VReplicationWorkflowState_name[int32(req.State)] + log.Errorf("DEBUG: State was updated to %s using request value: %v", state, req.State) } bindVars = map[string]*querypb.BindVariable{ "st": sqltypes.StringBindVariable(state), diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go index 1f985733371..78f1f43b17e 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go @@ -479,10 +479,10 @@ func TestUpdateVReplicationWorkflow(t *testing.T) { keyspace, shard) selectRes := sqltypes.MakeTestResult( sqltypes.MakeTestFields( - "id|source|cell|tablet_types", - "int64|varchar|varchar|varchar", + "id|source|cell|tablet_types|state|message", + "int64|varchar|varchar|varchar|varchar|varbinary", ), - fmt.Sprintf("%d|%s|%s|%s", vreplID, blsStr, cells[0], tabletTypes[0]), + fmt.Sprintf("%d|%s|%s|%s|Running|", vreplID, blsStr, cells[0], tabletTypes[0]), ) idQuery, err := sqlparser.ParseAndBind("select id from _vt.vreplication where id = %a", sqltypes.Int64BindVariable(int64(vreplID))) @@ -504,62 +504,80 @@ func TestUpdateVReplicationWorkflow(t *testing.T) { name: "update cells", request: &tabletmanagerdatapb.UpdateVReplicationWorkflowRequest{ Workflow: workflow, + State: binlogdatapb.VReplicationWorkflowState(textutil.SimulatedNullInt), Cells: []string{"zone2"}, // TabletTypes is an empty value, so the current value should be cleared }, - query: fmt.Sprintf(`update _vt.vreplication set state = 'Stopped', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}}', cell = '%s', tablet_types = '' where id in (%d)`, + query: fmt.Sprintf(`update _vt.vreplication set state = 'Running', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}}', cell = '%s', tablet_types = '' where id in (%d)`, keyspace, shard, "zone2", vreplID), }, { name: "update cells, NULL tablet_types", request: &tabletmanagerdatapb.UpdateVReplicationWorkflowRequest{ Workflow: workflow, + State: binlogdatapb.VReplicationWorkflowState(textutil.SimulatedNullInt), Cells: []string{"zone3"}, TabletTypes: []topodatapb.TabletType{topodatapb.TabletType(textutil.SimulatedNullInt)}, // So keep the current value of replica }, - query: fmt.Sprintf(`update _vt.vreplication set state = 'Stopped', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}}', cell = '%s', tablet_types = '%s' where id in (%d)`, + query: fmt.Sprintf(`update _vt.vreplication set state = 'Running', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}}', cell = '%s', tablet_types = '%s' where id in (%d)`, keyspace, shard, "zone3", tabletTypes[0], vreplID), }, { name: "update tablet_types", request: &tabletmanagerdatapb.UpdateVReplicationWorkflowRequest{ Workflow: workflow, + State: binlogdatapb.VReplicationWorkflowState(textutil.SimulatedNullInt), TabletSelectionPreference: tabletmanagerdatapb.TabletSelectionPreference_INORDER, TabletTypes: []topodatapb.TabletType{topodatapb.TabletType_RDONLY, topodatapb.TabletType_REPLICA}, }, - query: fmt.Sprintf(`update _vt.vreplication set state = 'Stopped', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}}', cell = '', tablet_types = '%s' where id in (%d)`, + query: fmt.Sprintf(`update _vt.vreplication set state = 'Running', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}}', cell = '', tablet_types = '%s' where id in (%d)`, keyspace, shard, "in_order:rdonly,replica", vreplID), }, { name: "update tablet_types, NULL cells", request: &tabletmanagerdatapb.UpdateVReplicationWorkflowRequest{ Workflow: workflow, + State: binlogdatapb.VReplicationWorkflowState(textutil.SimulatedNullInt), Cells: textutil.SimulatedNullStringSlice, // So keep the current value of zone1 TabletTypes: []topodatapb.TabletType{topodatapb.TabletType_RDONLY}, }, - query: fmt.Sprintf(`update _vt.vreplication set state = 'Stopped', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}}', cell = '%s', tablet_types = '%s' where id in (%d)`, + query: fmt.Sprintf(`update _vt.vreplication set state = 'Running', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}}', cell = '%s', tablet_types = '%s' where id in (%d)`, keyspace, shard, cells[0], "rdonly", vreplID), }, { name: "update on_ddl", request: &tabletmanagerdatapb.UpdateVReplicationWorkflowRequest{ Workflow: workflow, + State: binlogdatapb.VReplicationWorkflowState(textutil.SimulatedNullInt), OnDdl: binlogdatapb.OnDDLAction_EXEC, }, - query: fmt.Sprintf(`update _vt.vreplication set state = 'Stopped', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}} on_ddl:%s', cell = '', tablet_types = '' where id in (%d)`, + query: fmt.Sprintf(`update _vt.vreplication set state = 'Running', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}} on_ddl:%s', cell = '', tablet_types = '' where id in (%d)`, keyspace, shard, binlogdatapb.OnDDLAction_EXEC.String(), vreplID), }, { name: "update cell,tablet_types,on_ddl", request: &tabletmanagerdatapb.UpdateVReplicationWorkflowRequest{ Workflow: workflow, + State: binlogdatapb.VReplicationWorkflowState(textutil.SimulatedNullInt), Cells: []string{"zone1", "zone2", "zone3"}, TabletTypes: []topodatapb.TabletType{topodatapb.TabletType_RDONLY, topodatapb.TabletType_REPLICA, topodatapb.TabletType_PRIMARY}, OnDdl: binlogdatapb.OnDDLAction_EXEC_IGNORE, }, - query: fmt.Sprintf(`update _vt.vreplication set state = 'Stopped', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}} on_ddl:%s', cell = '%s', tablet_types = '%s' where id in (%d)`, + query: fmt.Sprintf(`update _vt.vreplication set state = 'Running', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}} on_ddl:%s', cell = '%s', tablet_types = '%s' where id in (%d)`, keyspace, shard, binlogdatapb.OnDDLAction_EXEC_IGNORE.String(), "zone1,zone2,zone3", "rdonly,replica,primary", vreplID), }, + { + name: "update state", + request: &tabletmanagerdatapb.UpdateVReplicationWorkflowRequest{ + Workflow: workflow, + State: binlogdatapb.VReplicationWorkflowState_Stopped, + Cells: textutil.SimulatedNullStringSlice, + TabletTypes: []topodatapb.TabletType{topodatapb.TabletType(textutil.SimulatedNullInt)}, + OnDdl: binlogdatapb.OnDDLAction(textutil.SimulatedNullInt), + }, + query: fmt.Sprintf(`update _vt.vreplication set state = 'Stopped', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}}', cell = '%s', tablet_types = '%s' where id in (%d)`, + keyspace, shard, cells[0], tabletTypes[0], vreplID), + }, } for _, tt := range tests { @@ -575,8 +593,6 @@ func TestUpdateVReplicationWorkflow(t *testing.T) { require.NotNil(t, tt.request, "No request provided") require.NotEqual(t, "", tt.query, "No expected query provided") - tt.request.State = binlogdatapb.VReplicationWorkflowState_Stopped - // 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(selectQuery, selectRes, nil) From fcc631da269af9695367c7c0cbfcf799aade2d62 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Thu, 2 Nov 2023 18:55:39 -0400 Subject: [PATCH 05/35] Fix workflow update bug Signed-off-by: Matt Lord --- go/vt/vtctl/workflow/materializer.go | 184 +----------------- go/vt/vtctl/workflow/server.go | 8 +- .../tabletmanager/rpc_vreplication.go | 135 ++++++------- .../tabletmanager/rpc_vreplication_test.go | 34 ++-- 4 files changed, 91 insertions(+), 270 deletions(-) diff --git a/go/vt/vtctl/workflow/materializer.go b/go/vt/vtctl/workflow/materializer.go index e3cc4257998..e6dbfabcb48 100644 --- a/go/vt/vtctl/workflow/materializer.go +++ b/go/vt/vtctl/workflow/materializer.go @@ -21,7 +21,6 @@ import ( "fmt" "strings" "sync" - "text/template" "time" "vitess.io/vitess/go/sqltypes" @@ -142,144 +141,6 @@ func (mz *materializer) createWorkflowStreams(req *tabletmanagerdatapb.CreateVRe }) } -// 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 { - 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 := sqlparser.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.SelectExprs, 0, len(mappedCols)+2) - for _, mappedCol := range mappedCols { - subExprs = append(subExprs, &sqlparser.AliasedExpr{Expr: mappedCol}) - } - vindexName := fmt.Sprintf("%s.%s", mz.ms.TargetKeyspace, cv.Name) - subExprs = append(subExprs, &sqlparser.AliasedExpr{Expr: sqlparser.NewStrLiteral(vindexName)}) - subExprs = append(subExprs, &sqlparser.AliasedExpr{Expr: 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) { blses := make([]*binlogdatapb.BinlogSource, 0, len(mz.sourceShards)) for _, sourceShard := range sourceShards { @@ -553,37 +414,13 @@ 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) } - req := &tabletmanagerdatapb.UpdateVReplicationWorkflowRequest{ + 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. @@ -592,30 +429,13 @@ func (mz *materializer) startStreams(ctx context.Context) error { topodatapb.TabletType(textutil.SimulatedNullInt), }, OnDdl: binlogdatapb.OnDDLAction(textutil.SimulatedNullInt), - } - if _, err := mz.tmc.UpdateVReplicationWorkflow(ctx, targetPrimary.Tablet, req); err != nil { + }); err != nil { return vterrors.Wrap(err, "failed to update workflow") } return nil }) } -func Materialize(ctx context.Context, ts *topo.Server, tmc tmclient.TabletManagerClient, ms *vtctldatapb.MaterializeSettings) error { - mz := &materializer{ - ctx: ctx, - ts: ts, - sourceTs: ts, - tmc: tmc, - ms: ms, - } - - err := mz.createMaterializerStreams() - if err != nil { - return err - } - return mz.startStreams(ctx) -} - func (mz *materializer) forAllTargets(f func(*topo.ShardInfo) error) error { var wg sync.WaitGroup allErrors := &concurrency.AllErrorRecorder{} diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index 9e009fbec8b..0ed83e128c7 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -1248,20 +1248,16 @@ func (s *Server) Materialize(ctx context.Context, ms *vtctldatapb.MaterializeSet ms: ms, } - tsp := tabletmanagerdatapb.TabletSelectionPreference_INORDER - tt, inOrder, err := discovery.ParseTabletTypesAndOrder(ms.TabletTypes) + tt, err := topoproto.ParseTabletTypes(ms.TabletTypes) if err != nil { return err } - if inOrder { - tsp = tabletmanagerdatapb.TabletSelectionPreference_INORDER - } err = mz.createWorkflowStreams(&tabletmanagerdatapb.CreateVReplicationWorkflowRequest{ Workflow: ms.Workflow, Cells: strings.Split(ms.Cell, ","), TabletTypes: tt, - TabletSelectionPreference: tsp, + TabletSelectionPreference: ms.TabletSelectionPreference, WorkflowType: mz.getWorkflowType(), DeferSecondaryKeys: ms.DeferSecondaryKeys, AutoStart: true, diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication.go b/go/vt/vttablet/tabletmanager/rpc_vreplication.go index 852adee7169..b18caa1063f 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -26,7 +26,6 @@ import ( "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/textutil" "vitess.io/vitess/go/vt/discovery" - "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/proto/vttime" "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/topo/topoproto" @@ -46,10 +45,10 @@ const ( 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. sqlDeleteVReplicationWorkflow = "delete from %s.vreplication where workflow = %a and db_name = %a" - // Retrieve the current configuration values for a workflow's vreplication stream. + // Retrieve the current configuration values for a workflow's vreplication stream(s). 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. - sqlUpdateVReplicationWorkflowConfig = "update %s.vreplication set state = %a, source = %a, cell = %a, tablet_types = %a where id = %a" + sqlUpdateVReplicationWorkflowStreamConfig = "update %s.vreplication set state = %a, source = %a, cell = %a, tablet_types = %a where id = %a" ) func (tm *TabletManager) CreateVReplicationWorkflow(ctx context.Context, req *tabletmanagerdatapb.CreateVReplicationWorkflowRequest) (*tabletmanagerdatapb.CreateVReplicationWorkflowResponse, error) { @@ -229,8 +228,8 @@ func (tm *TabletManager) ReadVReplicationWorkflow(ctx context.Context, req *tabl } // UpdateVReplicationWorkflow updates the sidecar databases's vreplication -// record for this tablet's vreplication workflow stream(s). If there -// is no stream for the given workflow on the tablet then a nil result +// record(s) for this tablet's vreplication workflow stream(s). If there +// are no streams for the given workflow on the tablet then a nil result // is returned as this is expected e.g. on source tablets of a // Reshard workflow (source and target are the same keyspace). The // caller can consider this case an error if they choose to. @@ -258,69 +257,73 @@ func (tm *TabletManager) UpdateVReplicationWorkflow(ctx context.Context, req *ta return &tabletmanagerdatapb.UpdateVReplicationWorkflowResponse{Result: nil}, nil } - row := res.Named().Row() - id := row.AsInt64("id", 0) - cells := strings.Split(row.AsString("cell", ""), ",") - tabletTypes, inorder, err := discovery.ParseTabletTypesAndOrder(row.AsString("tablet_types", "")) - if err != nil { - return nil, err - } - bls := &binlogdatapb.BinlogSource{} - source := row.AsBytes("source", []byte{}) - state := row.AsString("state", "") - message := row.AsString("message", "") - if req.State == binlogdatapb.VReplicationWorkflowState_Running && strings.ToUpper(message) == workflow.Frozen { - return &tabletmanagerdatapb.UpdateVReplicationWorkflowResponse{Result: nil}, - vterrors.New(vtrpcpb.Code_FAILED_PRECONDITION, "cannot start a workflow when it is frozen") - } - // For the string based values, we use NULL to differentiate - // from an empty string. The NULL value indicates that we - // should keep the existing value. - if !textutil.ValueIsSimulatedNull(req.Cells) { - cells = req.Cells - } - if !textutil.ValueIsSimulatedNull(req.TabletTypes) { - tabletTypes = req.TabletTypes - } - tabletTypesStr := topoproto.MakeStringTypeCSV(tabletTypes) - if inorder && req.TabletSelectionPreference == tabletmanagerdatapb.TabletSelectionPreference_UNKNOWN || - req.TabletSelectionPreference == tabletmanagerdatapb.TabletSelectionPreference_INORDER { - tabletTypesStr = discovery.InOrderHint + tabletTypesStr - } - if err = prototext.Unmarshal(source, bls); err != nil { - return nil, err - } - // If we don't want to update the existing value then pass - // the simulated NULL value of -1. - if !textutil.ValueIsSimulatedNull(req.OnDdl) { - bls.OnDdl = req.OnDdl - } - source, err = prototext.Marshal(bls) - if err != nil { - return nil, err - } - if !textutil.ValueIsSimulatedNull(req.State) { - state = binlogdatapb.VReplicationWorkflowState_name[int32(req.State)] - log.Errorf("DEBUG: State was updated to %s using request value: %v", state, req.State) - } - bindVars = map[string]*querypb.BindVariable{ - "st": sqltypes.StringBindVariable(state), - "sc": sqltypes.StringBindVariable(string(source)), - "cl": sqltypes.StringBindVariable(strings.Join(cells, ",")), - "tt": sqltypes.StringBindVariable(tabletTypesStr), - "id": sqltypes.Int64BindVariable(id), - } - parsed = sqlparser.BuildParsedQuery(sqlUpdateVReplicationWorkflowConfig, sidecar.GetIdentifier(), ":st", ":sc", ":cl", ":tt", ":id") - stmt, err = parsed.GenerateQuery(bindVars, nil) - if err != nil { - return nil, err + for _, row := range res.Named().Rows { + id := row.AsInt64("id", 0) + cells := strings.Split(row.AsString("cell", ""), ",") + tabletTypes, inorder, err := discovery.ParseTabletTypesAndOrder(row.AsString("tablet_types", "")) + if err != nil { + return nil, err + } + bls := &binlogdatapb.BinlogSource{} + source := row.AsBytes("source", []byte{}) + state := row.AsString("state", "") + message := row.AsString("message", "") + if req.State == binlogdatapb.VReplicationWorkflowState_Running && strings.ToUpper(message) == workflow.Frozen { + return &tabletmanagerdatapb.UpdateVReplicationWorkflowResponse{Result: nil}, + vterrors.New(vtrpcpb.Code_FAILED_PRECONDITION, "cannot start a workflow when it is frozen") + } + // For the string based values, we use NULL to differentiate + // from an empty string. The NULL value indicates that we + // should keep the existing value. + if !textutil.ValueIsSimulatedNull(req.Cells) { + cells = req.Cells + } + if !textutil.ValueIsSimulatedNull(req.TabletTypes) { + tabletTypes = req.TabletTypes + } + tabletTypesStr := topoproto.MakeStringTypeCSV(tabletTypes) + if inorder && req.TabletSelectionPreference == tabletmanagerdatapb.TabletSelectionPreference_UNKNOWN || + req.TabletSelectionPreference == tabletmanagerdatapb.TabletSelectionPreference_INORDER { + tabletTypesStr = discovery.InOrderHint + tabletTypesStr + } + if err = prototext.Unmarshal(source, bls); err != nil { + return nil, err + } + // If we don't want to update the existing value then pass + // the simulated NULL value of -1. + if !textutil.ValueIsSimulatedNull(req.OnDdl) { + bls.OnDdl = req.OnDdl + } + source, err = prototext.Marshal(bls) + if err != nil { + return nil, err + } + if !textutil.ValueIsSimulatedNull(req.State) { + state = binlogdatapb.VReplicationWorkflowState_name[int32(req.State)] + } + bindVars = map[string]*querypb.BindVariable{ + "st": sqltypes.StringBindVariable(state), + "sc": sqltypes.StringBindVariable(string(source)), + "cl": sqltypes.StringBindVariable(strings.Join(cells, ",")), + "tt": sqltypes.StringBindVariable(tabletTypesStr), + "id": sqltypes.Int64BindVariable(id), + } + parsed = sqlparser.BuildParsedQuery(sqlUpdateVReplicationWorkflowStreamConfig, sidecar.GetIdentifier(), ":st", ":sc", ":cl", ":tt", ":id") + stmt, err = parsed.GenerateQuery(bindVars, nil) + if err != nil { + return nil, err + } + res, err = tm.VREngine.Exec(stmt) + if err != nil { + return nil, err + } } - res, err = tm.VREngine.Exec(stmt) - if err != nil { - return nil, err - } - return &tabletmanagerdatapb.UpdateVReplicationWorkflowResponse{Result: sqltypes.ResultToProto3(res)}, nil + return &tabletmanagerdatapb.UpdateVReplicationWorkflowResponse{ + Result: &querypb.QueryResult{ + RowsAffected: uint64(len(res.Rows)), + }, + }, nil } // VReplicationExec executes a vreplication command. diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go index 78f1f43b17e..024a6eb1955 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go @@ -483,9 +483,10 @@ func TestUpdateVReplicationWorkflow(t *testing.T) { "int64|varchar|varchar|varchar|varchar|varbinary", ), fmt.Sprintf("%d|%s|%s|%s|Running|", vreplID, blsStr, cells[0], tabletTypes[0]), + fmt.Sprintf("%d|%s|%s|%s|Running|", vreplID+1, blsStr, cells[0], tabletTypes[0]), ) - idQuery, err := sqlparser.ParseAndBind("select id from _vt.vreplication where id = %a", - sqltypes.Int64BindVariable(int64(vreplID))) + idQuery, err := sqlparser.ParseAndBind("select id from _vt.vreplication where workflow = %a", + sqltypes.StringBindVariable(workflow)) require.NoError(t, err) idRes := sqltypes.MakeTestResult( sqltypes.MakeTestFields( @@ -493,6 +494,7 @@ func TestUpdateVReplicationWorkflow(t *testing.T) { "int64", ), fmt.Sprintf("%d", vreplID), + fmt.Sprintf("%d", vreplID+1), ) tests := []struct { @@ -508,8 +510,8 @@ func TestUpdateVReplicationWorkflow(t *testing.T) { Cells: []string{"zone2"}, // TabletTypes is an empty value, so the current value should be cleared }, - query: fmt.Sprintf(`update _vt.vreplication set state = 'Running', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}}', cell = '%s', tablet_types = '' where id in (%d)`, - keyspace, shard, "zone2", vreplID), + query: fmt.Sprintf(`update _vt.vreplication set state = 'Running', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}}', cell = '%s', tablet_types = '' where id in (%s)`, + keyspace, shard, "zone2", fmt.Sprintf("%d, %d", vreplID, vreplID+1)), }, { name: "update cells, NULL tablet_types", @@ -519,8 +521,8 @@ func TestUpdateVReplicationWorkflow(t *testing.T) { Cells: []string{"zone3"}, TabletTypes: []topodatapb.TabletType{topodatapb.TabletType(textutil.SimulatedNullInt)}, // So keep the current value of replica }, - query: fmt.Sprintf(`update _vt.vreplication set state = 'Running', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}}', cell = '%s', tablet_types = '%s' where id in (%d)`, - keyspace, shard, "zone3", tabletTypes[0], vreplID), + query: fmt.Sprintf(`update _vt.vreplication set state = 'Running', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}}', cell = '%s', tablet_types = '%s' where id in (%s)`, + keyspace, shard, "zone3", tabletTypes[0], fmt.Sprintf("%d, %d", vreplID, vreplID+1)), }, { name: "update tablet_types", @@ -530,8 +532,8 @@ func TestUpdateVReplicationWorkflow(t *testing.T) { TabletSelectionPreference: tabletmanagerdatapb.TabletSelectionPreference_INORDER, TabletTypes: []topodatapb.TabletType{topodatapb.TabletType_RDONLY, topodatapb.TabletType_REPLICA}, }, - query: fmt.Sprintf(`update _vt.vreplication set state = 'Running', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}}', cell = '', tablet_types = '%s' where id in (%d)`, - keyspace, shard, "in_order:rdonly,replica", vreplID), + query: fmt.Sprintf(`update _vt.vreplication set state = 'Running', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}}', cell = '', tablet_types = '%s' where id in (%s)`, + keyspace, shard, "in_order:rdonly,replica", fmt.Sprintf("%d, %d", vreplID, vreplID+1)), }, { name: "update tablet_types, NULL cells", @@ -541,8 +543,8 @@ func TestUpdateVReplicationWorkflow(t *testing.T) { Cells: textutil.SimulatedNullStringSlice, // So keep the current value of zone1 TabletTypes: []topodatapb.TabletType{topodatapb.TabletType_RDONLY}, }, - query: fmt.Sprintf(`update _vt.vreplication set state = 'Running', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}}', cell = '%s', tablet_types = '%s' where id in (%d)`, - keyspace, shard, cells[0], "rdonly", vreplID), + query: fmt.Sprintf(`update _vt.vreplication set state = 'Running', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}}', cell = '%s', tablet_types = '%s' where id in (%s)`, + keyspace, shard, cells[0], "rdonly", fmt.Sprintf("%d, %d", vreplID, vreplID+1)), }, { name: "update on_ddl", @@ -551,8 +553,8 @@ func TestUpdateVReplicationWorkflow(t *testing.T) { State: binlogdatapb.VReplicationWorkflowState(textutil.SimulatedNullInt), OnDdl: binlogdatapb.OnDDLAction_EXEC, }, - query: fmt.Sprintf(`update _vt.vreplication set state = 'Running', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}} on_ddl:%s', cell = '', tablet_types = '' where id in (%d)`, - keyspace, shard, binlogdatapb.OnDDLAction_EXEC.String(), vreplID), + query: fmt.Sprintf(`update _vt.vreplication set state = 'Running', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}} on_ddl:%s', cell = '', tablet_types = '' where id in (%s)`, + keyspace, shard, binlogdatapb.OnDDLAction_EXEC.String(), fmt.Sprintf("%d, %d", vreplID, vreplID+1)), }, { name: "update cell,tablet_types,on_ddl", @@ -563,8 +565,8 @@ func TestUpdateVReplicationWorkflow(t *testing.T) { TabletTypes: []topodatapb.TabletType{topodatapb.TabletType_RDONLY, topodatapb.TabletType_REPLICA, topodatapb.TabletType_PRIMARY}, OnDdl: binlogdatapb.OnDDLAction_EXEC_IGNORE, }, - query: fmt.Sprintf(`update _vt.vreplication set state = 'Running', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}} on_ddl:%s', cell = '%s', tablet_types = '%s' where id in (%d)`, - keyspace, shard, binlogdatapb.OnDDLAction_EXEC_IGNORE.String(), "zone1,zone2,zone3", "rdonly,replica,primary", vreplID), + query: fmt.Sprintf(`update _vt.vreplication set state = 'Running', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}} on_ddl:%s', cell = '%s', tablet_types = '%s' where id in (%s)`, + keyspace, shard, binlogdatapb.OnDDLAction_EXEC_IGNORE.String(), "zone1,zone2,zone3", "rdonly,replica,primary", fmt.Sprintf("%d, %d", vreplID, vreplID+1)), }, { name: "update state", @@ -575,8 +577,8 @@ func TestUpdateVReplicationWorkflow(t *testing.T) { TabletTypes: []topodatapb.TabletType{topodatapb.TabletType(textutil.SimulatedNullInt)}, OnDdl: binlogdatapb.OnDDLAction(textutil.SimulatedNullInt), }, - query: fmt.Sprintf(`update _vt.vreplication set state = 'Stopped', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}}', cell = '%s', tablet_types = '%s' where id in (%d)`, - keyspace, shard, cells[0], tabletTypes[0], vreplID), + query: fmt.Sprintf(`update _vt.vreplication set state = '%s', source = 'keyspace:\"%s\" shard:\"%s\" filter:{rules:{match:\"customer\" filter:\"select * from customer\"} rules:{match:\"corder\" filter:\"select * from corder\"}}', cell = '%s', tablet_types = '%s' where id in (%s)`, + binlogdatapb.VReplicationWorkflowState_Stopped.String(), keyspace, shard, cells[0], tabletTypes[0], fmt.Sprintf("%d, %d", vreplID, vreplID+1)), }, } From 4e0a5425cc63268f53916bab6cb48ec94a8836c3 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 3 Jan 2024 09:35:24 -0500 Subject: [PATCH 06/35] Add HasVReplicationWorkflows and ReadVReplicationWorkflows RPCs Signed-off-by: Matt Lord --- .../tabletmanagerdata/tabletmanagerdata.pb.go | 1023 ++++++++++------ .../tabletmanagerdata_vtproto.pb.go | 929 ++++++++++++++- .../tabletmanagerservice.pb.go | 609 +++++----- .../tabletmanagerservice_grpc.pb.go | 72 ++ go/vt/vtcombo/tablet_map.go | 8 + go/vt/vtctl/workflow/resharder.go | 121 +- go/vt/vtctl/workflow/server.go | 13 +- go/vt/vtctl/workflow/stream_migrator.go | 113 +- go/vt/vtctl/workflow/utils.go | 175 +-- go/vt/vtctl/workflow/vreplication_stream.go | 9 + go/vt/vttablet/faketmclient/fake_client.go | 8 + go/vt/vttablet/grpctmclient/client.go | 26 + go/vt/vttablet/grpctmserver/server.go | 14 + go/vt/vttablet/tabletmanager/rpc_agent.go | 2 + .../tabletmanager/rpc_vreplication.go | 171 +++ go/vt/vttablet/tmclient/rpc_client_api.go | 2 + go/vt/vttablet/tmrpctest/test_tm_rpc.go | 10 + go/vt/wrangler/traffic_switcher.go | 2 +- proto/tabletmanagerdata.proto | 20 + proto/tabletmanagerservice.proto | 2 + web/vtadmin/src/proto/vtadmin.d.ts | 412 +++++++ web/vtadmin/src/proto/vtadmin.js | 1036 +++++++++++++++++ 22 files changed, 3838 insertions(+), 939 deletions(-) diff --git a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go index 73fdf15ac04..6802b7c8e94 100644 --- a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go +++ b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go @@ -5053,6 +5053,226 @@ func (x *DeleteVReplicationWorkflowResponse) GetResult() *query.QueryResult { return nil } +type HasVReplicationWorkflowsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DbName string `protobuf:"bytes,1,opt,name=db_name,json=dbName,proto3" json:"db_name,omitempty"` +} + +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} +} + +func (x *HasVReplicationWorkflowsRequest) GetDbName() string { + if x != nil { + return x.DbName + } + return "" +} + +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 + + DbName string `protobuf:"bytes,1,opt,name=db_name,json=dbName,proto3" json:"db_name,omitempty"` + IncludeIds []int32 `protobuf:"varint,2,rep,packed,name=include_ids,json=includeIds,proto3" json:"include_ids,omitempty"` + States []binlogdata.VReplicationWorkflowState `protobuf:"varint,3,rep,packed,name=states,proto3,enum=binlogdata.VReplicationWorkflowState" json:"states,omitempty"` + ExcludeFrozen bool `protobuf:"varint,4,opt,name=exclude_frozen,json=excludeFrozen,proto3" json:"exclude_frozen,omitempty"` + ExcludeWorkflows []string `protobuf:"bytes,5,rep,name=exclude_workflows,json=excludeWorkflows,proto3" json:"exclude_workflows,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) GetDbName() string { + if x != nil { + return x.DbName + } + return "" +} + +func (x *ReadVReplicationWorkflowsRequest) GetIncludeIds() []int32 { + if x != nil { + return x.IncludeIds + } + return nil +} + +func (x *ReadVReplicationWorkflowsRequest) GetStates() []binlogdata.VReplicationWorkflowState { + if x != nil { + return x.States + } + return nil +} + +func (x *ReadVReplicationWorkflowsRequest) GetExcludeFrozen() bool { + if x != nil { + return x.ExcludeFrozen + } + return false +} + +func (x *ReadVReplicationWorkflowsRequest) GetExcludeWorkflows() []string { + if x != nil { + return x.ExcludeWorkflows + } + return nil +} + +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 @@ -5064,7 +5284,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) } @@ -5077,7 +5297,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 { @@ -5090,7 +5310,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 { @@ -5120,7 +5340,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) } @@ -5133,7 +5353,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 { @@ -5146,7 +5366,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 { @@ -5235,7 +5455,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) } @@ -5248,7 +5468,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 { @@ -5261,7 +5481,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 { @@ -5319,7 +5539,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) } @@ -5332,7 +5552,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 { @@ -5345,7 +5565,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 { @@ -5383,7 +5603,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) } @@ -5396,7 +5616,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 { @@ -5409,7 +5629,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 { @@ -5448,7 +5668,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) } @@ -5461,7 +5681,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 { @@ -5474,7 +5694,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 { @@ -5524,7 +5744,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) } @@ -5537,7 +5757,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 { @@ -5550,7 +5770,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 { @@ -5629,7 +5849,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) } @@ -5642,7 +5862,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 { @@ -5655,7 +5875,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 { @@ -5695,7 +5915,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) } @@ -5708,7 +5928,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 { @@ -5721,7 +5941,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 { @@ -5777,7 +5997,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) } @@ -5790,7 +6010,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 { @@ -5803,7 +6023,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 { @@ -5824,7 +6044,7 @@ type ResetSequencesRequest struct { func (x *ResetSequencesRequest) Reset() { *x = ResetSequencesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[110] + mi := &file_tabletmanagerdata_proto_msgTypes[114] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5837,7 +6057,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[114] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5850,7 +6070,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{114} } func (x *ResetSequencesRequest) GetTables() []string { @@ -5869,7 +6089,7 @@ type ResetSequencesResponse struct { func (x *ResetSequencesResponse) Reset() { *x = ResetSequencesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[111] + mi := &file_tabletmanagerdata_proto_msgTypes[115] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5882,7 +6102,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[115] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5895,7 +6115,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{115} } type CheckThrottlerRequest struct { @@ -5909,7 +6129,7 @@ type CheckThrottlerRequest struct { func (x *CheckThrottlerRequest) Reset() { *x = CheckThrottlerRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[112] + mi := &file_tabletmanagerdata_proto_msgTypes[116] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5922,7 +6142,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[116] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5935,7 +6155,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{116} } func (x *CheckThrottlerRequest) GetAppName() string { @@ -5968,7 +6188,7 @@ type CheckThrottlerResponse struct { func (x *CheckThrottlerResponse) Reset() { *x = CheckThrottlerResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[113] + mi := &file_tabletmanagerdata_proto_msgTypes[117] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5981,7 +6201,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[117] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5994,7 +6214,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{117} } func (x *CheckThrottlerResponse) GetStatusCode() int32 { @@ -6063,7 +6283,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[121] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6076,7 +6296,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[121] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6089,7 +6309,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 { @@ -6718,215 +6938,244 @@ var file_tabletmanagerdata_proto_rawDesc = []byte{ 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, 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, + 0x75, 0x6c, 0x74, 0x22, 0x3a, 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, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x62, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x62, 0x4e, 0x61, 0x6d, 0x65, 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, 0xef, 0x01, 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, 0x17, 0x0a, 0x07, 0x64, 0x62, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x62, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x69, + 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, + 0x65, 0x49, 0x64, 0x73, 0x12, 0x3d, 0x0a, 0x06, 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, 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, - 0xe9, 0x02, 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, 0x22, 0x50, 0x0a, 0x22, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x66, + 0x72, 0x6f, 0x7a, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x65, 0x78, 0x63, + 0x6c, 0x75, 0x64, 0x65, 0x46, 0x72, 0x6f, 0x7a, 0x65, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, + 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x57, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 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, + 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, 0xe9, 0x02, 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, 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, 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 ( @@ -6942,7 +7191,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, 122) var file_tabletmanagerdata_proto_goTypes = []interface{}{ (TabletSelectionPreference)(0), // 0: tabletmanagerdata.TabletSelectionPreference (*TableDefinition)(nil), // 1: tabletmanagerdata.TableDefinition @@ -7045,113 +7294,119 @@ 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 + (*ResetSequencesRequest)(nil), // 115: tabletmanagerdata.ResetSequencesRequest + (*ResetSequencesResponse)(nil), // 116: tabletmanagerdata.ResetSequencesResponse + (*CheckThrottlerRequest)(nil), // 117: tabletmanagerdata.CheckThrottlerRequest + (*CheckThrottlerResponse)(nil), // 118: tabletmanagerdata.CheckThrottlerResponse + nil, // 119: tabletmanagerdata.UserPermission.PrivilegesEntry + nil, // 120: tabletmanagerdata.DbPermission.PrivilegesEntry + nil, // 121: tabletmanagerdata.ExecuteHookRequest.ExtraEnvEntry + (*ReadVReplicationWorkflowResponse_Stream)(nil), // 122: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + (*query.Field)(nil), // 123: query.Field + (topodata.TabletType)(0), // 124: topodata.TabletType + (*vtrpc.CallerID)(nil), // 125: vtrpc.CallerID + (*query.QueryResult)(nil), // 126: query.QueryResult + (*replicationdata.Status)(nil), // 127: replicationdata.Status + (*replicationdata.PrimaryStatus)(nil), // 128: replicationdata.PrimaryStatus + (*topodata.TabletAlias)(nil), // 129: topodata.TabletAlias + (*replicationdata.FullStatus)(nil), // 130: replicationdata.FullStatus + (replicationdata.StopReplicationMode)(0), // 131: replicationdata.StopReplicationMode + (*replicationdata.StopReplicationStatus)(nil), // 132: replicationdata.StopReplicationStatus + (*logutil.Event)(nil), // 133: logutil.Event + (*vttime.Time)(nil), // 134: vttime.Time + (*binlogdata.BinlogSource)(nil), // 135: binlogdata.BinlogSource + (binlogdata.VReplicationWorkflowType)(0), // 136: binlogdata.VReplicationWorkflowType + (binlogdata.VReplicationWorkflowSubType)(0), // 137: binlogdata.VReplicationWorkflowSubType + (binlogdata.VReplicationWorkflowState)(0), // 138: binlogdata.VReplicationWorkflowState + (binlogdata.OnDDLAction)(0), // 139: binlogdata.OnDDLAction } var file_tabletmanagerdata_proto_depIdxs = []int32{ - 119, // 0: tabletmanagerdata.TableDefinition.fields:type_name -> query.Field + 123, // 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 + 119, // 4: tabletmanagerdata.UserPermission.privileges:type_name -> tabletmanagerdata.UserPermission.PrivilegesEntry + 120, // 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 + 121, // 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 + 124, // 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 + 125, // 17: tabletmanagerdata.ExecuteQueryRequest.caller_id:type_name -> vtrpc.CallerID + 126, // 18: tabletmanagerdata.ExecuteQueryResponse.result:type_name -> query.QueryResult + 126, // 19: tabletmanagerdata.ExecuteFetchAsDbaResponse.result:type_name -> query.QueryResult + 126, // 20: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse.result:type_name -> query.QueryResult + 126, // 21: tabletmanagerdata.ExecuteFetchAsAppResponse.result:type_name -> query.QueryResult + 127, // 22: tabletmanagerdata.ReplicationStatusResponse.status:type_name -> replicationdata.Status + 128, // 23: tabletmanagerdata.PrimaryStatusResponse.status:type_name -> replicationdata.PrimaryStatus + 126, // 24: tabletmanagerdata.VReplicationExecResponse.result:type_name -> query.QueryResult + 129, // 25: tabletmanagerdata.PopulateReparentJournalRequest.primary_alias:type_name -> topodata.TabletAlias + 129, // 26: tabletmanagerdata.InitReplicaRequest.parent:type_name -> topodata.TabletAlias + 128, // 27: tabletmanagerdata.DemotePrimaryResponse.primary_status:type_name -> replicationdata.PrimaryStatus + 130, // 28: tabletmanagerdata.FullStatusResponse.status:type_name -> replicationdata.FullStatus + 129, // 29: tabletmanagerdata.SetReplicationSourceRequest.parent:type_name -> topodata.TabletAlias + 129, // 30: tabletmanagerdata.ReplicaWasRestartedRequest.parent:type_name -> topodata.TabletAlias + 131, // 31: tabletmanagerdata.StopReplicationAndGetStatusRequest.stop_replication_mode:type_name -> replicationdata.StopReplicationMode + 132, // 32: tabletmanagerdata.StopReplicationAndGetStatusResponse.status:type_name -> replicationdata.StopReplicationStatus + 133, // 33: tabletmanagerdata.BackupResponse.event:type_name -> logutil.Event + 134, // 34: tabletmanagerdata.RestoreFromBackupRequest.backup_time:type_name -> vttime.Time + 134, // 35: tabletmanagerdata.RestoreFromBackupRequest.restore_to_timestamp:type_name -> vttime.Time + 133, // 36: tabletmanagerdata.RestoreFromBackupResponse.event:type_name -> logutil.Event + 135, // 37: tabletmanagerdata.CreateVReplicationWorkflowRequest.binlog_source:type_name -> binlogdata.BinlogSource + 124, // 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 + 136, // 40: tabletmanagerdata.CreateVReplicationWorkflowRequest.workflow_type:type_name -> binlogdata.VReplicationWorkflowType + 137, // 41: tabletmanagerdata.CreateVReplicationWorkflowRequest.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType + 126, // 42: tabletmanagerdata.CreateVReplicationWorkflowResponse.result:type_name -> query.QueryResult + 126, // 43: tabletmanagerdata.DeleteVReplicationWorkflowResponse.result:type_name -> query.QueryResult + 138, // 44: tabletmanagerdata.ReadVReplicationWorkflowsRequest.states:type_name -> binlogdata.VReplicationWorkflowState + 106, // 45: tabletmanagerdata.ReadVReplicationWorkflowsResponse.workflows:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse + 124, // 46: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_types:type_name -> topodata.TabletType + 0, // 47: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference + 136, // 48: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_type:type_name -> binlogdata.VReplicationWorkflowType + 137, // 49: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType + 122, // 50: tabletmanagerdata.ReadVReplicationWorkflowResponse.streams:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + 112, // 51: tabletmanagerdata.VDiffRequest.options:type_name -> tabletmanagerdata.VDiffOptions + 126, // 52: tabletmanagerdata.VDiffResponse.output:type_name -> query.QueryResult + 109, // 53: tabletmanagerdata.VDiffOptions.picker_options:type_name -> tabletmanagerdata.VDiffPickerOptions + 111, // 54: tabletmanagerdata.VDiffOptions.core_options:type_name -> tabletmanagerdata.VDiffCoreOptions + 110, // 55: tabletmanagerdata.VDiffOptions.report_options:type_name -> tabletmanagerdata.VDiffReportOptions + 124, // 56: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_types:type_name -> topodata.TabletType + 0, // 57: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference + 139, // 58: tabletmanagerdata.UpdateVReplicationWorkflowRequest.on_ddl:type_name -> binlogdata.OnDDLAction + 138, // 59: tabletmanagerdata.UpdateVReplicationWorkflowRequest.state:type_name -> binlogdata.VReplicationWorkflowState + 126, // 60: tabletmanagerdata.UpdateVReplicationWorkflowResponse.result:type_name -> query.QueryResult + 135, // 61: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.bls:type_name -> binlogdata.BinlogSource + 134, // 62: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_updated:type_name -> vttime.Time + 134, // 63: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.transaction_timestamp:type_name -> vttime.Time + 138, // 64: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.state:type_name -> binlogdata.VReplicationWorkflowState + 134, // 65: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_heartbeat:type_name -> vttime.Time + 134, // 66: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_throttled:type_name -> vttime.Time + 67, // [67:67] is the sub-list for method output_type + 67, // [67:67] is the sub-list for method input_type + 67, // [67:67] is the sub-list for extension type_name + 67, // [67:67] is the sub-list for extension extendee + 0, // [0:67] is the sub-list for field type_name } func init() { file_tabletmanagerdata_proto_init() } @@ -8361,7 +8616,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: @@ -8373,7 +8628,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: @@ -8385,7 +8640,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: @@ -8397,7 +8652,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: @@ -8409,7 +8664,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: @@ -8421,7 +8676,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: @@ -8433,7 +8688,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: @@ -8445,7 +8700,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: @@ -8457,7 +8712,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: @@ -8469,7 +8724,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: @@ -8481,7 +8736,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: @@ -8493,7 +8748,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: @@ -8505,7 +8760,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: @@ -8517,7 +8772,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.(*ResetSequencesRequest); 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.(*ResetSequencesResponse); 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.(*CheckThrottlerRequest); i { case 0: return &v.state case 1: @@ -8529,6 +8820,18 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[117].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[121].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReadVReplicationWorkflowResponse_Stream); i { case 0: return &v.state @@ -8547,7 +8850,7 @@ func file_tabletmanagerdata_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_tabletmanagerdata_proto_rawDesc, NumEnums: 1, - NumMessages: 118, + NumMessages: 122, 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 b50d3298441..1191501612f 100644 --- a/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go +++ b/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go @@ -1922,6 +1922,99 @@ func (m *DeleteVReplicationWorkflowResponse) CloneMessageVT() proto.Message { return m.CloneVT() } +func (m *HasVReplicationWorkflowsRequest) CloneVT() *HasVReplicationWorkflowsRequest { + if m == nil { + return (*HasVReplicationWorkflowsRequest)(nil) + } + r := &HasVReplicationWorkflowsRequest{ + DbName: m.DbName, + } + 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{ + DbName: m.DbName, + ExcludeFrozen: m.ExcludeFrozen, + } + if rhs := m.IncludeIds; rhs != nil { + tmpContainer := make([]int32, len(rhs)) + copy(tmpContainer, rhs) + r.IncludeIds = tmpContainer + } + if rhs := m.States; rhs != nil { + tmpContainer := make([]binlogdata.VReplicationWorkflowState, len(rhs)) + copy(tmpContainer, rhs) + r.States = 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 *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) @@ -6684,6 +6777,235 @@ func (m *DeleteVReplicationWorkflowResponse) MarshalToSizedBufferVT(dAtA []byte) return len(dAtA) - i, nil } +func (m *HasVReplicationWorkflowsRequest) 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 *HasVReplicationWorkflowsRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *HasVReplicationWorkflowsRequest) 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.DbName) > 0 { + i -= len(m.DbName) + copy(dAtA[i:], m.DbName) + i = encodeVarint(dAtA, i, uint64(len(m.DbName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HasVReplicationWorkflowsResponse) 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 *HasVReplicationWorkflowsResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *HasVReplicationWorkflowsResponse) 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.Has { + i-- + if m.Has { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ReadVReplicationWorkflowsRequest) 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 *ReadVReplicationWorkflowsRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ReadVReplicationWorkflowsRequest) 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.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] = 0x2a + } + } + if m.ExcludeFrozen { + i-- + if m.ExcludeFrozen { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if len(m.States) > 0 { + var pksize2 int + for _, num := range m.States { + pksize2 += sov(uint64(num)) + } + i -= pksize2 + j1 := i + for _, num1 := range m.States { + 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] = 0x1a + } + if len(m.IncludeIds) > 0 { + var pksize4 int + for _, num := range m.IncludeIds { + pksize4 += sov(uint64(num)) + } + i -= pksize4 + j3 := i + for _, num1 := range m.IncludeIds { + num := uint64(num1) + for num >= 1<<7 { + dAtA[j3] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j3++ + } + dAtA[j3] = uint8(num) + j3++ + } + i = encodeVarint(dAtA, i, uint64(pksize4)) + i-- + dAtA[i] = 0x12 + } + 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ReadVReplicationWorkflowsResponse) 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 *ReadVReplicationWorkflowsResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ReadVReplicationWorkflowsResponse) 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.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 + } + } + return len(dAtA) - i, nil +} + func (m *ReadVReplicationWorkflowRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -9241,13 +9563,13 @@ func (m *DeleteVReplicationWorkflowResponse) SizeVT() (n int) { return n } -func (m *ReadVReplicationWorkflowRequest) SizeVT() (n int) { +func (m *HasVReplicationWorkflowsRequest) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Workflow) + l = len(m.DbName) if l > 0 { n += 1 + l + sov(uint64(l)) } @@ -9255,13 +9577,93 @@ func (m *ReadVReplicationWorkflowRequest) SizeVT() (n int) { return n } -func (m *ReadVReplicationWorkflowResponse_Stream) SizeVT() (n int) { +func (m *HasVReplicationWorkflowsResponse) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l - if m.Id != 0 { + 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 + l = len(m.DbName) + if l > 0 { + n += 1 + l + sov(uint64(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.States) > 0 { + l = 0 + for _, e := range m.States { + l += sov(uint64(e)) + } + n += 1 + sov(uint64(l)) + l + } + if m.ExcludeFrozen { + n += 2 + } + if len(m.ExcludeWorkflows) > 0 { + for _, s := range m.ExcludeWorkflows { + l = len(s) + n += 1 + l + sov(uint64(l)) + } + } + 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 + } + var l int + _ = l + l = len(m.Workflow) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *ReadVReplicationWorkflowResponse_Stream) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { n += 1 + sov(uint64(m.Id)) } if m.Bls != nil { @@ -18865,6 +19267,525 @@ func (m *DeleteVReplicationWorkflowResponse) UnmarshalVT(dAtA []byte) error { } 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 { + case 1: + 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 + 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 != 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 2: + 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 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.States = append(m.States, 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.States) == 0 { + m.States = 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.States = append(m.States, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field States", wireType) + } + case 4: + 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) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExcludeWorkflows", 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.ExcludeWorkflows = append(m.ExcludeWorkflows, 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 *ReadVReplicationWorkflowsResponse) 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: ReadVReplicationWorkflowsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + 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 Workflows", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Workflows = append(m.Workflows, &ReadVReplicationWorkflowResponse{}) + if err := m.Workflows[len(m.Workflows)-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 *ReadVReplicationWorkflowRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/go/vt/proto/tabletmanagerservice/tabletmanagerservice.pb.go b/go/vt/proto/tabletmanagerservice/tabletmanagerservice.pb.go index 6cb55ecf221..8ed7f6066ab 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, 0xdd, 0x2e, 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,177 @@ 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, - 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, 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, + 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, 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, + 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, 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, 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, + 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, 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, 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, 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, + 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, 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, 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, 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, + 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, 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, + 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 +458,83 @@ 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.VDiffRequest)(nil), // 37: tabletmanagerdata.VDiffRequest + (*tabletmanagerdata.ResetReplicationRequest)(nil), // 38: tabletmanagerdata.ResetReplicationRequest + (*tabletmanagerdata.InitPrimaryRequest)(nil), // 39: tabletmanagerdata.InitPrimaryRequest + (*tabletmanagerdata.PopulateReparentJournalRequest)(nil), // 40: tabletmanagerdata.PopulateReparentJournalRequest + (*tabletmanagerdata.InitReplicaRequest)(nil), // 41: tabletmanagerdata.InitReplicaRequest + (*tabletmanagerdata.DemotePrimaryRequest)(nil), // 42: tabletmanagerdata.DemotePrimaryRequest + (*tabletmanagerdata.UndoDemotePrimaryRequest)(nil), // 43: tabletmanagerdata.UndoDemotePrimaryRequest + (*tabletmanagerdata.ReplicaWasPromotedRequest)(nil), // 44: tabletmanagerdata.ReplicaWasPromotedRequest + (*tabletmanagerdata.ResetReplicationParametersRequest)(nil), // 45: tabletmanagerdata.ResetReplicationParametersRequest + (*tabletmanagerdata.FullStatusRequest)(nil), // 46: tabletmanagerdata.FullStatusRequest + (*tabletmanagerdata.SetReplicationSourceRequest)(nil), // 47: tabletmanagerdata.SetReplicationSourceRequest + (*tabletmanagerdata.ReplicaWasRestartedRequest)(nil), // 48: tabletmanagerdata.ReplicaWasRestartedRequest + (*tabletmanagerdata.StopReplicationAndGetStatusRequest)(nil), // 49: tabletmanagerdata.StopReplicationAndGetStatusRequest + (*tabletmanagerdata.PromoteReplicaRequest)(nil), // 50: tabletmanagerdata.PromoteReplicaRequest + (*tabletmanagerdata.BackupRequest)(nil), // 51: tabletmanagerdata.BackupRequest + (*tabletmanagerdata.RestoreFromBackupRequest)(nil), // 52: tabletmanagerdata.RestoreFromBackupRequest + (*tabletmanagerdata.CheckThrottlerRequest)(nil), // 53: tabletmanagerdata.CheckThrottlerRequest + (*tabletmanagerdata.PingResponse)(nil), // 54: tabletmanagerdata.PingResponse + (*tabletmanagerdata.SleepResponse)(nil), // 55: tabletmanagerdata.SleepResponse + (*tabletmanagerdata.ExecuteHookResponse)(nil), // 56: tabletmanagerdata.ExecuteHookResponse + (*tabletmanagerdata.GetSchemaResponse)(nil), // 57: tabletmanagerdata.GetSchemaResponse + (*tabletmanagerdata.GetPermissionsResponse)(nil), // 58: tabletmanagerdata.GetPermissionsResponse + (*tabletmanagerdata.SetReadOnlyResponse)(nil), // 59: tabletmanagerdata.SetReadOnlyResponse + (*tabletmanagerdata.SetReadWriteResponse)(nil), // 60: tabletmanagerdata.SetReadWriteResponse + (*tabletmanagerdata.ChangeTypeResponse)(nil), // 61: tabletmanagerdata.ChangeTypeResponse + (*tabletmanagerdata.RefreshStateResponse)(nil), // 62: tabletmanagerdata.RefreshStateResponse + (*tabletmanagerdata.RunHealthCheckResponse)(nil), // 63: tabletmanagerdata.RunHealthCheckResponse + (*tabletmanagerdata.ReloadSchemaResponse)(nil), // 64: tabletmanagerdata.ReloadSchemaResponse + (*tabletmanagerdata.PreflightSchemaResponse)(nil), // 65: tabletmanagerdata.PreflightSchemaResponse + (*tabletmanagerdata.ApplySchemaResponse)(nil), // 66: tabletmanagerdata.ApplySchemaResponse + (*tabletmanagerdata.ResetSequencesResponse)(nil), // 67: tabletmanagerdata.ResetSequencesResponse + (*tabletmanagerdata.LockTablesResponse)(nil), // 68: tabletmanagerdata.LockTablesResponse + (*tabletmanagerdata.UnlockTablesResponse)(nil), // 69: tabletmanagerdata.UnlockTablesResponse + (*tabletmanagerdata.ExecuteQueryResponse)(nil), // 70: tabletmanagerdata.ExecuteQueryResponse + (*tabletmanagerdata.ExecuteFetchAsDbaResponse)(nil), // 71: tabletmanagerdata.ExecuteFetchAsDbaResponse + (*tabletmanagerdata.ExecuteFetchAsAllPrivsResponse)(nil), // 72: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse + (*tabletmanagerdata.ExecuteFetchAsAppResponse)(nil), // 73: tabletmanagerdata.ExecuteFetchAsAppResponse + (*tabletmanagerdata.ReplicationStatusResponse)(nil), // 74: tabletmanagerdata.ReplicationStatusResponse + (*tabletmanagerdata.PrimaryStatusResponse)(nil), // 75: tabletmanagerdata.PrimaryStatusResponse + (*tabletmanagerdata.PrimaryPositionResponse)(nil), // 76: tabletmanagerdata.PrimaryPositionResponse + (*tabletmanagerdata.WaitForPositionResponse)(nil), // 77: tabletmanagerdata.WaitForPositionResponse + (*tabletmanagerdata.StopReplicationResponse)(nil), // 78: tabletmanagerdata.StopReplicationResponse + (*tabletmanagerdata.StopReplicationMinimumResponse)(nil), // 79: tabletmanagerdata.StopReplicationMinimumResponse + (*tabletmanagerdata.StartReplicationResponse)(nil), // 80: tabletmanagerdata.StartReplicationResponse + (*tabletmanagerdata.StartReplicationUntilAfterResponse)(nil), // 81: tabletmanagerdata.StartReplicationUntilAfterResponse + (*tabletmanagerdata.GetReplicasResponse)(nil), // 82: tabletmanagerdata.GetReplicasResponse + (*tabletmanagerdata.CreateVReplicationWorkflowResponse)(nil), // 83: tabletmanagerdata.CreateVReplicationWorkflowResponse + (*tabletmanagerdata.DeleteVReplicationWorkflowResponse)(nil), // 84: tabletmanagerdata.DeleteVReplicationWorkflowResponse + (*tabletmanagerdata.HasVReplicationWorkflowsResponse)(nil), // 85: tabletmanagerdata.HasVReplicationWorkflowsResponse + (*tabletmanagerdata.ReadVReplicationWorkflowResponse)(nil), // 86: tabletmanagerdata.ReadVReplicationWorkflowResponse + (*tabletmanagerdata.ReadVReplicationWorkflowsResponse)(nil), // 87: tabletmanagerdata.ReadVReplicationWorkflowsResponse + (*tabletmanagerdata.VReplicationExecResponse)(nil), // 88: tabletmanagerdata.VReplicationExecResponse + (*tabletmanagerdata.VReplicationWaitForPosResponse)(nil), // 89: tabletmanagerdata.VReplicationWaitForPosResponse + (*tabletmanagerdata.UpdateVReplicationWorkflowResponse)(nil), // 90: tabletmanagerdata.UpdateVReplicationWorkflowResponse + (*tabletmanagerdata.VDiffResponse)(nil), // 91: tabletmanagerdata.VDiffResponse + (*tabletmanagerdata.ResetReplicationResponse)(nil), // 92: tabletmanagerdata.ResetReplicationResponse + (*tabletmanagerdata.InitPrimaryResponse)(nil), // 93: tabletmanagerdata.InitPrimaryResponse + (*tabletmanagerdata.PopulateReparentJournalResponse)(nil), // 94: tabletmanagerdata.PopulateReparentJournalResponse + (*tabletmanagerdata.InitReplicaResponse)(nil), // 95: tabletmanagerdata.InitReplicaResponse + (*tabletmanagerdata.DemotePrimaryResponse)(nil), // 96: tabletmanagerdata.DemotePrimaryResponse + (*tabletmanagerdata.UndoDemotePrimaryResponse)(nil), // 97: tabletmanagerdata.UndoDemotePrimaryResponse + (*tabletmanagerdata.ReplicaWasPromotedResponse)(nil), // 98: tabletmanagerdata.ReplicaWasPromotedResponse + (*tabletmanagerdata.ResetReplicationParametersResponse)(nil), // 99: tabletmanagerdata.ResetReplicationParametersResponse + (*tabletmanagerdata.FullStatusResponse)(nil), // 100: tabletmanagerdata.FullStatusResponse + (*tabletmanagerdata.SetReplicationSourceResponse)(nil), // 101: tabletmanagerdata.SetReplicationSourceResponse + (*tabletmanagerdata.ReplicaWasRestartedResponse)(nil), // 102: tabletmanagerdata.ReplicaWasRestartedResponse + (*tabletmanagerdata.StopReplicationAndGetStatusResponse)(nil), // 103: tabletmanagerdata.StopReplicationAndGetStatusResponse + (*tabletmanagerdata.PromoteReplicaResponse)(nil), // 104: tabletmanagerdata.PromoteReplicaResponse + (*tabletmanagerdata.BackupResponse)(nil), // 105: tabletmanagerdata.BackupResponse + (*tabletmanagerdata.RestoreFromBackupResponse)(nil), // 106: tabletmanagerdata.RestoreFromBackupResponse + (*tabletmanagerdata.CheckThrottlerResponse)(nil), // 107: tabletmanagerdata.CheckThrottlerResponse } var file_tabletmanagerservice_proto_depIdxs = []int32{ 0, // 0: tabletmanagerservice.TabletManager.Ping:input_type -> tabletmanagerdata.PingRequest @@ -547,81 +568,85 @@ 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.VDiff:input_type -> tabletmanagerdata.VDiffRequest + 38, // 38: tabletmanagerservice.TabletManager.ResetReplication:input_type -> tabletmanagerdata.ResetReplicationRequest + 39, // 39: tabletmanagerservice.TabletManager.InitPrimary:input_type -> tabletmanagerdata.InitPrimaryRequest + 40, // 40: tabletmanagerservice.TabletManager.PopulateReparentJournal:input_type -> tabletmanagerdata.PopulateReparentJournalRequest + 41, // 41: tabletmanagerservice.TabletManager.InitReplica:input_type -> tabletmanagerdata.InitReplicaRequest + 42, // 42: tabletmanagerservice.TabletManager.DemotePrimary:input_type -> tabletmanagerdata.DemotePrimaryRequest + 43, // 43: tabletmanagerservice.TabletManager.UndoDemotePrimary:input_type -> tabletmanagerdata.UndoDemotePrimaryRequest + 44, // 44: tabletmanagerservice.TabletManager.ReplicaWasPromoted:input_type -> tabletmanagerdata.ReplicaWasPromotedRequest + 45, // 45: tabletmanagerservice.TabletManager.ResetReplicationParameters:input_type -> tabletmanagerdata.ResetReplicationParametersRequest + 46, // 46: tabletmanagerservice.TabletManager.FullStatus:input_type -> tabletmanagerdata.FullStatusRequest + 47, // 47: tabletmanagerservice.TabletManager.SetReplicationSource:input_type -> tabletmanagerdata.SetReplicationSourceRequest + 48, // 48: tabletmanagerservice.TabletManager.ReplicaWasRestarted:input_type -> tabletmanagerdata.ReplicaWasRestartedRequest + 49, // 49: tabletmanagerservice.TabletManager.StopReplicationAndGetStatus:input_type -> tabletmanagerdata.StopReplicationAndGetStatusRequest + 50, // 50: tabletmanagerservice.TabletManager.PromoteReplica:input_type -> tabletmanagerdata.PromoteReplicaRequest + 51, // 51: tabletmanagerservice.TabletManager.Backup:input_type -> tabletmanagerdata.BackupRequest + 52, // 52: tabletmanagerservice.TabletManager.RestoreFromBackup:input_type -> tabletmanagerdata.RestoreFromBackupRequest + 53, // 53: tabletmanagerservice.TabletManager.CheckThrottler:input_type -> tabletmanagerdata.CheckThrottlerRequest + 54, // 54: tabletmanagerservice.TabletManager.Ping:output_type -> tabletmanagerdata.PingResponse + 55, // 55: tabletmanagerservice.TabletManager.Sleep:output_type -> tabletmanagerdata.SleepResponse + 56, // 56: tabletmanagerservice.TabletManager.ExecuteHook:output_type -> tabletmanagerdata.ExecuteHookResponse + 57, // 57: tabletmanagerservice.TabletManager.GetSchema:output_type -> tabletmanagerdata.GetSchemaResponse + 58, // 58: tabletmanagerservice.TabletManager.GetPermissions:output_type -> tabletmanagerdata.GetPermissionsResponse + 59, // 59: tabletmanagerservice.TabletManager.SetReadOnly:output_type -> tabletmanagerdata.SetReadOnlyResponse + 60, // 60: tabletmanagerservice.TabletManager.SetReadWrite:output_type -> tabletmanagerdata.SetReadWriteResponse + 61, // 61: tabletmanagerservice.TabletManager.ChangeType:output_type -> tabletmanagerdata.ChangeTypeResponse + 62, // 62: tabletmanagerservice.TabletManager.RefreshState:output_type -> tabletmanagerdata.RefreshStateResponse + 63, // 63: tabletmanagerservice.TabletManager.RunHealthCheck:output_type -> tabletmanagerdata.RunHealthCheckResponse + 64, // 64: tabletmanagerservice.TabletManager.ReloadSchema:output_type -> tabletmanagerdata.ReloadSchemaResponse + 65, // 65: tabletmanagerservice.TabletManager.PreflightSchema:output_type -> tabletmanagerdata.PreflightSchemaResponse + 66, // 66: tabletmanagerservice.TabletManager.ApplySchema:output_type -> tabletmanagerdata.ApplySchemaResponse + 67, // 67: tabletmanagerservice.TabletManager.ResetSequences:output_type -> tabletmanagerdata.ResetSequencesResponse + 68, // 68: tabletmanagerservice.TabletManager.LockTables:output_type -> tabletmanagerdata.LockTablesResponse + 69, // 69: tabletmanagerservice.TabletManager.UnlockTables:output_type -> tabletmanagerdata.UnlockTablesResponse + 70, // 70: tabletmanagerservice.TabletManager.ExecuteQuery:output_type -> tabletmanagerdata.ExecuteQueryResponse + 71, // 71: tabletmanagerservice.TabletManager.ExecuteFetchAsDba:output_type -> tabletmanagerdata.ExecuteFetchAsDbaResponse + 72, // 72: tabletmanagerservice.TabletManager.ExecuteFetchAsAllPrivs:output_type -> tabletmanagerdata.ExecuteFetchAsAllPrivsResponse + 73, // 73: tabletmanagerservice.TabletManager.ExecuteFetchAsApp:output_type -> tabletmanagerdata.ExecuteFetchAsAppResponse + 74, // 74: tabletmanagerservice.TabletManager.ReplicationStatus:output_type -> tabletmanagerdata.ReplicationStatusResponse + 75, // 75: tabletmanagerservice.TabletManager.PrimaryStatus:output_type -> tabletmanagerdata.PrimaryStatusResponse + 76, // 76: tabletmanagerservice.TabletManager.PrimaryPosition:output_type -> tabletmanagerdata.PrimaryPositionResponse + 77, // 77: tabletmanagerservice.TabletManager.WaitForPosition:output_type -> tabletmanagerdata.WaitForPositionResponse + 78, // 78: tabletmanagerservice.TabletManager.StopReplication:output_type -> tabletmanagerdata.StopReplicationResponse + 79, // 79: tabletmanagerservice.TabletManager.StopReplicationMinimum:output_type -> tabletmanagerdata.StopReplicationMinimumResponse + 80, // 80: tabletmanagerservice.TabletManager.StartReplication:output_type -> tabletmanagerdata.StartReplicationResponse + 81, // 81: tabletmanagerservice.TabletManager.StartReplicationUntilAfter:output_type -> tabletmanagerdata.StartReplicationUntilAfterResponse + 82, // 82: tabletmanagerservice.TabletManager.GetReplicas:output_type -> tabletmanagerdata.GetReplicasResponse + 83, // 83: tabletmanagerservice.TabletManager.CreateVReplicationWorkflow:output_type -> tabletmanagerdata.CreateVReplicationWorkflowResponse + 84, // 84: tabletmanagerservice.TabletManager.DeleteVReplicationWorkflow:output_type -> tabletmanagerdata.DeleteVReplicationWorkflowResponse + 85, // 85: tabletmanagerservice.TabletManager.HasVReplicationWorkflows:output_type -> tabletmanagerdata.HasVReplicationWorkflowsResponse + 86, // 86: tabletmanagerservice.TabletManager.ReadVReplicationWorkflow:output_type -> tabletmanagerdata.ReadVReplicationWorkflowResponse + 87, // 87: tabletmanagerservice.TabletManager.ReadVReplicationWorkflows:output_type -> tabletmanagerdata.ReadVReplicationWorkflowsResponse + 88, // 88: tabletmanagerservice.TabletManager.VReplicationExec:output_type -> tabletmanagerdata.VReplicationExecResponse + 89, // 89: tabletmanagerservice.TabletManager.VReplicationWaitForPos:output_type -> tabletmanagerdata.VReplicationWaitForPosResponse + 90, // 90: tabletmanagerservice.TabletManager.UpdateVReplicationWorkflow:output_type -> tabletmanagerdata.UpdateVReplicationWorkflowResponse + 91, // 91: tabletmanagerservice.TabletManager.VDiff:output_type -> tabletmanagerdata.VDiffResponse + 92, // 92: tabletmanagerservice.TabletManager.ResetReplication:output_type -> tabletmanagerdata.ResetReplicationResponse + 93, // 93: tabletmanagerservice.TabletManager.InitPrimary:output_type -> tabletmanagerdata.InitPrimaryResponse + 94, // 94: tabletmanagerservice.TabletManager.PopulateReparentJournal:output_type -> tabletmanagerdata.PopulateReparentJournalResponse + 95, // 95: tabletmanagerservice.TabletManager.InitReplica:output_type -> tabletmanagerdata.InitReplicaResponse + 96, // 96: tabletmanagerservice.TabletManager.DemotePrimary:output_type -> tabletmanagerdata.DemotePrimaryResponse + 97, // 97: tabletmanagerservice.TabletManager.UndoDemotePrimary:output_type -> tabletmanagerdata.UndoDemotePrimaryResponse + 98, // 98: tabletmanagerservice.TabletManager.ReplicaWasPromoted:output_type -> tabletmanagerdata.ReplicaWasPromotedResponse + 99, // 99: tabletmanagerservice.TabletManager.ResetReplicationParameters:output_type -> tabletmanagerdata.ResetReplicationParametersResponse + 100, // 100: tabletmanagerservice.TabletManager.FullStatus:output_type -> tabletmanagerdata.FullStatusResponse + 101, // 101: tabletmanagerservice.TabletManager.SetReplicationSource:output_type -> tabletmanagerdata.SetReplicationSourceResponse + 102, // 102: tabletmanagerservice.TabletManager.ReplicaWasRestarted:output_type -> tabletmanagerdata.ReplicaWasRestartedResponse + 103, // 103: tabletmanagerservice.TabletManager.StopReplicationAndGetStatus:output_type -> tabletmanagerdata.StopReplicationAndGetStatusResponse + 104, // 104: tabletmanagerservice.TabletManager.PromoteReplica:output_type -> tabletmanagerdata.PromoteReplicaResponse + 105, // 105: tabletmanagerservice.TabletManager.Backup:output_type -> tabletmanagerdata.BackupResponse + 106, // 106: tabletmanagerservice.TabletManager.RestoreFromBackup:output_type -> tabletmanagerdata.RestoreFromBackupResponse + 107, // 107: tabletmanagerservice.TabletManager.CheckThrottler:output_type -> tabletmanagerdata.CheckThrottlerResponse + 54, // [54:108] is the sub-list for method output_type + 0, // [0:54] 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..a9d060d6d63 100644 --- a/go/vt/proto/tabletmanagerservice/tabletmanagerservice_grpc.pb.go +++ b/go/vt/proto/tabletmanagerservice/tabletmanagerservice_grpc.pb.go @@ -72,7 +72,9 @@ 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) @@ -400,6 +402,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 +420,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...) @@ -688,7 +708,9 @@ 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) @@ -827,9 +849,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") } @@ -1461,6 +1489,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 +1525,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 { @@ -1976,10 +2040,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, diff --git a/go/vt/vtcombo/tablet_map.go b/go/vt/vtcombo/tablet_map.go index 4a2aa7ba411..54426200cde 100644 --- a/go/vt/vtcombo/tablet_map.go +++ b/go/vt/vtcombo/tablet_map.go @@ -874,6 +874,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") } diff --git a/go/vt/vtctl/workflow/resharder.go b/go/vt/vtctl/workflow/resharder.go index e36b546c1d2..f9f25d7dd5a 100644 --- a/go/vt/vtctl/workflow/resharder.go +++ b/go/vt/vtctl/workflow/resharder.go @@ -19,14 +19,10 @@ package workflow import ( "context" - "errors" "fmt" "sync" "time" - "google.golang.org/protobuf/encoding/prototext" - - "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/vt/concurrency" "vitess.io/vitess/go/vt/key" "vitess.io/vitess/go/vt/schema" @@ -37,7 +33,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 { @@ -132,13 +130,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{DbName: targetPrimary.DbName()}) if err != nil { - return vterrors.Wrapf(err, "VReplicationExec(%v, %s)", targetPrimary.Tablet, query) + return vterrors.Wrapf(err, "HasVReplicationWorkflows(%v, %s)", targetPrimary.Tablet, targetPrimary.DbName()) } - 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 }) @@ -150,66 +147,61 @@ 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{ + DbName: sourcePrimary.DbName(), + 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() + for _, workflow := range res.Workflows { + mu.Lock() + defer mu.Unlock() - mustCreate := false - var ref map[string]bool - if rs.refStreams == nil { - rs.refStreams = make(map[string]*refStream) - mustCreate = true - } else { - // Copy the ref streams for comparison. - ref = make(map[string]bool, len(rs.refStreams)) - for k := range rs.refStreams { - ref[k] = true + mustCreate := false + var ref map[string]bool + if rs.refStreams == nil { + rs.refStreams = make(map[string]*refStream) + mustCreate = true + } else { + // Copy the ref streams for comparison. + ref = make(map[string]bool, len(rs.refStreams)) + for k := range rs.refStreams { + ref[k] = true + } } - } - for _, row := range qr.Rows { - - workflow := row[0].ToString() - if workflow == "" { + 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 res.Workflows[0].Streams { + bls := stream.Bls + isReference, err := rs.blsIsReference(bls) + if err != nil { + return vterrors.Wrap(err, "blsIsReference") } - } else { - if !ref[refKey] { - return fmt.Errorf("streams are mismatched across source shards for workflow: %s", workflow) + if !isReference { + continue + } + refKey := fmt.Sprintf("%s:%s:%s", workflow, bls.Keyspace, bls.Shard) + if mustCreate { + rs.refStreams[refKey] = &refStream{ + workflow: workflow.Workflow, + bls: bls, + cell: workflow.Cells, + tabletTypes: buildTabletTypesString(workflow.TabletTypes, workflow.TabletSelectionPreference), + } + } 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 }) @@ -332,10 +324,13 @@ func (rs *resharder) startStreams(ctx context.Context) error { // 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.UpdateVReplicationWorkflowRequest{ + Workflow: rs.workflow, + State: binlogdatapb.VReplicationWorkflowState_Running, + } + if _, err := rs.s.tmc.UpdateVReplicationWorkflow(ctx, targetPrimary.Tablet, req); err != nil { + return vterrors.Wrapf(err, "UpdateVReplicationWorkflow(%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 d230fc933f0..6409fda4f4c 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -43,7 +43,6 @@ import ( "vitess.io/vitess/go/trace" "vitess.io/vitess/go/vt/binlog/binlogplayer" "vitess.io/vitess/go/vt/concurrency" - "vitess.io/vitess/go/vt/discovery" "vitess.io/vitess/go/vt/key" "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/logutil" @@ -1698,7 +1697,11 @@ func (s *Server) ReshardCreate(ctx context.Context, req *vtctldatapb.ReshardCrea } else { log.Warningf("Streams will not be started since --auto-start is set to false") } - return nil, nil + + return s.WorkflowStatus(ctx, &vtctldatapb.WorkflowStatusRequest{ + Keyspace: req.Keyspace, + Workflow: req.Workflow, + }) } // VDiffCreate is part of the vtctlservicepb.VtctldServer interface. @@ -1718,11 +1721,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 := buildTabletTypesString(req.TabletTypes, req.TabletSelectionPreference) options := &tabletmanagerdatapb.VDiffOptions{ PickerOptions: &tabletmanagerdatapb.VDiffPickerOptions{ TabletTypes: tabletTypesStr, diff --git a/go/vt/vtctl/workflow/stream_migrator.go b/go/vt/vtctl/workflow/stream_migrator.go index 7d225f6dd9f..c23630cace3 100644 --- a/go/vt/vtctl/workflow/stream_migrator.go +++ b/go/vt/vtctl/workflow/stream_migrator.go @@ -23,10 +23,7 @@ import ( "sync" "text/template" - "google.golang.org/protobuf/encoding/prototext" - "vitess.io/vitess/go/mysql/replication" - "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/vt/concurrency" "vitess.io/vitess/go/vt/key" "vitess.io/vitess/go/vt/logutil" @@ -38,6 +35,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" ) /* @@ -215,84 +213,58 @@ func (sm *StreamMigrator) StopStreams(ctx context.Context) ([]string, error) { // 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) { - 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 != "" { - query += fmt.Sprintf(" and %s", constraint) +func (sm *StreamMigrator) readTabletStreams(ctx context.Context, ti *topo.TabletInfo, ids []int32, states []binlogdatapb.VReplicationWorkflowState, excludeFrozen bool) ([]*VReplicationStream, error) { + req := &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ + DbName: ti.DbName(), + ExcludeWorkflows: []string{sm.ts.ReverseWorkflowName()}, + IncludeIds: ids, + States: states, + ExcludeFrozen: excludeFrozen, } - p3qr, err := sm.ts.TabletManagerClient().VReplicationExec(ctx, ti.Tablet, query) + res, err := sm.ts.TabletManagerClient().ReadVReplicationWorkflows(ctx, ti.Tablet, req) if err != nil { return nil, err } - qr := sqltypes.Proto3ToResult(p3qr) - tabletStreams := make([]*VReplicationStream, 0, len(qr.Rows)) - - for _, row := range qr.Named().Rows { - id, err := row["id"].ToInt32() - if err != nil { - return nil, err - } + tabletStreams := make([]*VReplicationStream, 0, len(res.Workflows)) - workflowName := row["workflow"].ToString() - switch workflowName { + for _, workflow := range res.Workflows { + switch workflow.Workflow { case "": - return nil, fmt.Errorf("VReplication streams must have named workflows for migration: shard: %s:%s, stream: %d", - ti.Keyspace, ti.Shard, id) + 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, stream: %d", - ti.Keyspace, ti.Shard, id) - } - - workflowType, err := row["workflow_type"].ToInt32() - if err != nil { - return nil, err - } - workflowSubType, err := row["workflow_sub_type"].ToInt32() - if err != nil { - return nil, err + return nil, fmt.Errorf("VReplication stream has the same workflow name as the resharding workflow: shard: %s:%s", + ti.Keyspace, ti.Shard) } - deferSecondaryKeys, err := row["defer_secondary_keys"].ToBool() - if err != nil { - return nil, err - } - - var bls binlogdatapb.BinlogSource - rowBytes, err := row["source"].ToBytes() - if err != nil { - return nil, err - } - if err := prototext.Unmarshal(rowBytes, &bls); err != nil { - return nil, err - } + for _, stream := range workflow.Streams { + isReference, err := sm.blsIsReference(stream.Bls) + if err != nil { + return nil, vterrors.Wrap(err, "blsIsReference") + } - isReference, err := sm.blsIsReference(&bls) - if err != nil { - return nil, vterrors.Wrap(err, "blsIsReference") - } + if isReference { + sm.ts.Logger().Infof("readTabletStreams: ignoring reference table %+v", stream.Bls) + continue + } - if isReference { - sm.ts.Logger().Infof("readTabletStreams: ignoring reference table %+v", &bls) - continue - } + pos, err := replication.DecodePosition(stream.Pos) + if err != nil { + return nil, err + } - pos, err := replication.DecodePosition(row["pos"].ToString()) - 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, + }) } - - tabletStreams = append(tabletStreams, &VReplicationStream{ - ID: id, - Workflow: workflowName, - BinlogSource: &bls, - Position: pos, - WorkflowType: binlogdatapb.VReplicationWorkflowType(workflowType), - WorkflowSubType: binlogdatapb.VReplicationWorkflowSubType(workflowSubType), - DeferSecondaryKeys: deferSecondaryKeys, - }) } return tabletStreams, nil } @@ -318,7 +290,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 +301,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 } @@ -423,7 +396,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 } @@ -522,7 +495,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 f56b721a415..c7204b213d9 100644 --- a/go/vt/vtctl/workflow/utils.go +++ b/go/vt/vtctl/workflow/utils.go @@ -26,8 +26,6 @@ import ( "strings" "sync" - "google.golang.org/protobuf/encoding/prototext" - "vitess.io/vitess/go/sets" "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/vt/concurrency" @@ -106,26 +104,23 @@ 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{ + DbName: primary.DbName(), + }) + if err != nil { + allErrors.RecordError(vterrors.Wrap(err, "validateWorkflowName.ReadVReplicationWorkflows")) + 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) @@ -531,12 +526,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 }) } @@ -647,122 +650,10 @@ func areTabletsAvailableToStreamFrom(ctx context.Context, req *vtctldatapb.Workf return nil } -// LegacyBuildTargets collects MigrationTargets and other metadata (see TargetInfo) -// from a workflow in the target keyspace. It uses VReplicationExec to get the workflow -// details rather than the new TabletManager ReadVReplicationWorkflow RPC. This is -// being used to slowly transition all of the older code, including unit tests, over to -// the new RPC and limit the impact of the new implementation to vtctldclient. You can see -// how the unit tests were being migrated here: https://gist.github.com/mattlord/738c12befe951f8d09304ff7fdc47c46 -// -// New callers should instead use the new BuildTargets function. -// -// It returns ErrNoStreams if there are no targets found for the workflow. -func LegacyBuildTargets(ctx context.Context, ts *topo.Server, tmc tmclient.TabletManagerClient, targetKeyspace string, workflow string) (*TargetInfo, error) { - targetShards, err := ts.GetShardNames(ctx, targetKeyspace) - if err != nil { - return nil, err - } - - var ( - frozen bool - optCells string - optTabletTypes string - targets = make(map[string]*MigrationTarget, len(targetShards)) - workflowType binlogdatapb.VReplicationWorkflowType - workflowSubType binlogdatapb.VReplicationWorkflowSubType - ) - - getVReplicationWorkflowType := func(row sqltypes.RowNamedValues) binlogdatapb.VReplicationWorkflowType { - i, _ := row["workflow_type"].ToInt32() - return binlogdatapb.VReplicationWorkflowType(i) - } - - getVReplicationWorkflowSubType := func(row sqltypes.RowNamedValues) binlogdatapb.VReplicationWorkflowSubType { - i, _ := row["workflow_sub_type"].ToInt32() - return binlogdatapb.VReplicationWorkflowSubType(i) - } - - // We check all shards in the target keyspace. Not all of them may have a - // stream. For example, if we're splitting -80 to [-40,40-80], only those - // two target shards will have vreplication streams, and the other shards in - // the target keyspace will not. - for _, targetShard := range targetShards { - si, err := ts.GetShard(ctx, targetKeyspace, targetShard) - if err != nil { - return nil, err - } - - if si.PrimaryAlias == nil { - // This can happen if bad inputs are given. - return nil, fmt.Errorf("shard %v/%v doesn't have a primary set", targetKeyspace, targetShard) - } - - primary, err := ts.GetTablet(ctx, si.PrimaryAlias) - if err != nil { - return nil, err - } - - // NB: changing the whitespace of this query breaks tests for now. - // (TODO:@ajm188) extend FakeDBClient to be less whitespace-sensitive on - // expected queries. - query := fmt.Sprintf("select id, source, message, cell, tablet_types, workflow_type, workflow_sub_type, defer_secondary_keys from _vt.vreplication where workflow=%s and db_name=%s", encodeString(workflow), encodeString(primary.DbName())) - p3qr, err := tmc.VReplicationExec(ctx, primary.Tablet, query) - if err != nil { - return nil, err - } - - if len(p3qr.Rows) < 1 { - continue - } - - target := &MigrationTarget{ - si: si, - primary: primary, - Sources: make(map[int32]*binlogdatapb.BinlogSource), - } - - qr := sqltypes.Proto3ToResult(p3qr) - for _, row := range qr.Named().Rows { - id, err := row["id"].ToInt32() - if err != nil { - return nil, err - } - - var bls binlogdatapb.BinlogSource - rowBytes, err := row["source"].ToBytes() - if err != nil { - return nil, err - } - if err := prototext.Unmarshal(rowBytes, &bls); err != nil { - return nil, err - } - - if row["message"].ToString() == Frozen { - frozen = true - } - - target.Sources[id] = &bls - optCells = row["cell"].ToString() - optTabletTypes = row["tablet_types"].ToString() - - workflowType = getVReplicationWorkflowType(row) - workflowSubType = getVReplicationWorkflowSubType(row) - - } - - targets[targetShard] = target +func buildTabletTypesString(tabletTypes []topodatapb.TabletType, tabletSelectionPreference tabletmanagerdatapb.TabletSelectionPreference) string { + tabletTypesStr := topoproto.MakeStringTypeCSV(tabletTypes) + if tabletSelectionPreference == tabletmanagerdatapb.TabletSelectionPreference_INORDER { + tabletTypesStr = discovery.InOrderHint + tabletTypesStr } - - if len(targets) == 0 { - return nil, fmt.Errorf("%w in keyspace %s for %s", ErrNoStreams, targetKeyspace, workflow) - } - - return &TargetInfo{ - Targets: targets, - Frozen: frozen, - OptCells: optCells, - OptTabletTypes: optTabletTypes, - WorkflowType: workflowType, - WorkflowSubType: workflowSubType, - }, nil + return tabletTypesStr } 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..d4847f12ae7 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 } diff --git a/go/vt/vttablet/grpctmclient/client.go b/go/vt/vttablet/grpctmclient/client.go index 0068ed74706..4a278523d05 100644 --- a/go/vt/vttablet/grpctmclient/client.go +++ b/go/vt/vttablet/grpctmclient/client.go @@ -720,6 +720,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 { diff --git a/go/vt/vttablet/grpctmserver/server.go b/go/vt/vttablet/grpctmserver/server.go index d7d70194cec..1a4468970fd 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) diff --git a/go/vt/vttablet/tabletmanager/rpc_agent.go b/go/vt/vttablet/tabletmanager/rpc_agent.go index 06c0e5cda94..c7c6498d6bf 100644 --- a/go/vt/vttablet/tabletmanager/rpc_agent.go +++ b/go/vt/vttablet/tabletmanager/rpc_agent.go @@ -101,6 +101,8 @@ 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 diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication.go b/go/vt/vttablet/tabletmanager/rpc_vreplication.go index 60881b4eab3..d323f6f40eb 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -18,14 +18,17 @@ package tabletmanager import ( "context" + "fmt" "strings" + "golang.org/x/exp/maps" "google.golang.org/protobuf/encoding/prototext" "vitess.io/vitess/go/constants/sidecar" "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/textutil" "vitess.io/vitess/go/vt/discovery" + "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/proto/vttime" "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/topo/topoproto" @@ -41,6 +44,9 @@ 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. + 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. @@ -122,6 +128,171 @@ 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) { + if req == nil || req.DbName == "" { + return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "invalid request, no DB name provided") + } + bindVars := map[string]*querypb.BindVariable{ + "db": sqltypes.StringBindVariable(req.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 + } + 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) { + if req == nil || req.DbName == "" { + return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "invalid request, no DB name provided") + } + bindVars := map[string]*querypb.BindVariable{ + "db": sqltypes.StringBindVariable(req.DbName), + } + additionalPredicates := strings.Builder{} + if req.ExcludeFrozen { + additionalPredicates.WriteString(fmt.Sprintf(" and message != '%s'", workflow.Frozen)) + } + if len(req.ExcludeWorkflows) > 0 { + additionalPredicates.WriteString(" and workflow not in (") + for i, wf := range req.ExcludeWorkflows { + if i > 0 { + additionalPredicates.WriteString(",") + } + additionalPredicates.WriteString(sqltypes.EncodeStringSQL(wf)) + } + additionalPredicates.WriteString(")") + } + if len(req.States) > 0 { + additionalPredicates.WriteString(" and state in (") + for i, state := range req.States { + if i > 0 { + additionalPredicates.WriteString(",") + } + additionalPredicates.WriteString(sqltypes.EncodeStringSQL(state.String())) + } + additionalPredicates.WriteString(")") + } + parsed := sqlparser.BuildParsedQuery(sqlReadVReplicationWorkflows, sidecar.GetIdentifier(), ":db", additionalPredicates.String()) + stmt, err := parsed.GenerateQuery(bindVars, nil) + log.Errorf("ReadVReplicationWorkflows query: %s", stmt) + if err != nil { + return nil, err + } + res, err := tm.VREngine.Exec(stmt) + if err != nil { + return nil, err + } + if res == nil || len(res.Rows) == 0 { + return nil, nil + } + rows := res.Named().Rows + resp := &tabletmanagerdatapb.ReadVReplicationWorkflowsResponse{} + workflows := make(map[string]*tabletmanagerdatapb.ReadVReplicationWorkflowResponse) + + for _, row := range rows { + workflow := row["workflow"].ToString() + workflows[workflow].Cells = rows[0]["cell"].ToString() + tabletTypes, inorder, err := discovery.ParseTabletTypesAndOrder(rows[0]["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 = rows[0]["db_name"].ToString() + workflows[workflow].Tags = rows[0]["tags"].ToString() + wft, err := rows[0]["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 := rows[0]["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 = rows[0]["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") + } + blspb := &binlogdatapb.BinlogSource{} + err = prototext.Unmarshal(srcBytes, blspb) + if err != nil { + return nil, vterrors.Wrap(err, "error unmarshaling binlog_source field from vreplication table record") + } + stream.Bls = blspb + 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") diff --git a/go/vt/vttablet/tmclient/rpc_client_api.go b/go/vt/vttablet/tmclient/rpc_client_api.go index 2e75dbd45fc..f620151e4cc 100644 --- a/go/vt/vttablet/tmclient/rpc_client_api.go +++ b/go/vt/vttablet/tmclient/rpc_client_api.go @@ -177,6 +177,8 @@ 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) // VReplicationExec executes a VReplication command diff --git a/go/vt/vttablet/tmrpctest/test_tm_rpc.go b/go/vt/vttablet/tmrpctest/test_tm_rpc.go index 94e54f1da25..4f53d64a2df 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") diff --git a/go/vt/wrangler/traffic_switcher.go b/go/vt/wrangler/traffic_switcher.go index 6276a904c25..4ad82ee1af8 100644 --- a/go/vt/wrangler/traffic_switcher.go +++ b/go/vt/wrangler/traffic_switcher.go @@ -860,7 +860,7 @@ func (wr *Wrangler) DropSources(ctx context.Context, targetKeyspace, workflowNam } func (wr *Wrangler) buildTrafficSwitcher(ctx context.Context, targetKeyspace, workflowName string) (*trafficSwitcher, error) { - tgtInfo, err := workflow.LegacyBuildTargets(ctx, wr.ts, wr.tmc, targetKeyspace, workflowName) + tgtInfo, err := workflow.BuildTargets(ctx, wr.ts, wr.tmc, targetKeyspace, workflowName) if err != nil { log.Infof("Error building targets: %s", err) return nil, err diff --git a/proto/tabletmanagerdata.proto b/proto/tabletmanagerdata.proto index 4b0c54e978c..0903b27d8b3 100644 --- a/proto/tabletmanagerdata.proto +++ b/proto/tabletmanagerdata.proto @@ -549,6 +549,26 @@ message DeleteVReplicationWorkflowResponse { query.QueryResult result = 1; } +message HasVReplicationWorkflowsRequest { + string db_name = 1; +} + +message HasVReplicationWorkflowsResponse { + bool has = 1; +} + +message ReadVReplicationWorkflowsRequest { + string db_name = 1; + repeated int32 include_ids = 2; + repeated binlogdata.VReplicationWorkflowState states = 3; + bool exclude_frozen = 4; + repeated string exclude_workflows = 5; +} + +message ReadVReplicationWorkflowsResponse { + repeated ReadVReplicationWorkflowResponse workflows = 1; +} + message ReadVReplicationWorkflowRequest { string workflow = 1; } diff --git a/proto/tabletmanagerservice.proto b/proto/tabletmanagerservice.proto index 7492bdd7cca..83c94b5be14 100644 --- a/proto/tabletmanagerservice.proto +++ b/proto/tabletmanagerservice.proto @@ -116,7 +116,9 @@ 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) {}; diff --git a/web/vtadmin/src/proto/vtadmin.d.ts b/web/vtadmin/src/proto/vtadmin.d.ts index 18cf3ffed21..3201e985099 100644 --- a/web/vtadmin/src/proto/vtadmin.d.ts +++ b/web/vtadmin/src/proto/vtadmin.d.ts @@ -26593,6 +26593,418 @@ export namespace tabletmanagerdata { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a HasVReplicationWorkflowsRequest. */ + interface IHasVReplicationWorkflowsRequest { + + /** HasVReplicationWorkflowsRequest db_name */ + db_name?: (string|null); + } + + /** Represents a HasVReplicationWorkflowsRequest. */ + class HasVReplicationWorkflowsRequest implements IHasVReplicationWorkflowsRequest { + + /** + * Constructs a new HasVReplicationWorkflowsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: tabletmanagerdata.IHasVReplicationWorkflowsRequest); + + /** HasVReplicationWorkflowsRequest db_name. */ + public db_name: string; + + /** + * 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 db_name */ + db_name?: (string|null); + + /** ReadVReplicationWorkflowsRequest include_ids */ + include_ids?: (number[]|null); + + /** ReadVReplicationWorkflowsRequest states */ + states?: (binlogdata.VReplicationWorkflowState[]|null); + + /** ReadVReplicationWorkflowsRequest exclude_frozen */ + exclude_frozen?: (boolean|null); + + /** ReadVReplicationWorkflowsRequest exclude_workflows */ + exclude_workflows?: (string[]|null); + } + + /** Represents a ReadVReplicationWorkflowsRequest. */ + class ReadVReplicationWorkflowsRequest implements IReadVReplicationWorkflowsRequest { + + /** + * Constructs a new ReadVReplicationWorkflowsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: tabletmanagerdata.IReadVReplicationWorkflowsRequest); + + /** ReadVReplicationWorkflowsRequest db_name. */ + public db_name: string; + + /** ReadVReplicationWorkflowsRequest include_ids. */ + public include_ids: number[]; + + /** ReadVReplicationWorkflowsRequest states. */ + public states: binlogdata.VReplicationWorkflowState[]; + + /** ReadVReplicationWorkflowsRequest exclude_frozen. */ + public exclude_frozen: boolean; + + /** ReadVReplicationWorkflowsRequest exclude_workflows. */ + public exclude_workflows: string[]; + + /** + * 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 { diff --git a/web/vtadmin/src/proto/vtadmin.js b/web/vtadmin/src/proto/vtadmin.js index 95c3d82c88d..1c0d2d3cc52 100644 --- a/web/vtadmin/src/proto/vtadmin.js +++ b/web/vtadmin/src/proto/vtadmin.js @@ -60847,6 +60847,1042 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { return DeleteVReplicationWorkflowResponse; })(); + tabletmanagerdata.HasVReplicationWorkflowsRequest = (function() { + + /** + * Properties of a HasVReplicationWorkflowsRequest. + * @memberof tabletmanagerdata + * @interface IHasVReplicationWorkflowsRequest + * @property {string|null} [db_name] HasVReplicationWorkflowsRequest db_name + */ + + /** + * Constructs a new HasVReplicationWorkflowsRequest. + * @memberof tabletmanagerdata + * @classdesc Represents a HasVReplicationWorkflowsRequest. + * @implements IHasVReplicationWorkflowsRequest + * @constructor + * @param {tabletmanagerdata.IHasVReplicationWorkflowsRequest=} [properties] Properties to set + */ + function HasVReplicationWorkflowsRequest(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]]; + } + + /** + * HasVReplicationWorkflowsRequest db_name. + * @member {string} db_name + * @memberof tabletmanagerdata.HasVReplicationWorkflowsRequest + * @instance + */ + HasVReplicationWorkflowsRequest.prototype.db_name = ""; + + /** + * Creates a new HasVReplicationWorkflowsRequest instance using the specified properties. + * @function create + * @memberof tabletmanagerdata.HasVReplicationWorkflowsRequest + * @static + * @param {tabletmanagerdata.IHasVReplicationWorkflowsRequest=} [properties] Properties to set + * @returns {tabletmanagerdata.HasVReplicationWorkflowsRequest} HasVReplicationWorkflowsRequest instance + */ + HasVReplicationWorkflowsRequest.create = function create(properties) { + return new HasVReplicationWorkflowsRequest(properties); + }; + + /** + * Encodes the specified HasVReplicationWorkflowsRequest message. Does not implicitly {@link tabletmanagerdata.HasVReplicationWorkflowsRequest.verify|verify} messages. + * @function encode + * @memberof tabletmanagerdata.HasVReplicationWorkflowsRequest + * @static + * @param {tabletmanagerdata.IHasVReplicationWorkflowsRequest} message HasVReplicationWorkflowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HasVReplicationWorkflowsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.db_name != null && Object.hasOwnProperty.call(message, "db_name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.db_name); + return writer; + }; + + /** + * Encodes the specified HasVReplicationWorkflowsRequest message, length delimited. Does not implicitly {@link tabletmanagerdata.HasVReplicationWorkflowsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof tabletmanagerdata.HasVReplicationWorkflowsRequest + * @static + * @param {tabletmanagerdata.IHasVReplicationWorkflowsRequest} message HasVReplicationWorkflowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HasVReplicationWorkflowsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HasVReplicationWorkflowsRequest message from the specified reader or buffer. + * @function decode + * @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.HasVReplicationWorkflowsRequest} HasVReplicationWorkflowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.HasVReplicationWorkflowsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.db_name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HasVReplicationWorkflowsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tabletmanagerdata.HasVReplicationWorkflowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + HasVReplicationWorkflowsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HasVReplicationWorkflowsRequest message. + * @function verify + * @memberof tabletmanagerdata.HasVReplicationWorkflowsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HasVReplicationWorkflowsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.db_name != null && message.hasOwnProperty("db_name")) + if (!$util.isString(message.db_name)) + return "db_name: string expected"; + return null; + }; + + /** + * Creates a HasVReplicationWorkflowsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tabletmanagerdata.HasVReplicationWorkflowsRequest + * @static + * @param {Object.} object Plain object + * @returns {tabletmanagerdata.HasVReplicationWorkflowsRequest} HasVReplicationWorkflowsRequest + */ + HasVReplicationWorkflowsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.HasVReplicationWorkflowsRequest) + return object; + let message = new $root.tabletmanagerdata.HasVReplicationWorkflowsRequest(); + if (object.db_name != null) + message.db_name = String(object.db_name); + return message; + }; + + /** + * Creates a plain object from a HasVReplicationWorkflowsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof tabletmanagerdata.HasVReplicationWorkflowsRequest + * @static + * @param {tabletmanagerdata.HasVReplicationWorkflowsRequest} message HasVReplicationWorkflowsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HasVReplicationWorkflowsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.db_name = ""; + if (message.db_name != null && message.hasOwnProperty("db_name")) + object.db_name = message.db_name; + return object; + }; + + /** + * Converts this HasVReplicationWorkflowsRequest to JSON. + * @function toJSON + * @memberof tabletmanagerdata.HasVReplicationWorkflowsRequest + * @instance + * @returns {Object.} JSON object + */ + HasVReplicationWorkflowsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HasVReplicationWorkflowsRequest + * @function getTypeUrl + * @memberof tabletmanagerdata.HasVReplicationWorkflowsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HasVReplicationWorkflowsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/tabletmanagerdata.HasVReplicationWorkflowsRequest"; + }; + + return HasVReplicationWorkflowsRequest; + })(); + + tabletmanagerdata.HasVReplicationWorkflowsResponse = (function() { + + /** + * Properties of a HasVReplicationWorkflowsResponse. + * @memberof tabletmanagerdata + * @interface IHasVReplicationWorkflowsResponse + * @property {boolean|null} [has] HasVReplicationWorkflowsResponse has + */ + + /** + * Constructs a new HasVReplicationWorkflowsResponse. + * @memberof tabletmanagerdata + * @classdesc Represents a HasVReplicationWorkflowsResponse. + * @implements IHasVReplicationWorkflowsResponse + * @constructor + * @param {tabletmanagerdata.IHasVReplicationWorkflowsResponse=} [properties] Properties to set + */ + function HasVReplicationWorkflowsResponse(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]]; + } + + /** + * HasVReplicationWorkflowsResponse has. + * @member {boolean} has + * @memberof tabletmanagerdata.HasVReplicationWorkflowsResponse + * @instance + */ + HasVReplicationWorkflowsResponse.prototype.has = false; + + /** + * Creates a new HasVReplicationWorkflowsResponse instance using the specified properties. + * @function create + * @memberof tabletmanagerdata.HasVReplicationWorkflowsResponse + * @static + * @param {tabletmanagerdata.IHasVReplicationWorkflowsResponse=} [properties] Properties to set + * @returns {tabletmanagerdata.HasVReplicationWorkflowsResponse} HasVReplicationWorkflowsResponse instance + */ + HasVReplicationWorkflowsResponse.create = function create(properties) { + return new HasVReplicationWorkflowsResponse(properties); + }; + + /** + * Encodes the specified HasVReplicationWorkflowsResponse message. Does not implicitly {@link tabletmanagerdata.HasVReplicationWorkflowsResponse.verify|verify} messages. + * @function encode + * @memberof tabletmanagerdata.HasVReplicationWorkflowsResponse + * @static + * @param {tabletmanagerdata.IHasVReplicationWorkflowsResponse} message HasVReplicationWorkflowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HasVReplicationWorkflowsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.has != null && Object.hasOwnProperty.call(message, "has")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.has); + return writer; + }; + + /** + * Encodes the specified HasVReplicationWorkflowsResponse message, length delimited. Does not implicitly {@link tabletmanagerdata.HasVReplicationWorkflowsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof tabletmanagerdata.HasVReplicationWorkflowsResponse + * @static + * @param {tabletmanagerdata.IHasVReplicationWorkflowsResponse} message HasVReplicationWorkflowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HasVReplicationWorkflowsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HasVReplicationWorkflowsResponse message from the specified reader or buffer. + * @function decode + * @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.HasVReplicationWorkflowsResponse} HasVReplicationWorkflowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.HasVReplicationWorkflowsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.has = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HasVReplicationWorkflowsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tabletmanagerdata.HasVReplicationWorkflowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + HasVReplicationWorkflowsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HasVReplicationWorkflowsResponse message. + * @function verify + * @memberof tabletmanagerdata.HasVReplicationWorkflowsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HasVReplicationWorkflowsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.has != null && message.hasOwnProperty("has")) + if (typeof message.has !== "boolean") + return "has: boolean expected"; + return null; + }; + + /** + * Creates a HasVReplicationWorkflowsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tabletmanagerdata.HasVReplicationWorkflowsResponse + * @static + * @param {Object.} object Plain object + * @returns {tabletmanagerdata.HasVReplicationWorkflowsResponse} HasVReplicationWorkflowsResponse + */ + HasVReplicationWorkflowsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.HasVReplicationWorkflowsResponse) + return object; + let message = new $root.tabletmanagerdata.HasVReplicationWorkflowsResponse(); + if (object.has != null) + message.has = Boolean(object.has); + return message; + }; + + /** + * Creates a plain object from a HasVReplicationWorkflowsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof tabletmanagerdata.HasVReplicationWorkflowsResponse + * @static + * @param {tabletmanagerdata.HasVReplicationWorkflowsResponse} message HasVReplicationWorkflowsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HasVReplicationWorkflowsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.has = false; + if (message.has != null && message.hasOwnProperty("has")) + object.has = message.has; + return object; + }; + + /** + * Converts this HasVReplicationWorkflowsResponse to JSON. + * @function toJSON + * @memberof tabletmanagerdata.HasVReplicationWorkflowsResponse + * @instance + * @returns {Object.} JSON object + */ + HasVReplicationWorkflowsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HasVReplicationWorkflowsResponse + * @function getTypeUrl + * @memberof tabletmanagerdata.HasVReplicationWorkflowsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HasVReplicationWorkflowsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/tabletmanagerdata.HasVReplicationWorkflowsResponse"; + }; + + return HasVReplicationWorkflowsResponse; + })(); + + tabletmanagerdata.ReadVReplicationWorkflowsRequest = (function() { + + /** + * Properties of a ReadVReplicationWorkflowsRequest. + * @memberof tabletmanagerdata + * @interface IReadVReplicationWorkflowsRequest + * @property {string|null} [db_name] ReadVReplicationWorkflowsRequest db_name + * @property {Array.|null} [include_ids] ReadVReplicationWorkflowsRequest include_ids + * @property {Array.|null} [states] ReadVReplicationWorkflowsRequest states + * @property {boolean|null} [exclude_frozen] ReadVReplicationWorkflowsRequest exclude_frozen + * @property {Array.|null} [exclude_workflows] ReadVReplicationWorkflowsRequest exclude_workflows + */ + + /** + * 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.states = []; + this.exclude_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]]; + } + + /** + * ReadVReplicationWorkflowsRequest db_name. + * @member {string} db_name + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @instance + */ + ReadVReplicationWorkflowsRequest.prototype.db_name = ""; + + /** + * ReadVReplicationWorkflowsRequest include_ids. + * @member {Array.} include_ids + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @instance + */ + ReadVReplicationWorkflowsRequest.prototype.include_ids = $util.emptyArray; + + /** + * ReadVReplicationWorkflowsRequest states. + * @member {Array.} states + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @instance + */ + ReadVReplicationWorkflowsRequest.prototype.states = $util.emptyArray; + + /** + * ReadVReplicationWorkflowsRequest exclude_frozen. + * @member {boolean} exclude_frozen + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @instance + */ + ReadVReplicationWorkflowsRequest.prototype.exclude_frozen = false; + + /** + * ReadVReplicationWorkflowsRequest exclude_workflows. + * @member {Array.} exclude_workflows + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @instance + */ + ReadVReplicationWorkflowsRequest.prototype.exclude_workflows = $util.emptyArray; + + /** + * 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); + }; + + /** + * 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.db_name != null && Object.hasOwnProperty.call(message, "db_name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.db_name); + if (message.include_ids != null && message.include_ids.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (let i = 0; i < message.include_ids.length; ++i) + writer.int32(message.include_ids[i]); + writer.ldelim(); + } + if (message.states != null && message.states.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (let i = 0; i < message.states.length; ++i) + writer.int32(message.states[i]); + writer.ldelim(); + } + if (message.exclude_frozen != null && Object.hasOwnProperty.call(message, "exclude_frozen")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.exclude_frozen); + if (message.exclude_workflows != null && message.exclude_workflows.length) + for (let i = 0; i < message.exclude_workflows.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.exclude_workflows[i]); + return writer; + }; + + /** + * 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(); + }; + + /** + * 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: { + message.db_name = reader.string(); + break; + } + case 2: { + 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 3: { + if (!(message.states && message.states.length)) + message.states = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.states.push(reader.int32()); + } else + message.states.push(reader.int32()); + break; + } + case 4: { + message.exclude_frozen = reader.bool(); + break; + } + case 5: { + if (!(message.exclude_workflows && message.exclude_workflows.length)) + message.exclude_workflows = []; + message.exclude_workflows.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * 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()); + }; + + /** + * 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.db_name != null && message.hasOwnProperty("db_name")) + if (!$util.isString(message.db_name)) + return "db_name: string 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.states != null && message.hasOwnProperty("states")) { + if (!Array.isArray(message.states)) + return "states: array expected"; + for (let i = 0; i < message.states.length; ++i) + switch (message.states[i]) { + default: + return "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"; + 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"; + } + return null; + }; + + /** + * 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.db_name != null) + message.db_name = String(object.db_name); + 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.states) { + if (!Array.isArray(object.states)) + throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowsRequest.states: array expected"); + message.states = []; + for (let i = 0; i < object.states.length; ++i) + switch (object.states[i]) { + default: + if (typeof object.states[i] === "number") { + message.states[i] = object.states[i]; + break; + } + case "Unknown": + case 0: + message.states[i] = 0; + break; + case "Init": + case 1: + message.states[i] = 1; + break; + case "Stopped": + case 2: + message.states[i] = 2; + break; + case "Copying": + case 3: + message.states[i] = 3; + break; + case "Running": + case 4: + message.states[i] = 4; + break; + case "Error": + case 5: + message.states[i] = 5; + break; + case "Lagging": + case 6: + message.states[i] = 6; + break; + } + } + if (object.exclude_frozen != null) + message.exclude_frozen = Boolean(object.exclude_frozen); + 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]); + } + 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.states = []; + object.exclude_workflows = []; + } + if (options.defaults) { + object.db_name = ""; + object.exclude_frozen = false; + } + if (message.db_name != null && message.hasOwnProperty("db_name")) + object.db_name = message.db_name; + 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.states && message.states.length) { + object.states = []; + for (let j = 0; j < message.states.length; ++j) + object.states[j] = options.enums === String ? $root.binlogdata.VReplicationWorkflowState[message.states[j]] === undefined ? message.states[j] : $root.binlogdata.VReplicationWorkflowState[message.states[j]] : message.states[j]; + } + if (message.exclude_frozen != null && message.hasOwnProperty("exclude_frozen")) + object.exclude_frozen = message.exclude_frozen; + 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]; + } + 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; + } + } + 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 "workflows." + error; + } + } + return null; + }; + + /** + * 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]); + } + } + 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() { /** From e7c3f00b65afc0659261b224daa203a6212c45d0 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 3 Jan 2024 18:39:32 -0500 Subject: [PATCH 07/35] Bug fixes Signed-off-by: Matt Lord --- .../tabletmanagerdata/tabletmanagerdata.pb.go | 538 +++++++++--------- .../tabletmanagerdata_vtproto.pb.go | 252 ++++++-- go/vt/vtctl/workflow/resharder.go | 105 +++- go/vt/vtctl/workflow/stream_migrator.go | 2 +- go/vt/vtctl/workflow/utils.go | 122 ++++ .../tabletmanager/rpc_vreplication.go | 53 +- .../tabletmanager/rpc_vreplication_test.go | 5 +- go/vt/wrangler/traffic_switcher.go | 2 +- proto/tabletmanagerdata.proto | 6 +- web/vtadmin/src/proto/vtadmin.d.ts | 28 +- web/vtadmin/src/proto/vtadmin.js | 242 ++++++-- 11 files changed, 953 insertions(+), 402 deletions(-) diff --git a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go index 6802b7c8e94..b075d11ccf4 100644 --- a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go +++ b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go @@ -5154,9 +5154,11 @@ type ReadVReplicationWorkflowsRequest struct { DbName string `protobuf:"bytes,1,opt,name=db_name,json=dbName,proto3" json:"db_name,omitempty"` IncludeIds []int32 `protobuf:"varint,2,rep,packed,name=include_ids,json=includeIds,proto3" json:"include_ids,omitempty"` - States []binlogdata.VReplicationWorkflowState `protobuf:"varint,3,rep,packed,name=states,proto3,enum=binlogdata.VReplicationWorkflowState" json:"states,omitempty"` - ExcludeFrozen bool `protobuf:"varint,4,opt,name=exclude_frozen,json=excludeFrozen,proto3" json:"exclude_frozen,omitempty"` + IncludeWorkflows []string `protobuf:"bytes,3,rep,name=include_workflows,json=includeWorkflows,proto3" json:"include_workflows,omitempty"` + IncludeStates []binlogdata.VReplicationWorkflowState `protobuf:"varint,4,rep,packed,name=include_states,json=includeStates,proto3,enum=binlogdata.VReplicationWorkflowState" json:"include_states,omitempty"` ExcludeWorkflows []string `protobuf:"bytes,5,rep,name=exclude_workflows,json=excludeWorkflows,proto3" json:"exclude_workflows,omitempty"` + ExcludeStates []binlogdata.VReplicationWorkflowState `protobuf:"varint,6,rep,packed,name=exclude_states,json=excludeStates,proto3,enum=binlogdata.VReplicationWorkflowState" json:"exclude_states,omitempty"` + ExcludeFrozen bool `protobuf:"varint,7,opt,name=exclude_frozen,json=excludeFrozen,proto3" json:"exclude_frozen,omitempty"` } func (x *ReadVReplicationWorkflowsRequest) Reset() { @@ -5205,18 +5207,18 @@ func (x *ReadVReplicationWorkflowsRequest) GetIncludeIds() []int32 { return nil } -func (x *ReadVReplicationWorkflowsRequest) GetStates() []binlogdata.VReplicationWorkflowState { +func (x *ReadVReplicationWorkflowsRequest) GetIncludeWorkflows() []string { if x != nil { - return x.States + return x.IncludeWorkflows } return nil } -func (x *ReadVReplicationWorkflowsRequest) GetExcludeFrozen() bool { +func (x *ReadVReplicationWorkflowsRequest) GetIncludeStates() []binlogdata.VReplicationWorkflowState { if x != nil { - return x.ExcludeFrozen + return x.IncludeStates } - return false + return nil } func (x *ReadVReplicationWorkflowsRequest) GetExcludeWorkflows() []string { @@ -5226,6 +5228,20 @@ func (x *ReadVReplicationWorkflowsRequest) GetExcludeWorkflows() []string { 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 @@ -6945,237 +6961,246 @@ var file_tabletmanagerdata_proto_rawDesc = []byte{ 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, 0xef, 0x01, 0x0a, 0x20, 0x52, 0x65, 0x61, 0x64, 0x56, 0x52, + 0x52, 0x03, 0x68, 0x61, 0x73, 0x22, 0xf9, 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, 0x17, 0x0a, 0x07, 0x64, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, - 0x65, 0x49, 0x64, 0x73, 0x12, 0x3d, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x65, 0x73, 0x18, 0x03, + 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, 0x03, 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, 0x04, 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, 0x05, 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, 0x06, 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, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x66, - 0x72, 0x6f, 0x7a, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x65, 0x78, 0x63, - 0x6c, 0x75, 0x64, 0x65, 0x46, 0x72, 0x6f, 0x7a, 0x65, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, - 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x18, - 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x57, 0x6f, - 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 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, 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, + 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, 0x07, 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, 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, + 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, 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, + 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, 0xe9, 0x02, 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, - 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, 0xe9, 0x02, 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, 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, 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, + 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, 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, 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 ( @@ -7379,34 +7404,35 @@ var file_tabletmanagerdata_proto_depIdxs = []int32{ 137, // 41: tabletmanagerdata.CreateVReplicationWorkflowRequest.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType 126, // 42: tabletmanagerdata.CreateVReplicationWorkflowResponse.result:type_name -> query.QueryResult 126, // 43: tabletmanagerdata.DeleteVReplicationWorkflowResponse.result:type_name -> query.QueryResult - 138, // 44: tabletmanagerdata.ReadVReplicationWorkflowsRequest.states:type_name -> binlogdata.VReplicationWorkflowState - 106, // 45: tabletmanagerdata.ReadVReplicationWorkflowsResponse.workflows:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse - 124, // 46: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_types:type_name -> topodata.TabletType - 0, // 47: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 136, // 48: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_type:type_name -> binlogdata.VReplicationWorkflowType - 137, // 49: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType - 122, // 50: tabletmanagerdata.ReadVReplicationWorkflowResponse.streams:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - 112, // 51: tabletmanagerdata.VDiffRequest.options:type_name -> tabletmanagerdata.VDiffOptions - 126, // 52: tabletmanagerdata.VDiffResponse.output:type_name -> query.QueryResult - 109, // 53: tabletmanagerdata.VDiffOptions.picker_options:type_name -> tabletmanagerdata.VDiffPickerOptions - 111, // 54: tabletmanagerdata.VDiffOptions.core_options:type_name -> tabletmanagerdata.VDiffCoreOptions - 110, // 55: tabletmanagerdata.VDiffOptions.report_options:type_name -> tabletmanagerdata.VDiffReportOptions - 124, // 56: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_types:type_name -> topodata.TabletType - 0, // 57: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 139, // 58: tabletmanagerdata.UpdateVReplicationWorkflowRequest.on_ddl:type_name -> binlogdata.OnDDLAction - 138, // 59: tabletmanagerdata.UpdateVReplicationWorkflowRequest.state:type_name -> binlogdata.VReplicationWorkflowState - 126, // 60: tabletmanagerdata.UpdateVReplicationWorkflowResponse.result:type_name -> query.QueryResult - 135, // 61: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.bls:type_name -> binlogdata.BinlogSource - 134, // 62: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_updated:type_name -> vttime.Time - 134, // 63: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.transaction_timestamp:type_name -> vttime.Time - 138, // 64: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.state:type_name -> binlogdata.VReplicationWorkflowState - 134, // 65: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_heartbeat:type_name -> vttime.Time - 134, // 66: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_throttled:type_name -> vttime.Time - 67, // [67:67] is the sub-list for method output_type - 67, // [67:67] is the sub-list for method input_type - 67, // [67:67] is the sub-list for extension type_name - 67, // [67:67] is the sub-list for extension extendee - 0, // [0:67] is the sub-list for field type_name + 138, // 44: tabletmanagerdata.ReadVReplicationWorkflowsRequest.include_states:type_name -> binlogdata.VReplicationWorkflowState + 138, // 45: tabletmanagerdata.ReadVReplicationWorkflowsRequest.exclude_states:type_name -> binlogdata.VReplicationWorkflowState + 106, // 46: tabletmanagerdata.ReadVReplicationWorkflowsResponse.workflows:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse + 124, // 47: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_types:type_name -> topodata.TabletType + 0, // 48: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference + 136, // 49: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_type:type_name -> binlogdata.VReplicationWorkflowType + 137, // 50: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType + 122, // 51: tabletmanagerdata.ReadVReplicationWorkflowResponse.streams:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + 112, // 52: tabletmanagerdata.VDiffRequest.options:type_name -> tabletmanagerdata.VDiffOptions + 126, // 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 + 124, // 57: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_types:type_name -> topodata.TabletType + 0, // 58: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference + 139, // 59: tabletmanagerdata.UpdateVReplicationWorkflowRequest.on_ddl:type_name -> binlogdata.OnDDLAction + 138, // 60: tabletmanagerdata.UpdateVReplicationWorkflowRequest.state:type_name -> binlogdata.VReplicationWorkflowState + 126, // 61: tabletmanagerdata.UpdateVReplicationWorkflowResponse.result:type_name -> query.QueryResult + 135, // 62: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.bls:type_name -> binlogdata.BinlogSource + 134, // 63: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_updated:type_name -> vttime.Time + 134, // 64: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.transaction_timestamp:type_name -> vttime.Time + 138, // 65: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.state:type_name -> binlogdata.VReplicationWorkflowState + 134, // 66: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_heartbeat:type_name -> vttime.Time + 134, // 67: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_throttled:type_name -> vttime.Time + 68, // [68:68] is the sub-list for method output_type + 68, // [68:68] is the sub-list for method input_type + 68, // [68:68] is the sub-list for extension type_name + 68, // [68:68] is the sub-list for extension extendee + 0, // [0:68] is the sub-list for field type_name } func init() { file_tabletmanagerdata_proto_init() } diff --git a/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go b/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go index 1191501612f..ccf61edf1f9 100644 --- a/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go +++ b/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go @@ -1971,16 +1971,26 @@ func (m *ReadVReplicationWorkflowsRequest) CloneVT() *ReadVReplicationWorkflowsR copy(tmpContainer, rhs) r.IncludeIds = tmpContainer } - if rhs := m.States; rhs != nil { + 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.States = tmpContainer + 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) @@ -6890,15 +6900,6 @@ func (m *ReadVReplicationWorkflowsRequest) MarshalToSizedBufferVT(dAtA []byte) ( i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - 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] = 0x2a - } - } if m.ExcludeFrozen { i-- if m.ExcludeFrozen { @@ -6907,16 +6908,16 @@ func (m *ReadVReplicationWorkflowsRequest) MarshalToSizedBufferVT(dAtA []byte) ( dAtA[i] = 0 } i-- - dAtA[i] = 0x20 + dAtA[i] = 0x38 } - if len(m.States) > 0 { + if len(m.ExcludeStates) > 0 { var pksize2 int - for _, num := range m.States { + for _, num := range m.ExcludeStates { pksize2 += sov(uint64(num)) } i -= pksize2 j1 := i - for _, num1 := range m.States { + for _, num1 := range m.ExcludeStates { num := uint64(num1) for num >= 1<<7 { dAtA[j1] = uint8(uint64(num)&0x7f | 0x80) @@ -6928,16 +6929,25 @@ func (m *ReadVReplicationWorkflowsRequest) MarshalToSizedBufferVT(dAtA []byte) ( } i = encodeVarint(dAtA, i, uint64(pksize2)) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x32 } - if len(m.IncludeIds) > 0 { + 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] = 0x2a + } + } + if len(m.IncludeStates) > 0 { var pksize4 int - for _, num := range m.IncludeIds { + for _, num := range m.IncludeStates { pksize4 += sov(uint64(num)) } i -= pksize4 j3 := i - for _, num1 := range m.IncludeIds { + for _, num1 := range m.IncludeStates { num := uint64(num1) for num >= 1<<7 { dAtA[j3] = uint8(uint64(num)&0x7f | 0x80) @@ -6949,6 +6959,36 @@ func (m *ReadVReplicationWorkflowsRequest) MarshalToSizedBufferVT(dAtA []byte) ( } i = encodeVarint(dAtA, i, uint64(pksize4)) i-- + dAtA[i] = 0x22 + } + 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] = 0x1a + } + } + 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 } if len(m.DbName) > 0 { @@ -9607,22 +9647,35 @@ func (m *ReadVReplicationWorkflowsRequest) SizeVT() (n int) { } n += 1 + sov(uint64(l)) + l } - if len(m.States) > 0 { + 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.States { + for _, e := range m.IncludeStates { l += sov(uint64(e)) } n += 1 + sov(uint64(l)) + l } - if m.ExcludeFrozen { - n += 2 - } 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 } @@ -19559,6 +19612,38 @@ func (m *ReadVReplicationWorkflowsRequest) UnmarshalVT(dAtA []byte) error { return fmt.Errorf("proto: wrong wireType = %d for field IncludeIds", wireType) } case 3: + 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 4: if wireType == 0 { var v binlogdata.VReplicationWorkflowState for shift := uint(0); ; shift += 7 { @@ -19575,7 +19660,7 @@ func (m *ReadVReplicationWorkflowsRequest) UnmarshalVT(dAtA []byte) error { break } } - m.States = append(m.States, v) + m.IncludeStates = append(m.IncludeStates, v) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { @@ -19603,8 +19688,8 @@ func (m *ReadVReplicationWorkflowsRequest) UnmarshalVT(dAtA []byte) error { return io.ErrUnexpectedEOF } var elementCount int - if elementCount != 0 && len(m.States) == 0 { - m.States = make([]binlogdata.VReplicationWorkflowState, 0, elementCount) + if elementCount != 0 && len(m.IncludeStates) == 0 { + m.IncludeStates = make([]binlogdata.VReplicationWorkflowState, 0, elementCount) } for iNdEx < postIndex { var v binlogdata.VReplicationWorkflowState @@ -19622,31 +19707,11 @@ func (m *ReadVReplicationWorkflowsRequest) UnmarshalVT(dAtA []byte) error { break } } - m.States = append(m.States, v) + m.IncludeStates = append(m.IncludeStates, v) } } else { - return fmt.Errorf("proto: wrong wireType = %d for field States", wireType) - } - case 4: - 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 - } + return fmt.Errorf("proto: wrong wireType = %d for field IncludeStates", wireType) } - m.ExcludeFrozen = bool(v != 0) case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ExcludeWorkflows", wireType) @@ -19679,6 +19744,95 @@ func (m *ReadVReplicationWorkflowsRequest) UnmarshalVT(dAtA []byte) error { } m.ExcludeWorkflows = append(m.ExcludeWorkflows, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 6: + 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 7: + 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:]) diff --git a/go/vt/vtctl/workflow/resharder.go b/go/vt/vtctl/workflow/resharder.go index f9f25d7dd5a..9a4c9fc6a78 100644 --- a/go/vt/vtctl/workflow/resharder.go +++ b/go/vt/vtctl/workflow/resharder.go @@ -142,6 +142,79 @@ func (rs *resharder) validateTargets(ctx context.Context) error { return err } +/* +func (rs *resharder) readRefStreams(ctx context.Context) error { + var mu sync.Mutex + 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) + if err != nil { + return vterrors.Wrapf(err, "VReplicationExec(%v, %s)", sourcePrimary.Tablet, query) + } + qr := sqltypes.Proto3ToResult(p3qr) + + mu.Lock() + defer mu.Unlock() + + mustCreate := false + var ref map[string]bool + if rs.refStreams == nil { + rs.refStreams = make(map[string]*refStream) + mustCreate = true + } else { + // Copy the ref streams for comparison. + ref = make(map[string]bool, len(rs.refStreams)) + for k := range rs.refStreams { + ref[k] = true + } + } + for _, row := range qr.Rows { + + workflow := row[0].ToString() + if 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(), + } + } else { + if !ref[refKey] { + return fmt.Errorf("streams are mismatched across source shards for workflow: %s", workflow) + } + delete(ref, refKey) + } + } + if len(ref) != 0 { + return fmt.Errorf("streams are mismatched across source shards: %v", ref) + } + return nil + }) + return err +} +*/ + func (rs *resharder) readRefStreams(ctx context.Context) error { var mu sync.Mutex err := rs.forAll(rs.sourceShards, func(source *topo.ShardInfo) error { @@ -156,26 +229,26 @@ func (rs *resharder) readRefStreams(ctx context.Context) error { return vterrors.Wrapf(err, "ReadVReplicationWorkflows(%v, %+v)", sourcePrimary.Tablet, req) } - for _, workflow := range res.Workflows { - mu.Lock() - defer mu.Unlock() - - mustCreate := false - var ref map[string]bool - if rs.refStreams == nil { - rs.refStreams = make(map[string]*refStream) - mustCreate = true - } else { - // Copy the ref streams for comparison. - ref = make(map[string]bool, len(rs.refStreams)) - for k := range rs.refStreams { - ref[k] = true - } + mu.Lock() + defer mu.Unlock() + + mustCreate := false + var ref map[string]bool + if rs.refStreams == nil { + rs.refStreams = make(map[string]*refStream) + mustCreate = true + } else { + // Copy the ref streams for comparison. + ref = make(map[string]bool, len(rs.refStreams)) + for k := range rs.refStreams { + ref[k] = true } + } + 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()) } - for _, stream := range res.Workflows[0].Streams { + for _, stream := range workflow.Streams { bls := stream.Bls isReference, err := rs.blsIsReference(bls) if err != nil { diff --git a/go/vt/vtctl/workflow/stream_migrator.go b/go/vt/vtctl/workflow/stream_migrator.go index c23630cace3..a415813da0a 100644 --- a/go/vt/vtctl/workflow/stream_migrator.go +++ b/go/vt/vtctl/workflow/stream_migrator.go @@ -218,7 +218,7 @@ func (sm *StreamMigrator) readTabletStreams(ctx context.Context, ti *topo.Tablet DbName: ti.DbName(), ExcludeWorkflows: []string{sm.ts.ReverseWorkflowName()}, IncludeIds: ids, - States: states, + IncludeStates: states, ExcludeFrozen: excludeFrozen, } diff --git a/go/vt/vtctl/workflow/utils.go b/go/vt/vtctl/workflow/utils.go index c7204b213d9..63ebf52476d 100644 --- a/go/vt/vtctl/workflow/utils.go +++ b/go/vt/vtctl/workflow/utils.go @@ -26,6 +26,8 @@ import ( "strings" "sync" + "google.golang.org/protobuf/encoding/prototext" + "vitess.io/vitess/go/sets" "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/vt/concurrency" @@ -650,6 +652,126 @@ func areTabletsAvailableToStreamFrom(ctx context.Context, req *vtctldatapb.Workf return nil } +// LegacyBuildTargets collects MigrationTargets and other metadata (see TargetInfo) +// from a workflow in the target keyspace. It uses VReplicationExec to get the workflow +// details rather than the new TabletManager ReadVReplicationWorkflow RPC. This is +// being used to slowly transition all of the older code, including unit tests, over to +// the new RPC and limit the impact of the new implementation to vtctldclient. You can see +// how the unit tests were being migrated here: https://gist.github.com/mattlord/738c12befe951f8d09304ff7fdc47c46 +// +// New callers should instead use the new BuildTargets function. +// +// It returns ErrNoStreams if there are no targets found for the workflow. +func LegacyBuildTargets(ctx context.Context, ts *topo.Server, tmc tmclient.TabletManagerClient, targetKeyspace string, workflow string) (*TargetInfo, error) { + targetShards, err := ts.GetShardNames(ctx, targetKeyspace) + if err != nil { + return nil, err + } + + var ( + frozen bool + optCells string + optTabletTypes string + targets = make(map[string]*MigrationTarget, len(targetShards)) + workflowType binlogdatapb.VReplicationWorkflowType + workflowSubType binlogdatapb.VReplicationWorkflowSubType + ) + + getVReplicationWorkflowType := func(row sqltypes.RowNamedValues) binlogdatapb.VReplicationWorkflowType { + i, _ := row["workflow_type"].ToInt32() + return binlogdatapb.VReplicationWorkflowType(i) + } + + getVReplicationWorkflowSubType := func(row sqltypes.RowNamedValues) binlogdatapb.VReplicationWorkflowSubType { + i, _ := row["workflow_sub_type"].ToInt32() + return binlogdatapb.VReplicationWorkflowSubType(i) + } + + // We check all shards in the target keyspace. Not all of them may have a + // stream. For example, if we're splitting -80 to [-40,40-80], only those + // two target shards will have vreplication streams, and the other shards in + // the target keyspace will not. + for _, targetShard := range targetShards { + si, err := ts.GetShard(ctx, targetKeyspace, targetShard) + if err != nil { + return nil, err + } + + if si.PrimaryAlias == nil { + // This can happen if bad inputs are given. + return nil, fmt.Errorf("shard %v/%v doesn't have a primary set", targetKeyspace, targetShard) + } + + primary, err := ts.GetTablet(ctx, si.PrimaryAlias) + if err != nil { + return nil, err + } + + // NB: changing the whitespace of this query breaks tests for now. + // (TODO:@ajm188) extend FakeDBClient to be less whitespace-sensitive on + // expected queries. + query := fmt.Sprintf("select id, source, message, cell, tablet_types, workflow_type, workflow_sub_type, defer_secondary_keys from _vt.vreplication where workflow=%s and db_name=%s", encodeString(workflow), encodeString(primary.DbName())) + p3qr, err := tmc.VReplicationExec(ctx, primary.Tablet, query) + if err != nil { + return nil, err + } + + if len(p3qr.Rows) < 1 { + continue + } + + target := &MigrationTarget{ + si: si, + primary: primary, + Sources: make(map[int32]*binlogdatapb.BinlogSource), + } + + qr := sqltypes.Proto3ToResult(p3qr) + for _, row := range qr.Named().Rows { + id, err := row["id"].ToInt32() + if err != nil { + return nil, err + } + + var bls binlogdatapb.BinlogSource + rowBytes, err := row["source"].ToBytes() + if err != nil { + return nil, err + } + if err := prototext.Unmarshal(rowBytes, &bls); err != nil { + return nil, err + } + + if row["message"].ToString() == Frozen { + frozen = true + } + + target.Sources[id] = &bls + optCells = row["cell"].ToString() + optTabletTypes = row["tablet_types"].ToString() + + workflowType = getVReplicationWorkflowType(row) + workflowSubType = getVReplicationWorkflowSubType(row) + + } + + targets[targetShard] = target + } + + if len(targets) == 0 { + return nil, fmt.Errorf("%w in keyspace %s for %s", ErrNoStreams, targetKeyspace, workflow) + } + + return &TargetInfo{ + Targets: targets, + Frozen: frozen, + OptCells: optCells, + OptTabletTypes: optTabletTypes, + WorkflowType: workflowType, + WorkflowSubType: workflowSubType, + }, nil +} + func buildTabletTypesString(tabletTypes []topodatapb.TabletType, tabletSelectionPreference tabletmanagerdatapb.TabletSelectionPreference) string { tabletTypesStr := topoproto.MakeStringTypeCSV(tabletTypes) if tabletSelectionPreference == tabletmanagerdatapb.TabletSelectionPreference_INORDER { diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication.go b/go/vt/vttablet/tabletmanager/rpc_vreplication.go index d323f6f40eb..62cfdeb1420 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -171,6 +171,26 @@ func (tm *TabletManager) ReadVReplicationWorkflows(ctx context.Context, req *tab if req.ExcludeFrozen { additionalPredicates.WriteString(fmt.Sprintf(" and message != '%s'", workflow.Frozen)) } + if len(req.IncludeIds) > 0 { + additionalPredicates.WriteString(" and id in (") + for i, id := range req.IncludeIds { + if i > 0 { + additionalPredicates.WriteString(",") + } + additionalPredicates.WriteString(fmt.Sprintf("%d", id)) + } + additionalPredicates.WriteString(")") + } + if len(req.IncludeWorkflows) > 0 { + additionalPredicates.WriteString(" and workflow in (") + for i, wf := range req.IncludeWorkflows { + if i > 0 { + additionalPredicates.WriteString(",") + } + additionalPredicates.WriteString(sqltypes.EncodeStringSQL(wf)) + } + additionalPredicates.WriteString(")") + } if len(req.ExcludeWorkflows) > 0 { additionalPredicates.WriteString(" and workflow not in (") for i, wf := range req.ExcludeWorkflows { @@ -181,9 +201,19 @@ func (tm *TabletManager) ReadVReplicationWorkflows(ctx context.Context, req *tab } additionalPredicates.WriteString(")") } - if len(req.States) > 0 { + if len(req.IncludeStates) > 0 { additionalPredicates.WriteString(" and state in (") - for i, state := range req.States { + for i, state := range req.IncludeStates { + if i > 0 { + additionalPredicates.WriteString(",") + } + additionalPredicates.WriteString(sqltypes.EncodeStringSQL(state.String())) + } + additionalPredicates.WriteString(")") + } + if len(req.ExcludeStates) > 0 { + additionalPredicates.WriteString(" and state not in (") + for i, state := range req.ExcludeStates { if i > 0 { additionalPredicates.WriteString(",") } @@ -193,10 +223,10 @@ func (tm *TabletManager) ReadVReplicationWorkflows(ctx context.Context, req *tab } parsed := sqlparser.BuildParsedQuery(sqlReadVReplicationWorkflows, sidecar.GetIdentifier(), ":db", additionalPredicates.String()) stmt, err := parsed.GenerateQuery(bindVars, nil) - log.Errorf("ReadVReplicationWorkflows query: %s", stmt) if err != nil { return nil, err } + log.Errorf("ReadVReplicationWorkflows query: %s", stmt) res, err := tm.VREngine.Exec(stmt) if err != nil { return nil, err @@ -210,8 +240,11 @@ func (tm *TabletManager) ReadVReplicationWorkflows(ctx context.Context, req *tab for _, row := range rows { workflow := row["workflow"].ToString() - workflows[workflow].Cells = rows[0]["cell"].ToString() - tabletTypes, inorder, err := discovery.ParseTabletTypesAndOrder(rows[0]["tablet_types"].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") } @@ -220,19 +253,19 @@ func (tm *TabletManager) ReadVReplicationWorkflows(ctx context.Context, req *tab if inorder { workflows[workflow].TabletSelectionPreference = tabletmanagerdatapb.TabletSelectionPreference_INORDER } - workflows[workflow].DbName = rows[0]["db_name"].ToString() - workflows[workflow].Tags = rows[0]["tags"].ToString() - wft, err := rows[0]["workflow_type"].ToInt32() + 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 := rows[0]["workflow_sub_type"].ToInt32() + 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 = rows[0]["defer_secondary_keys"].ToString() == "1" + 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 { diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go index 534f623fc30..c5ece83bf4e 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go @@ -484,8 +484,8 @@ func TestUpdateVReplicationWorkflow(t *testing.T) { ), fmt.Sprintf("%d|%s|%s|%s|Running|", vreplID, blsStr, cells[0], tabletTypes[0]), ) - idQuery, err := sqlparser.ParseAndBind("select id from _vt.vreplication where workflow = %a", - sqltypes.StringBindVariable(workflow)) + 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( @@ -493,7 +493,6 @@ func TestUpdateVReplicationWorkflow(t *testing.T) { "int64", ), fmt.Sprintf("%d", vreplID), - fmt.Sprintf("%d", vreplID+1), ) tests := []struct { diff --git a/go/vt/wrangler/traffic_switcher.go b/go/vt/wrangler/traffic_switcher.go index 4ad82ee1af8..6276a904c25 100644 --- a/go/vt/wrangler/traffic_switcher.go +++ b/go/vt/wrangler/traffic_switcher.go @@ -860,7 +860,7 @@ func (wr *Wrangler) DropSources(ctx context.Context, targetKeyspace, workflowNam } func (wr *Wrangler) buildTrafficSwitcher(ctx context.Context, targetKeyspace, workflowName string) (*trafficSwitcher, error) { - tgtInfo, err := workflow.BuildTargets(ctx, wr.ts, wr.tmc, targetKeyspace, workflowName) + tgtInfo, err := workflow.LegacyBuildTargets(ctx, wr.ts, wr.tmc, targetKeyspace, workflowName) if err != nil { log.Infof("Error building targets: %s", err) return nil, err diff --git a/proto/tabletmanagerdata.proto b/proto/tabletmanagerdata.proto index 0903b27d8b3..6e205972077 100644 --- a/proto/tabletmanagerdata.proto +++ b/proto/tabletmanagerdata.proto @@ -560,9 +560,11 @@ message HasVReplicationWorkflowsResponse { message ReadVReplicationWorkflowsRequest { string db_name = 1; repeated int32 include_ids = 2; - repeated binlogdata.VReplicationWorkflowState states = 3; - bool exclude_frozen = 4; + repeated string include_workflows = 3; + repeated binlogdata.VReplicationWorkflowState include_states = 4; repeated string exclude_workflows = 5; + repeated binlogdata.VReplicationWorkflowState exclude_states = 6; + bool exclude_frozen = 7; } message ReadVReplicationWorkflowsResponse { diff --git a/web/vtadmin/src/proto/vtadmin.d.ts b/web/vtadmin/src/proto/vtadmin.d.ts index 3201e985099..c6a93b6d3db 100644 --- a/web/vtadmin/src/proto/vtadmin.d.ts +++ b/web/vtadmin/src/proto/vtadmin.d.ts @@ -26796,14 +26796,20 @@ export namespace tabletmanagerdata { /** ReadVReplicationWorkflowsRequest include_ids */ include_ids?: (number[]|null); - /** ReadVReplicationWorkflowsRequest states */ - states?: (binlogdata.VReplicationWorkflowState[]|null); + /** ReadVReplicationWorkflowsRequest include_workflows */ + include_workflows?: (string[]|null); - /** ReadVReplicationWorkflowsRequest exclude_frozen */ - exclude_frozen?: (boolean|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. */ @@ -26821,15 +26827,21 @@ export namespace tabletmanagerdata { /** ReadVReplicationWorkflowsRequest include_ids. */ public include_ids: number[]; - /** ReadVReplicationWorkflowsRequest states. */ - public states: binlogdata.VReplicationWorkflowState[]; + /** ReadVReplicationWorkflowsRequest include_workflows. */ + public include_workflows: string[]; - /** ReadVReplicationWorkflowsRequest exclude_frozen. */ - public exclude_frozen: boolean; + /** 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 diff --git a/web/vtadmin/src/proto/vtadmin.js b/web/vtadmin/src/proto/vtadmin.js index 1c0d2d3cc52..846aa833fb8 100644 --- a/web/vtadmin/src/proto/vtadmin.js +++ b/web/vtadmin/src/proto/vtadmin.js @@ -61261,9 +61261,11 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { * @interface IReadVReplicationWorkflowsRequest * @property {string|null} [db_name] ReadVReplicationWorkflowsRequest db_name * @property {Array.|null} [include_ids] ReadVReplicationWorkflowsRequest include_ids - * @property {Array.|null} [states] ReadVReplicationWorkflowsRequest states - * @property {boolean|null} [exclude_frozen] ReadVReplicationWorkflowsRequest exclude_frozen + * @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 */ /** @@ -61276,8 +61278,10 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { */ function ReadVReplicationWorkflowsRequest(properties) { this.include_ids = []; - this.states = []; + 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) @@ -61301,20 +61305,20 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { ReadVReplicationWorkflowsRequest.prototype.include_ids = $util.emptyArray; /** - * ReadVReplicationWorkflowsRequest states. - * @member {Array.} states + * ReadVReplicationWorkflowsRequest include_workflows. + * @member {Array.} include_workflows * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest * @instance */ - ReadVReplicationWorkflowsRequest.prototype.states = $util.emptyArray; + ReadVReplicationWorkflowsRequest.prototype.include_workflows = $util.emptyArray; /** - * ReadVReplicationWorkflowsRequest exclude_frozen. - * @member {boolean} exclude_frozen + * ReadVReplicationWorkflowsRequest include_states. + * @member {Array.} include_states * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest * @instance */ - ReadVReplicationWorkflowsRequest.prototype.exclude_frozen = false; + ReadVReplicationWorkflowsRequest.prototype.include_states = $util.emptyArray; /** * ReadVReplicationWorkflowsRequest exclude_workflows. @@ -61324,6 +61328,22 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { */ ReadVReplicationWorkflowsRequest.prototype.exclude_workflows = $util.emptyArray; + /** + * ReadVReplicationWorkflowsRequest exclude_states. + * @member {Array.} exclude_states + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @instance + */ + ReadVReplicationWorkflowsRequest.prototype.exclude_states = $util.emptyArray; + + /** + * ReadVReplicationWorkflowsRequest exclude_frozen. + * @member {boolean} exclude_frozen + * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest + * @instance + */ + ReadVReplicationWorkflowsRequest.prototype.exclude_frozen = false; + /** * Creates a new ReadVReplicationWorkflowsRequest instance using the specified properties. * @function create @@ -61356,17 +61376,26 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { writer.int32(message.include_ids[i]); writer.ldelim(); } - if (message.states != null && message.states.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (let i = 0; i < message.states.length; ++i) - writer.int32(message.states[i]); + if (message.include_workflows != null && message.include_workflows.length) + for (let i = 0; i < message.include_workflows.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.include_workflows[i]); + if (message.include_states != null && message.include_states.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (let i = 0; i < message.include_states.length; ++i) + writer.int32(message.include_states[i]); writer.ldelim(); } - if (message.exclude_frozen != null && Object.hasOwnProperty.call(message, "exclude_frozen")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.exclude_frozen); if (message.exclude_workflows != null && message.exclude_workflows.length) for (let i = 0; i < message.exclude_workflows.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.exclude_workflows[i]); + if (message.exclude_states != null && message.exclude_states.length) { + writer.uint32(/* id 6, wireType 2 =*/50).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 7, wireType 0 =*/56).bool(message.exclude_frozen); return writer; }; @@ -61417,18 +61446,20 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { break; } case 3: { - if (!(message.states && message.states.length)) - message.states = []; + if (!(message.include_workflows && message.include_workflows.length)) + message.include_workflows = []; + message.include_workflows.push(reader.string()); + break; + } + case 4: { + 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.states.push(reader.int32()); + message.include_states.push(reader.int32()); } else - message.states.push(reader.int32()); - break; - } - case 4: { - message.exclude_frozen = reader.bool(); + message.include_states.push(reader.int32()); break; } case 5: { @@ -61437,6 +61468,21 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { message.exclude_workflows.push(reader.string()); break; } + case 6: { + 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 7: { + message.exclude_frozen = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -61482,13 +61528,20 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { if (!$util.isInteger(message.include_ids[i])) return "include_ids: integer[] expected"; } - if (message.states != null && message.hasOwnProperty("states")) { - if (!Array.isArray(message.states)) - return "states: array expected"; - for (let i = 0; i < message.states.length; ++i) - switch (message.states[i]) { + 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 "states: enum value[] expected"; + return "include_states: enum value[] expected"; case 0: case 1: case 2: @@ -61499,9 +61552,6 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { break; } } - if (message.exclude_frozen != null && message.hasOwnProperty("exclude_frozen")) - if (typeof message.exclude_frozen !== "boolean") - return "exclude_frozen: boolean expected"; if (message.exclude_workflows != null && message.hasOwnProperty("exclude_workflows")) { if (!Array.isArray(message.exclude_workflows)) return "exclude_workflows: array expected"; @@ -61509,6 +61559,26 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { 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; }; @@ -61533,49 +61603,54 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { for (let i = 0; i < object.include_ids.length; ++i) message.include_ids[i] = object.include_ids[i] | 0; } - if (object.states) { - if (!Array.isArray(object.states)) - throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowsRequest.states: array expected"); - message.states = []; - for (let i = 0; i < object.states.length; ++i) - switch (object.states[i]) { + 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.states[i] === "number") { - message.states[i] = object.states[i]; + if (typeof object.include_states[i] === "number") { + message.include_states[i] = object.include_states[i]; break; } case "Unknown": case 0: - message.states[i] = 0; + message.include_states[i] = 0; break; case "Init": case 1: - message.states[i] = 1; + message.include_states[i] = 1; break; case "Stopped": case 2: - message.states[i] = 2; + message.include_states[i] = 2; break; case "Copying": case 3: - message.states[i] = 3; + message.include_states[i] = 3; break; case "Running": case 4: - message.states[i] = 4; + message.include_states[i] = 4; break; case "Error": case 5: - message.states[i] = 5; + message.include_states[i] = 5; break; case "Lagging": case 6: - message.states[i] = 6; + message.include_states[i] = 6; break; } } - if (object.exclude_frozen != null) - message.exclude_frozen = Boolean(object.exclude_frozen); if (object.exclude_workflows) { if (!Array.isArray(object.exclude_workflows)) throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowsRequest.exclude_workflows: array expected"); @@ -61583,6 +61658,49 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { 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; + } + case "Unknown": + case 0: + message.exclude_states[i] = 0; + break; + 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 (object.exclude_frozen != null) + message.exclude_frozen = Boolean(object.exclude_frozen); return message; }; @@ -61601,8 +61719,10 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { let object = {}; if (options.arrays || options.defaults) { object.include_ids = []; - object.states = []; + object.include_workflows = []; + object.include_states = []; object.exclude_workflows = []; + object.exclude_states = []; } if (options.defaults) { object.db_name = ""; @@ -61615,18 +61735,28 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { for (let j = 0; j < message.include_ids.length; ++j) object.include_ids[j] = message.include_ids[j]; } - if (message.states && message.states.length) { - object.states = []; - for (let j = 0; j < message.states.length; ++j) - object.states[j] = options.enums === String ? $root.binlogdata.VReplicationWorkflowState[message.states[j]] === undefined ? message.states[j] : $root.binlogdata.VReplicationWorkflowState[message.states[j]] : message.states[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_frozen != null && message.hasOwnProperty("exclude_frozen")) - object.exclude_frozen = message.exclude_frozen; 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; }; From 5d2f42737b7f9ab7b7d017cff2a069686ae3182f Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Fri, 5 Jan 2024 11:17:28 -0500 Subject: [PATCH 08/35] Begin moving GetWorkflows away from VReplicationExec Signed-off-by: Matt Lord --- go/vt/vtctl/workflow/server.go | 428 ++++++++++++++------------------- 1 file changed, 175 insertions(+), 253 deletions(-) diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index 6409fda4f4c..4f5d750dd24 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -352,6 +352,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)) @@ -371,72 +374,65 @@ 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) - 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 - FROM - _vt.vreplication - %s`, - where, - ) + readReq.ExcludeStates = []binlogdatapb.VReplicationWorkflowState{binlogdatapb.VReplicationWorkflowState_Stopped} + } - /* - readReq := &tabletmanagerdatapb.ReadVReplicationWorkflowRequest{ - Workflow: req.Workflow, - } - callback := func(ctx context.Context, tablet *topo.TabletInfo) (*querypb.QueryResult, error) { - res, err := s.tmc.ReadVReplicationWorkflow(ctx, tablet.Tablet, readReq) - if err != nil { - return nil, err - } - return res, err - } - */ + // Guards access to the maps used throughout. + m := sync.Mutex{} - vx := vexec.NewVExec(req.Keyspace, "", s.ts, s.tmc, s.SQLParser()) - results, err := vx.QueryContext(ctx, query) + shards, err := s.ts.GetShardNames(ctx, req.Keyspace) 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)) + rctx, rcancel := context.WithTimeout(ctx, topo.RemoteOperationTimeout) + defer rcancel() + erg, erctx := errgroup.WithContext(rctx) + for _, shard := range shards { + shard := shard // https://golang.org/doc/faq#closures_and_goroutines + erg.Go(func() error { + si, err := s.ts.GetShard(erctx, 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(ctx, 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() + req.DbName = primary.DbName() + wres, err := s.tmc.ReadVReplicationWorkflows(ctx, primary.Tablet, req) + if err != nil { + return err + } + m.Lock() + defer m.Unlock() + results[primary] = wres + return nil + }) + } + if erg.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() @@ -466,16 +462,13 @@ 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 { @@ -506,7 +499,7 @@ 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 { + scanWorkflow := func(ctx context.Context, workflow *vtctldatapb.Workflow, res *tabletmanagerdatapb.ReadVReplicationWorkflowResponse, tablet *topo.TabletInfo) error { span, ctx := trace.NewSpan(ctx, "workflow.Server.scanWorkflow") defer span.Finish() @@ -516,207 +509,136 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows 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 - } - 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, ",") - } - - workflowType, _ := row["workflow_type"].ToInt32() - workflowSubType, _ := row["workflow_sub_type"].ToInt32() - - timeHeartbeat, err := row["time_heartbeat"].ToCastInt64() - if err != nil { - return err - } - - componentThrottled := row["component_throttled"].ToString() - timeThrottled, err := row["time_throttled"].ToCastInt64() - if err != nil { - return err - } - - deferSecondaryKeys, err := row["defer_secondary_keys"].ToBool() - if err != nil { - return err - } - - rowsCopied, err := row["rows_copied"].ToCastInt64() - if err != nil { - return err - } - - stream := &vtctldatapb.Workflow_Stream{ - Id: id, - Shard: tablet.Shard, - Tablet: tablet.Alias, - BinlogSource: &bls, - Position: pos, - StopPosition: stopPos, - State: state, - DbName: dbName, - 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, + 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() + } + + 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(), + 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, }, - }, - } + } - // 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 - } + // 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 + } - // 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() + // 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() - workflow.WorkflowType = binlogdatapb.VReplicationWorkflowType_name[workflowType] - workflow.WorkflowSubType = binlogdatapb.VReplicationWorkflowSubType_name[workflowSubType] - workflow.DeferSecondaryKeys = deferSecondaryKeys + 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() + } - 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() - } + 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() - 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() + si, err := s.ts.GetShard(ctx, req.Keyspace, tablet.Shard) + if err != nil { + return err + } - si, err := s.ts.GetShard(ctx, req.Keyspace, tablet.Shard) - if err != nil { - return err - } + shardStream = &vtctldatapb.Workflow_ShardStream{ + Streams: nil, + TabletControls: si.TabletControls, + IsPrimaryServing: si.IsPrimaryServing, + } - shardStream = &vtctldatapb.Workflow_ShardStream{ - Streams: nil, - TabletControls: si.TabletControls, - IsPrimaryServing: si.IsPrimaryServing, + workflow.ShardStreams[shardStreamKey] = shardStream } - workflow.ShardStreams[shardStreamKey] = shardStream - } - - shardStream.Streams = append(shardStream.Streams, stream) - sourceShardsByWorkflow[workflow.Name].Insert(stream.BinlogSource.Shard) - targetShardsByWorkflow[workflow.Name].Insert(tablet.Shard) + 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) - } + 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 + sourceKeyspaceByWorkflow[workflow.Name] = stream.BinlogSource.Keyspace - 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) - } + 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 + targetKeyspaceByWorkflow[workflow.Name] = tablet.Keyspace - timeUpdated := time.Unix(timeUpdatedSeconds, 0) - vreplicationLag := time.Since(timeUpdated) + timeUpdated := time.Unix(stream.TimeUpdated.Seconds, 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 { + // 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() } - } 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 - } - now := time.Now().Unix() /* seconds since epoch */ - transactionReplicationLag := float64(now - lastTransactionTime) - if transactionReplicationLag > maxVReplicationTransactionLagByWorkflow[workflow.Name] { - maxVReplicationTransactionLagByWorkflow[workflow.Name] = transactionReplicationLag + // 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 := rstream.TransactionTimestamp.Seconds + 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 + } } } @@ -729,8 +651,6 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows ) 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 @@ -742,8 +662,9 @@ 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 { + wfres := wfres // https://golang.org/doc/faq#closures_and_goroutines + workflowName := wfres.Workflow workflow, ok := workflowsMap[workflowName] if !ok { workflow = &vtctldatapb.Workflow{ @@ -757,12 +678,12 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows } scanWorkflowWg.Add(1) - go func(ctx context.Context, workflow *vtctldatapb.Workflow, row sqltypes.RowNamedValues, tablet *topo.TabletInfo) { + go func(ctx context.Context, workflow *vtctldatapb.Workflow, res *tabletmanagerdatapb.ReadVReplicationWorkflowResponse, tablet *topo.TabletInfo) { defer scanWorkflowWg.Done() - if err := scanWorkflow(ctx, workflow, row, tablet); err != nil { + if err := scanWorkflow(ctx, workflow, res, tablet); err != nil { scanWorkflowErrors.RecordError(err) } - }(ctx, workflow, row, tablet) + }(ctx, workflow, wfres, tablet) } } @@ -815,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 @@ -1120,7 +1042,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() From e7646232869a21315e24a565d28a95631f6ceaef Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Mon, 8 Jan 2024 13:54:55 -0500 Subject: [PATCH 09/35] Fix concurrency for scanWorkflow Signed-off-by: Matt Lord --- go/vt/vtctl/workflow/server.go | 41 +++++++--------------------------- 1 file changed, 8 insertions(+), 33 deletions(-) diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index 4f5d750dd24..afba1162016 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -500,15 +500,11 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows // - targetShardsByWorkflow[workflow.Name] != nil // - workflow.ShardStatuses != nil scanWorkflow := func(ctx context.Context, workflow *vtctldatapb.Workflow, res *tabletmanagerdatapb.ReadVReplicationWorkflowResponse, 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()) - + // 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 @@ -549,12 +545,6 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows stream.CopyStates = copyState } - // 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() - switch { case strings.Contains(strings.ToLower(stream.Message), "error"): stream.State = binlogdatapb.VReplicationWorkflowState_Error.String() @@ -645,11 +635,6 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows return nil } - var ( - scanWorkflowWg sync.WaitGroup - scanWorkflowErrors concurrency.FirstErrorRecorder - ) - for tablet, result := range results { // 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 @@ -663,7 +648,6 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows // haven't seen yet for that shard primary. We use the workflow name to // dedupe for this. for _, wfres := range result.Workflows { - wfres := wfres // https://golang.org/doc/faq#closures_and_goroutines workflowName := wfres.Workflow workflow, ok := workflowsMap[workflowName] if !ok { @@ -677,21 +661,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, res *tabletmanagerdatapb.ReadVReplicationWorkflowResponse, tablet *topo.TabletInfo) { - defer scanWorkflowWg.Done() - if err := scanWorkflow(ctx, workflow, res, tablet); err != nil { - scanWorkflowErrors.RecordError(err) - } - }(ctx, workflow, wfres, 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(` From b17dfee10eb1a220cb570ca59cb6e3e1db2aca5d Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Mon, 8 Jan 2024 15:20:26 -0500 Subject: [PATCH 10/35] Re-add lost workflow data Signed-off-by: Matt Lord --- go/vt/vtctl/workflow/server.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index afba1162016..042c4854c15 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -603,6 +603,10 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows maxVReplicationLagByWorkflow[workflow.Name] = vreplicationLag.Seconds() } + workflow.WorkflowType = res.WorkflowType.String() + workflow.WorkflowSubType = res.WorkflowSubType.String() + workflow.DeferSecondaryKeys = res.DeferSecondaryKeys + // 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 From cd33853eae7132565c0de93bcfc8323bf520f421 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Tue, 9 Jan 2024 14:20:50 -0500 Subject: [PATCH 11/35] Add unit tests for new RPCs Signed-off-by: Matt Lord --- .../vttablet/tabletmanager/framework_test.go | 8 + .../tabletmanager/rpc_vreplication.go | 2 - .../tabletmanager/rpc_vreplication_test.go | 245 +++++++++++++++++- 3 files changed, 246 insertions(+), 9 deletions(-) diff --git a/go/vt/vttablet/tabletmanager/framework_test.go b/go/vt/vttablet/tabletmanager/framework_test.go index 4734ab9ee96..80d50e12618 100644 --- a/go/vt/vttablet/tabletmanager/framework_test.go +++ b/go/vt/vttablet/tabletmanager/framework_test.go @@ -490,3 +490,11 @@ func (tmc *fakeTMClient) VDiff(ctx context.Context, tablet *topodatapb.Tablet, r }, }, 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) ReadVReplicationWorkflows(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowsResponse, error) { + return tmc.tablets[int(tablet.Alias.Uid)].tm.ReadVReplicationWorkflows(ctx, req) +} diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication.go b/go/vt/vttablet/tabletmanager/rpc_vreplication.go index 62cfdeb1420..84e4068ffbf 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -28,7 +28,6 @@ import ( "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/textutil" "vitess.io/vitess/go/vt/discovery" - "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/proto/vttime" "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/topo/topoproto" @@ -226,7 +225,6 @@ func (tm *TabletManager) ReadVReplicationWorkflows(ctx context.Context, req *tab if err != nil { return nil, err } - log.Errorf("ReadVReplicationWorkflows query: %s", stmt) res, err := tm.VREngine.Exec(stmt) if err != nil { return nil, err diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go index c5ece83bf4e..f34386e8849 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go @@ -21,22 +21,23 @@ import ( "errors" "fmt" "math" + "reflect" "runtime/debug" "strings" "testing" - "vitess.io/vitess/go/vt/vttablet" - "github.com/stretchr/testify/require" "vitess.io/vitess/go/constants/sidecar" "vitess.io/vitess/go/sqlescape" "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/textutil" + "vitess.io/vitess/go/vt/proto/vttime" "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/topotools" "vitess.io/vitess/go/vt/vtctl/workflow" "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" @@ -44,10 +45,10 @@ import ( topodatapb "vitess.io/vitess/go/vt/proto/topodata" vschemapb "vitess.io/vitess/go/vt/proto/vschema" vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata" - "vitess.io/vitess/go/vt/proto/vttime" ) const ( + dbNamePrefix = "vt_" 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'" @@ -72,6 +73,8 @@ const ( 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" + hasWorkflows = "select if(count(*) > 0, 1, 0) as has_workflows from _vt.vreplication where db_name = 'vt_%s'" + readWorkflows = "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_%s'%s group by workflow, id order by workflow, id" ) var ( @@ -192,7 +195,7 @@ func TestCreateVReplicationWorkflow(t *testing.T) { } tenv.tmc.SetSchema(tt.schema) - tenv.tmc.tablets[targetTabletUID].vrdbClient.ExpectRequest("use _vt", &sqltypes.Result{}, nil) + tenv.tmc.tablets[targetTabletUID].vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.DefaultName), &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. @@ -312,7 +315,7 @@ func TestMoveTables(t *testing.T) { ) tenv.tmc.setVReplicationExecResults(ftc.tablet, getLatestCopyState, &sqltypes.Result{}) - ftc.vrdbClient.ExpectRequest("use _vt", &sqltypes.Result{}, nil) + ftc.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.DefaultName), &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) ftc.vrdbClient.ExpectRequest(insert, &sqltypes.Result{InsertID: 1}, nil) @@ -792,7 +795,7 @@ func TestSourceShardSelection(t *testing.T) { for uid, streams := range tt.streams { tt := targetTablets[uid] for i, sourceShard := range streams { - tt.vrdbClient.ExpectRequest("use _vt", &sqltypes.Result{}, nil) + tt.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.DefaultName), &sqltypes.Result{}, nil) var err error if i == len(streams)-1 { // errShortCircuit is intentionally injected into the MoveTables @@ -889,7 +892,7 @@ func TestFailedMoveTablesCreateCleanup(t *testing.T) { "1", ), ) - targetTablet.vrdbClient.ExpectRequest("use _vt", &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.DefaultName), &sqltypes.Result{}, nil) targetTablet.vrdbClient.ExpectRequest( fmt.Sprintf("%s %s", insertVReplicationPrefix, @@ -1028,3 +1031,231 @@ 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{ + DbName: dbNamePrefix + tt.tablet.tablet.Keyspace, + } + + tt.tablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.DefaultName), &sqltypes.Result{}, nil) + tt.tablet.vrdbClient.ExpectRequest(fmt.Sprintf(hasWorkflows, tt.tablet.tablet.Keyspace), 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: "no db name", + req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{}, + wantErr: true, + }, + { + name: "only db name", + req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ + DbName: dbNamePrefix + ks, + }, + // No additional query predicates. + }, + { + name: "all except frozen", + req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ + DbName: dbNamePrefix + ks, + ExcludeFrozen: true, + }, + wantPreds: " and message != 'FROZEN'", + }, + { + name: "1-3 unless frozen", + req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ + DbName: dbNamePrefix + ks, + 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{ + DbName: dbNamePrefix + ks, + ExcludeWorkflows: []string{"wf1", "wf2"}, + }, + wantPreds: " and workflow not in ('wf1','wf2')", + }, + { + name: "all but wf1 and wf2", + req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ + DbName: dbNamePrefix + ks, + ExcludeWorkflows: []string{"wf1", "wf2"}, + }, + wantPreds: " and workflow not in ('wf1','wf2')", + }, + { + name: "only wf1 and wf2", + req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ + DbName: dbNamePrefix + ks, + 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{ + DbName: dbNamePrefix + ks, + IncludeStates: []binlogdatapb.VReplicationWorkflowState{ + binlogdatapb.VReplicationWorkflowState_Copying, + binlogdatapb.VReplicationWorkflowState_Running, + }, + }, + wantPreds: " and state in ('Copying','Running')", + }, + { + name: "mess of predicates", + req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ + DbName: dbNamePrefix + ks, + 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.DefaultName), &sqltypes.Result{}, nil) + tablet.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflows, tablet.tablet.Keyspace, 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 + } + }) + } +} From bb37806a754305fb2af7fd1729c5075f7d09b913 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Tue, 9 Jan 2024 18:28:04 -0500 Subject: [PATCH 12/35] WiP unit test adjustments Signed-off-by: Matt Lord --- go/vt/vtctl/workflow/server.go | 3 +- go/vt/vtctl/workflow/utils.go | 4 + .../vttablet/tabletmanager/framework_test.go | 4 + .../tabletmanager/rpc_vreplication.go | 4 +- .../tabletmanager/rpc_vreplication_test.go | 73 +++++++++---------- 5 files changed, 48 insertions(+), 40 deletions(-) diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index 6746b6e1a25..b156be1c0df 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -1254,11 +1254,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) diff --git a/go/vt/vtctl/workflow/utils.go b/go/vt/vtctl/workflow/utils.go index 2bd8f868a0c..aecd38c16c8 100644 --- a/go/vt/vtctl/workflow/utils.go +++ b/go/vt/vtctl/workflow/utils.go @@ -113,6 +113,10 @@ func validateNewWorkflow(ctx context.Context, ts *topo.Server, tmc tmclient.Tabl 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)) diff --git a/go/vt/vttablet/tabletmanager/framework_test.go b/go/vt/vttablet/tabletmanager/framework_test.go index 80d50e12618..86f1ec31b23 100644 --- a/go/vt/vttablet/tabletmanager/framework_test.go +++ b/go/vt/vttablet/tabletmanager/framework_test.go @@ -498,3 +498,7 @@ func (tmc *fakeTMClient) HasVReplicationWorkflows(ctx context.Context, tablet *t 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_vreplication.go b/go/vt/vttablet/tabletmanager/rpc_vreplication.go index 84e4068ffbf..d115aa8bb86 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -229,11 +229,11 @@ func (tm *TabletManager) ReadVReplicationWorkflows(ctx context.Context, req *tab if err != nil { return nil, err } + resp := &tabletmanagerdatapb.ReadVReplicationWorkflowsResponse{} if res == nil || len(res.Rows) == 0 { - return nil, nil + return resp, nil } rows := res.Named().Rows - resp := &tabletmanagerdatapb.ReadVReplicationWorkflowsResponse{} workflows := make(map[string]*tabletmanagerdatapb.ReadVReplicationWorkflowResponse) for _, row := range rows { diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go index f34386e8849..370bc4e3122 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go @@ -55,7 +55,6 @@ const ( 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 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" 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" @@ -74,7 +73,8 @@ const ( 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" hasWorkflows = "select if(count(*) > 0, 1, 0) as has_workflows from _vt.vreplication where db_name = 'vt_%s'" - readWorkflows = "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_%s'%s group by workflow, id order by workflow, id" + 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 = 'vt_%s'%s group by workflow, id order by workflow, id" + readWorkflow = "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_%s' and workflow in ('%s') group by workflow, id order by workflow, id" ) var ( @@ -171,10 +171,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 { @@ -195,11 +191,13 @@ func TestCreateVReplicationWorkflow(t *testing.T) { } tenv.tmc.SetSchema(tt.schema) - tenv.tmc.tablets[targetTabletUID].vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.DefaultName), &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) + tenv.tmc.tablets[targetTabletUID].vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + tenv.tmc.tablets[targetTabletUID].vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, targetKs, ""), &sqltypes.Result{}, nil) + tenv.tmc.tablets[targetTabletUID].vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + tenv.tmc.tablets[targetTabletUID].vrdbClient.ExpectRequest(tt.query, &sqltypes.Result{}, errShortCircuit) _, err := ws.MoveTablesCreate(ctx, tt.req) tenv.tmc.tablets[targetTabletUID].vrdbClient.Wait() require.ErrorIs(t, err, errShortCircuit) @@ -304,20 +302,13 @@ func TestMoveTables(t *testing.T) { ), ) 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{}) - ftc.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.DefaultName), &sqltypes.Result{}, nil) + ftc.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + ftc.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, targetKs, ""), &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) + ftc.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) ftc.vrdbClient.ExpectRequest(insert, &sqltypes.Result{InsertID: 1}, nil) ftc.vrdbClient.ExpectRequest(getAutoIncrementStep, &sqltypes.Result{}, nil) ftc.vrdbClient.ExpectRequest(getVReplicationRecord, @@ -379,6 +370,15 @@ func TestMoveTables(t *testing.T) { "FULL", ), nil) + ftc.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + ftc.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflow, targetKs, 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", + "varchar|int64|varchar|blob|varchar|int64|int64|varchar|varchar|int64|int64|varchar|varchar|varchar|int64|varchar|int64|int64|int64|varchar|int64|int64", + ), + fmt.Sprintf("%s|1|%s|%s|NULL|0|0|||1686577659|0|Running||%s|1||0|0|0||0|1", wf, 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( @@ -390,7 +390,7 @@ func TestMoveTables(t *testing.T) { ), ) tenv.tmc.setVReplicationExecResults(ftc.tablet, fmt.Sprintf(startWorkflow, targetKs, wf), &sqltypes.Result{}) - ftc.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.DefaultName), &sqltypes.Result{}, nil) + ftc.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) tenv.tmc.setVReplicationExecResults(ftc.tablet, stopForCutover, &sqltypes.Result{}) tenv.tmc.setVReplicationExecResults(ftc.tablet, fmt.Sprintf(freezeWorkflow, targetKs, wf), &sqltypes.Result{}) @@ -435,15 +435,14 @@ func TestMoveTables(t *testing.T) { }) require.NoError(t, err) - tenv.tmc.setVReplicationExecResults(sourceTablet.tablet, fmt.Sprintf(getWorkflowStatus, workflow.ReverseWorkflowName(wf), sourceKs), - 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", workflow.ReverseWorkflowName(wf), bls, position, sourceKs), + tenv.tmc.setVReplicationExecResults(sourceTablet.tablet, fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}) + tenv.tmc.setVReplicationExecResults(sourceTablet.tablet, fmt.Sprintf(readWorkflow, sourceKs, 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", + "varchar|int64|varchar|blob|varchar|int64|int64|varchar|varchar|int64|int64|varchar|varchar|varchar|int64|varchar|int64|int64|int64|varchar|int64|int64", ), - ) + fmt.Sprintf("%s|1|%s|%s|NULL|0|0|||1686577659|0|Running||%s|1||0|0|0||0|1", wf, bls, position, targetKs), + )) _, err = ws.WorkflowSwitchTraffic(ctx, &vtctldatapb.WorkflowSwitchTrafficRequest{ Keyspace: targetKs, @@ -472,7 +471,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), } @@ -597,9 +596,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 @@ -795,7 +794,7 @@ func TestSourceShardSelection(t *testing.T) { for uid, streams := range tt.streams { tt := targetTablets[uid] for i, sourceShard := range streams { - tt.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.DefaultName), &sqltypes.Result{}, nil) + tt.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) var err error if i == len(streams)-1 { // errShortCircuit is intentionally injected into the MoveTables @@ -892,7 +891,7 @@ func TestFailedMoveTablesCreateCleanup(t *testing.T) { "1", ), ) - targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.DefaultName), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) targetTablet.vrdbClient.ExpectRequest( fmt.Sprintf("%s %s", insertVReplicationPrefix, @@ -1117,7 +1116,7 @@ func TestHasVReplicationWorkflows(t *testing.T) { DbName: dbNamePrefix + tt.tablet.tablet.Keyspace, } - tt.tablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.DefaultName), &sqltypes.Result{}, nil) + tt.tablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) tt.tablet.vrdbClient.ExpectRequest(fmt.Sprintf(hasWorkflows, tt.tablet.tablet.Keyspace), tt.queryRes, nil) got, err := tenv.tmc.HasVReplicationWorkflows(ctx, tt.tablet.tablet, req) @@ -1132,8 +1131,8 @@ func TestHasVReplicationWorkflows(t *testing.T) { } } -// TestReadVReplicationWorkflows tests the RPC requests are turned into -// the expected proper SQL query. +// 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() @@ -1247,8 +1246,8 @@ func TestReadVReplicationWorkflows(t *testing.T) { 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.DefaultName), &sqltypes.Result{}, nil) - tablet.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflows, tablet.tablet.Keyspace, tt.wantPreds), &sqltypes.Result{}, nil) + tablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + tablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tablet.tablet.Keyspace, tt.wantPreds), &sqltypes.Result{}, nil) } _, err := tenv.tmc.ReadVReplicationWorkflows(ctx, tablet.tablet, tt.req) From 5adc834bc97524d167b0e0ef963043b80ed9edd9 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Mon, 22 Jan 2024 23:43:08 -0500 Subject: [PATCH 13/35] Add back tablet type and cell info Signed-off-by: Matt Lord --- go/vt/vtctl/workflow/server.go | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index b8dcf9116f3..2a296930525 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -523,20 +523,28 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows 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(), - TransactionTimestamp: rstream.TransactionTimestamp, - TimeUpdated: rstream.TimeUpdated, - Message: rstream.Message, - Tags: strings.Split(res.Tags, ","), - RowsCopied: rstream.RowsCopied, + 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, From 1ceee0819de6c4865674ca1c1892bd1faf18829f Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Tue, 23 Jan 2024 01:33:31 -0500 Subject: [PATCH 14/35] Fixup TestMoveTables unit test Signed-off-by: Matt Lord --- go/vt/binlog/binlogplayer/binlog_player.go | 3 +- go/vt/binlog/binlogplayer/mock_dbclient.go | 12 +- go/vt/vtctl/workflow/utils.go | 2 +- .../vttablet/tabletmanager/framework_test.go | 43 +-- .../tabletmanager/rpc_vreplication.go | 5 +- .../tabletmanager/rpc_vreplication_test.go | 275 ++++++++++-------- 6 files changed, 184 insertions(+), 156 deletions(-) diff --git a/go/vt/binlog/binlogplayer/binlog_player.go b/go/vt/binlog/binlogplayer/binlog_player.go index f651f3bb25c..bc6b7c03d3d 100644 --- a/go/vt/binlog/binlogplayer/binlog_player.go +++ b/go/vt/binlog/binlogplayer/binlog_player.go @@ -547,8 +547,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 abc170ed493..bc5af658608 100644 --- a/go/vt/binlog/binlogplayer/mock_dbclient.go +++ b/go/vt/binlog/binlogplayer/mock_dbclient.go @@ -99,6 +99,12 @@ func NewMockDbaClient(t *testing.T) *MockDBClient { } } +func (dc *MockDBClient) AddInvariant(query string, result *sqltypes.Result) { + dc.expectMu.Lock() + defer dc.expectMu.Unlock() + dc.invariants[query] = result +} + // ExpectRequest adds an expected result to the mock. // This function should not be called conncurrently with other commands. func (dc *MockDBClient) ExpectRequest(query string, result *sqltypes.Result, err error) { @@ -182,6 +188,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 +205,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/vtctl/workflow/utils.go b/go/vt/vtctl/workflow/utils.go index aecd38c16c8..5275448ba06 100644 --- a/go/vt/vtctl/workflow/utils.go +++ b/go/vt/vtctl/workflow/utils.go @@ -368,7 +368,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 } diff --git a/go/vt/vttablet/tabletmanager/framework_test.go b/go/vt/vttablet/tabletmanager/framework_test.go index 86f1ec31b23..fbbd87fb1d4 100644 --- a/go/vt/vttablet/tabletmanager/framework_test.go +++ b/go/vt/vttablet/tabletmanager/framework_test.go @@ -432,41 +432,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 } @@ -491,10 +456,18 @@ 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) 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) } diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication.go b/go/vt/vttablet/tabletmanager/rpc_vreplication.go index 217cd74219c..13d25e33fc6 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -462,6 +462,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 @@ -484,7 +487,7 @@ func (tm *TabletManager) UpdateVReplicationWorkflow(ctx context.Context, req *ta tabletTypes = req.TabletTypes } tabletTypesStr := topoproto.MakeStringTypeCSV(tabletTypes) - if inorder && req.TabletSelectionPreference == tabletmanagerdatapb.TabletSelectionPreference_UNKNOWN || + if (inorder && req.TabletSelectionPreference == tabletmanagerdatapb.TabletSelectionPreference_UNKNOWN) || req.TabletSelectionPreference == tabletmanagerdatapb.TabletSelectionPreference_INORDER { tabletTypesStr = discovery.InOrderHint + tabletTypesStr } diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go index 0e8b4b9a2e5..fba5e5e7ea7 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go @@ -32,7 +32,7 @@ import ( "vitess.io/vitess/go/sqlescape" "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/textutil" - "vitess.io/vitess/go/vt/proto/vttime" + "vitess.io/vitess/go/vt/binlog/binlogplayer" "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/topotools" "vitess.io/vitess/go/vt/vtctl/workflow" @@ -46,6 +46,7 @@ import ( topodatapb "vitess.io/vitess/go/vt/proto/topodata" vschemapb "vitess.io/vitess/go/vt/proto/vschema" vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata" + "vitess.io/vitess/go/vt/proto/vttime" ) const ( @@ -56,26 +57,29 @@ const ( 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=" - 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 = 'vt_%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 = 'vt_%s'%s group by workflow, id order by workflow, id" - readWorkflow = "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_%s' and workflow in ('%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 = 'vt_%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 ( @@ -206,10 +210,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() @@ -221,6 +226,7 @@ func TestMoveTables(t *testing.T) { globalKs := "global" globalShard := "0" wf := "testwf" + vreplID := 1 tabletTypes := []topodatapb.TabletType{ topodatapb.TabletType_PRIMARY, topodatapb.TabletType_REPLICA, @@ -272,6 +278,17 @@ func TestMoveTables(t *testing.T) { 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) @@ -291,120 +308,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, getLatestCopyState, &sqltypes.Result{}) + addInvariants(ftc.vrdbClient, vreplID, sourceTabletUID, position, wf, tenv.cells[0]) - ftc.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + tenv.tmc.setVReplicationExecResults(ftc.tablet, getCopyState, &sqltypes.Result{}) ftc.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, targetKs, ""), &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) - ftc.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &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", - ), nil) - ftc.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), + fmt.Sprintf("%d|%s|||Stopped|", vreplID, bls), ), nil) - ftc.vrdbClient.ExpectRequest(getNumCopyStateTable, 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( - "count(distinct table_name)", - "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", ), - "1", + 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(getBinlogRowImage, sqltypes.MakeTestResult( + ftc.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflowsLimited, targetKs, wf), sqltypes.MakeTestResult( sqltypes.MakeTestFields( - "@@binlog_row_image", - "varchar", + "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", ), - "FULL", + 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("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) - ftc.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflow, targetKs, wf), sqltypes.MakeTestResult( + ftc.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflow, wf, tenv.dbName), 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", - "varchar|int64|varchar|blob|varchar|int64|int64|varchar|varchar|int64|int64|varchar|varchar|varchar|int64|varchar|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("%s|1|%s|%s|NULL|0|0|||1686577659|0|Running||%s|1||0|0|0||0|1", wf, bls, position, targetKs), + 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.GetIdentifier()), &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. @@ -414,7 +379,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, @@ -425,6 +390,23 @@ func TestMoveTables(t *testing.T) { }) require.NoError(t, err) + for _, ftc := range targetShards { + ftc.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflowsLimited, targetKs, 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, @@ -436,14 +418,31 @@ func TestMoveTables(t *testing.T) { }) require.NoError(t, err) - tenv.tmc.setVReplicationExecResults(sourceTablet.tablet, fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}) - tenv.tmc.setVReplicationExecResults(sourceTablet.tablet, fmt.Sprintf(readWorkflow, sourceKs, workflow.ReverseWorkflowName(wf)), sqltypes.MakeTestResult( + for _, ftc := range targetShards { + 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) + } + 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, sourceKs, 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", - "varchar|int64|varchar|blob|varchar|int64|int64|varchar|varchar|int64|int64|varchar|varchar|varchar|int64|varchar|int64|int64|int64|varchar|int64|int64", + "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|1|%s|%s|NULL|0|0|||1686577659|0|Running||%s|1||0|0|0||0|1", wf, bls, position, targetKs), - )) + 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, @@ -906,23 +905,23 @@ func TestFailedMoveTablesCreateCleanup(t *testing.T) { nil, ) targetTablet.vrdbClient.ExpectRequest(getAutoIncrementStep, &sqltypes.Result{}, nil) - targetTablet.vrdbClient.ExpectRequest(getVReplicationRecord, + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(getVReplicationRecord, 1), sqltypes.MakeTestResult( sqltypes.MakeTestFields( "id|source", "int64|varchar", ), - fmt.Sprintf("1|%s", bls), + fmt.Sprintf("%d|%s", 1, bls), ), nil, ) - targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(updatePickedSourceTablet, tenv.cells[0], sourceTabletUID), + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(updatePickedSourceTablet, tenv.cells[0], sourceTabletUID, 1), &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, + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(getRowsCopied, 1), sqltypes.MakeTestResult( sqltypes.MakeTestFields( "rows_copied", @@ -932,7 +931,7 @@ func TestFailedMoveTablesCreateCleanup(t *testing.T) { ), nil, ) - targetTablet.vrdbClient.ExpectRequest(getWorkflowState, + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(getWorkflowState, 1), sqltypes.MakeTestResult( sqltypes.MakeTestFields( "pos|stop_pos|max_tps|max_replication_lag|state|workflow_type|workflow|workflow_sub_type|defer_secondary_keys", @@ -942,7 +941,7 @@ func TestFailedMoveTablesCreateCleanup(t *testing.T) { ), nil, ) - targetTablet.vrdbClient.ExpectRequest(getNumCopyStateTable, + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(getNumCopyStateTable, 1), sqltypes.MakeTestResult( sqltypes.MakeTestFields( "count(distinct table_name)", @@ -952,7 +951,7 @@ func TestFailedMoveTablesCreateCleanup(t *testing.T) { ), nil, ) - targetTablet.vrdbClient.ExpectRequest(getWorkflowState, + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(getWorkflowState, 1), sqltypes.MakeTestResult( sqltypes.MakeTestFields( "pos|stop_pos|max_tps|max_replication_lag|state|workflow_type|workflow|workflow_sub_type|defer_secondary_keys", @@ -962,7 +961,7 @@ func TestFailedMoveTablesCreateCleanup(t *testing.T) { ), nil, ) - targetTablet.vrdbClient.ExpectRequest(getNumCopyStateTable, + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(getNumCopyStateTable, 1), sqltypes.MakeTestResult( sqltypes.MakeTestFields( "count(distinct table_name)", @@ -1259,3 +1258,49 @@ func TestReadVReplicationWorkflows(t *testing.T) { }) } } + +// 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{}) +} From f76b42bc9211d42b93463c94145807fb0c63250d Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 24 Jan 2024 10:56:59 -0500 Subject: [PATCH 15/35] Leave wrangler / vtctlclient implementation unchanged Signed-off-by: Matt Lord --- go/vt/vtctl/workflow/stream_migrator.go | 360 ++++++++++++++++++++++++ go/vt/wrangler/switcher.go | 6 + go/vt/wrangler/switcher_dry_run.go | 6 + go/vt/wrangler/switcher_interface.go | 1 + go/vt/wrangler/traffic_switcher.go | 4 +- 5 files changed, 375 insertions(+), 2 deletions(-) diff --git a/go/vt/vtctl/workflow/stream_migrator.go b/go/vt/vtctl/workflow/stream_migrator.go index a415813da0a..aab8dac40dd 100644 --- a/go/vt/vtctl/workflow/stream_migrator.go +++ b/go/vt/vtctl/workflow/stream_migrator.go @@ -23,7 +23,10 @@ import ( "sync" "text/template" + "google.golang.org/protobuf/encoding/prototext" + "vitess.io/vitess/go/mysql/replication" + "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/vt/concurrency" "vitess.io/vitess/go/vt/key" "vitess.io/vitess/go/vt/logutil" @@ -105,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 @@ -191,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 { @@ -211,6 +269,92 @@ 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 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 != "" { + query += fmt.Sprintf(" and %s", constraint) + } + + p3qr, err := sm.ts.TabletManagerClient().VReplicationExec(ctx, ti.Tablet, query) + if err != nil { + return nil, err + } + + qr := sqltypes.Proto3ToResult(p3qr) + tabletStreams := make([]*VReplicationStream, 0, len(qr.Rows)) + + for _, row := range qr.Named().Rows { + id, err := row["id"].ToInt32() + if err != nil { + return nil, err + } + + workflowName := row["workflow"].ToString() + switch workflowName { + case "": + return nil, fmt.Errorf("VReplication streams must have named workflows for migration: shard: %s:%s, stream: %d", + ti.Keyspace, ti.Shard, id) + case sm.ts.WorkflowName(): + return nil, fmt.Errorf("VReplication stream has the same workflow name as the resharding workflow: shard: %s:%s, stream: %d", + ti.Keyspace, ti.Shard, id) + } + + workflowType, err := row["workflow_type"].ToInt32() + if err != nil { + return nil, err + } + workflowSubType, err := row["workflow_sub_type"].ToInt32() + if err != nil { + return nil, err + } + + deferSecondaryKeys, err := row["defer_secondary_keys"].ToBool() + if err != nil { + return nil, err + } + + var bls binlogdatapb.BinlogSource + rowBytes, err := row["source"].ToBytes() + if err != nil { + return nil, err + } + if err := prototext.Unmarshal(rowBytes, &bls); err != nil { + return nil, err + } + + isReference, err := sm.blsIsReference(&bls) + if err != nil { + return nil, vterrors.Wrap(err, "blsIsReference") + } + + if isReference { + sm.ts.Logger().Infof("readTabletStreams: ignoring reference table %+v", &bls) + continue + } + + pos, err := replication.DecodePosition(row["pos"].ToString()) + if err != nil { + return nil, err + } + + tabletStreams = append(tabletStreams, &VReplicationStream{ + ID: id, + Workflow: workflowName, + BinlogSource: &bls, + Position: pos, + WorkflowType: binlogdatapb.VReplicationWorkflowType(workflowType), + WorkflowSubType: binlogdatapb.VReplicationWorkflowSubType(workflowSubType), + DeferSecondaryKeys: deferSecondaryKeys, + }) + } + 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) { @@ -271,6 +415,115 @@ func (sm *StreamMigrator) readTabletStreams(ctx context.Context, ti *topo.Tablet /* 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 @@ -378,6 +631,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 @@ -483,6 +777,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 diff --git a/go/vt/wrangler/switcher.go b/go/vt/wrangler/switcher.go index 0e1f33b90ea..72c7e96dbde 100644 --- a/go/vt/wrangler/switcher.go +++ b/go/vt/wrangler/switcher.go @@ -108,6 +108,12 @@ func (r *switcher) stopSourceWrites(ctx context.Context) error { return r.ts.stopSourceWrites(ctx) } +// Note: this is a legacy function that is only used by the legacy wrangler migrater and it +// should be deleted along with the vtctl client / wrangler. +func (r *switcher) legacyStopStreams(ctx context.Context, sm *workflow.StreamMigrator) ([]string, error) { + return sm.LegacyStopStreams(ctx) +} + func (r *switcher) stopStreams(ctx context.Context, sm *workflow.StreamMigrator) ([]string, error) { return sm.StopStreams(ctx) } diff --git a/go/vt/wrangler/switcher_dry_run.go b/go/vt/wrangler/switcher_dry_run.go index 6c1b48bb5c6..8e07535f4d4 100644 --- a/go/vt/wrangler/switcher_dry_run.go +++ b/go/vt/wrangler/switcher_dry_run.go @@ -209,6 +209,12 @@ func (dr *switcherDryRun) stopSourceWrites(ctx context.Context) error { return nil } +// Note: this is a legacy function that is only used by the legacy wrangler migrater and it +// should be deleted along with the vtctl client / wrangler. +func (dr *switcherDryRun) legacyStopStreams(ctx context.Context, sm *workflow.StreamMigrator) ([]string, error) { + return dr.stopStreams(ctx, sm) +} + func (dr *switcherDryRun) stopStreams(ctx context.Context, sm *workflow.StreamMigrator) ([]string, error) { logs := make([]string, 0) for _, streams := range sm.Streams() { diff --git a/go/vt/wrangler/switcher_interface.go b/go/vt/wrangler/switcher_interface.go index bae165ec2ea..09b083740de 100644 --- a/go/vt/wrangler/switcher_interface.go +++ b/go/vt/wrangler/switcher_interface.go @@ -28,6 +28,7 @@ import ( type iswitcher interface { lockKeyspace(ctx context.Context, keyspace, action string) (context.Context, func(*error), error) cancelMigration(ctx context.Context, sm *workflow.StreamMigrator) + legacyStopStreams(ctx context.Context, sm *workflow.StreamMigrator) ([]string, error) stopStreams(ctx context.Context, sm *workflow.StreamMigrator) ([]string, error) stopSourceWrites(ctx context.Context) error waitForCatchup(ctx context.Context, filteredReplicationWaitTime time.Duration) error diff --git a/go/vt/wrangler/traffic_switcher.go b/go/vt/wrangler/traffic_switcher.go index e25b94f99e2..1eacc701597 100644 --- a/go/vt/wrangler/traffic_switcher.go +++ b/go/vt/wrangler/traffic_switcher.go @@ -553,7 +553,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) } @@ -563,7 +563,7 @@ func (wr *Wrangler) SwitchWrites(ctx context.Context, targetKeyspace, workflowNa } ts.Logger().Infof("Stopping streams") - sourceWorkflows, err = sw.stopStreams(ctx, sm) + sourceWorkflows, err = sw.legacyStopStreams(ctx, sm) if err != nil { for key, streams := range sm.Streams() { for _, stream := range streams { From 812960e67354068dc4edc30cbd8cee880ef937be Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 24 Jan 2024 16:16:56 -0500 Subject: [PATCH 16/35] Fixup TestSourceShardSelection unit test Signed-off-by: Matt Lord --- go/vt/vttablet/tabletmanager/rpc_vreplication_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go index fba5e5e7ea7..9a16ce5a130 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go @@ -767,6 +767,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 { @@ -793,8 +794,9 @@ func TestSourceShardSelection(t *testing.T) { 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, targetKs, ""), &sqltypes.Result{}, nil) for i, sourceShard := range streams { - tt.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) var err error if i == len(streams)-1 { // errShortCircuit is intentionally injected into the MoveTables @@ -802,6 +804,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), From ee28bc166625b2618654b30ba17dedfc0cf01979 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 24 Jan 2024 16:43:54 -0500 Subject: [PATCH 17/35] Fixup the TestFailedMoveTablesCreateCleanup unit test Signed-off-by: Matt Lord --- .../tabletmanager/rpc_vreplication_test.go | 92 +++---------------- 1 file changed, 13 insertions(+), 79 deletions(-) diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go index 9a16ce5a130..276f2215b94 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go @@ -854,6 +854,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\"}}", @@ -883,18 +884,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(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + addInvariants(targetTablet.vrdbClient, vreplID, sourceTabletUID, position, wf, tenv.cells[0]) + + tenv.tmc.tablets[targetTabletUID].vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, targetKs, ""), &sqltypes.Result{}, nil) targetTablet.vrdbClient.ExpectRequest( fmt.Sprintf("%s %s", insertVReplicationPrefix, @@ -908,82 +900,24 @@ func TestFailedMoveTablesCreateCleanup(t *testing.T) { nil, ) targetTablet.vrdbClient.ExpectRequest(getAutoIncrementStep, &sqltypes.Result{}, nil) - targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(getVReplicationRecord, 1), + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(getVReplicationRecord, vreplID), sqltypes.MakeTestResult( sqltypes.MakeTestFields( "id|source", "int64|varchar", ), - fmt.Sprintf("%d|%s", 1, bls), - ), - nil, - ) - targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(updatePickedSourceTablet, tenv.cells[0], sourceTabletUID, 1), - &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(fmt.Sprintf(getRowsCopied, 1), - sqltypes.MakeTestResult( - sqltypes.MakeTestFields( - "rows_copied", - "int64", - ), - "0", - ), - nil, - ) - targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(getWorkflowState, 1), - 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), + fmt.Sprintf("%d|%s", vreplID, bls), ), nil, ) - targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(getNumCopyStateTable, 1), - sqltypes.MakeTestResult( - sqltypes.MakeTestFields( - "count(distinct table_name)", - "int64", - ), - "1", - ), - nil, - ) - targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(getWorkflowState, 1), - 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(fmt.Sprintf(getNumCopyStateTable, 1), - sqltypes.MakeTestResult( - sqltypes.MakeTestFields( - "count(distinct table_name)", - "int64", - ), - "1", - ), - 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, From b3371a5d7ed1435040182a15289cac2865e2085b Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 24 Jan 2024 18:09:07 -0500 Subject: [PATCH 18/35] Fixup TestMigrateVSchema unit test Signed-off-by: Matt Lord --- go/vt/vtctl/workflow/materializer_env_test.go | 53 ++++++++++++++++++- go/vt/vtctl/workflow/materializer_test.go | 8 +-- go/vt/vtctl/workflow/server.go | 9 ++++ 3 files changed, 63 insertions(+), 7 deletions(-) diff --git a/go/vt/vtctl/workflow/materializer_env_test.go b/go/vt/vtctl/workflow/materializer_env_test.go index 452c5755a10..0c5623ca13b 100644 --- a/go/vt/vtctl/workflow/materializer_env_test.go +++ b/go/vt/vtctl/workflow/materializer_env_test.go @@ -128,7 +128,7 @@ func (env *testMaterializerEnv) expectValidation() { 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{}) + //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{}) } } @@ -381,3 +381,54 @@ 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, + Bls: &binlogdatapb.BinlogSource{ + Keyspace: "sourceks", + Shard: "0", + Filter: &binlogdatapb.Filter{ + Rules: []*binlogdatapb.Rule{ + { + Match: ".*", + }, + }, + }, + }, + }, + }, + }, + }, + }, 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 8653d6e0471..9477951c8f5 100644 --- a/go/vt/vtctl/workflow/materializer_test.go +++ b/go/vt/vtctl/workflow/materializer_test.go @@ -450,12 +450,8 @@ 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{}) + env.tmc.expectVRQuery(200, "select distinct table_name from _vt.copy_state cs, _vt.vreplication vr where vr.id = cs.vrepl_id and vr.id = 1", &sqltypes.Result{}) + env.tmc.expectVRQuery(200, "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)", &sqltypes.Result{}) _, err := env.ws.MoveTablesCreate(ctx, &vtctldatapb.MoveTablesCreateRequest{ Workflow: ms.Workflow, diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index 2a296930525..0ea476ed2e0 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -602,6 +602,9 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows targetKeyspaceByWorkflow[workflow.Name] = tablet.Keyspace + if stream.TimeUpdated == nil { + stream.TimeUpdated = &vttimepb.Time{} + } timeUpdated := time.Unix(stream.TimeUpdated.Seconds, 0) vreplicationLag := time.Since(timeUpdated) @@ -630,7 +633,13 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows if _, ok := maxVReplicationTransactionLagByWorkflow[workflow.Name]; !ok { maxVReplicationTransactionLagByWorkflow[workflow.Name] = 0 } + if rstream.TransactionTimestamp == nil { + rstream.TransactionTimestamp = &vttimepb.Time{} + } 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 From c2a00b1d45309fd1e0e30e4c8c643e70282ed996 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 24 Jan 2024 18:42:56 -0500 Subject: [PATCH 19/35] Fixup other materializer unit tests Signed-off-by: Matt Lord --- go/vt/vtctl/workflow/materializer_env_test.go | 8 +++- go/vt/vtctl/workflow/materializer_test.go | 48 ++++++++----------- go/vt/vtctl/workflow/server.go | 7 +++ 3 files changed, 35 insertions(+), 28 deletions(-) diff --git a/go/vt/vtctl/workflow/materializer_env_test.go b/go/vt/vtctl/workflow/materializer_env_test.go index 0c5623ca13b..8078918dd81 100644 --- a/go/vt/vtctl/workflow/materializer_env_test.go +++ b/go/vt/vtctl/workflow/materializer_env_test.go @@ -25,9 +25,11 @@ import ( "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" @@ -403,7 +405,8 @@ func (tmc *testMaterializerTMClient) ReadVReplicationWorkflows(ctx context.Conte WorkflowType: workflowType, Streams: []*tabletmanagerdatapb.ReadVReplicationWorkflowResponse_Stream{ { - Id: 1, + Id: 1, + State: binlogdatapb.VReplicationWorkflowState_Running, Bls: &binlogdatapb.BinlogSource{ Keyspace: "sourceks", Shard: "0", @@ -415,6 +418,9 @@ func (tmc *testMaterializerTMClient) ReadVReplicationWorkflows(ctx context.Conte }, }, }, + Pos: "MySQL56/" + position, + TimeUpdated: protoutil.TimeToProto(time.Now()), + TimeHeartbeat: protoutil.TimeToProto(time.Now()), }, }, }, diff --git a/go/vt/vtctl/workflow/materializer_test.go b/go/vt/vtctl/workflow/materializer_test.go index 9477951c8f5..bae84a4ad9c 100644 --- a/go/vt/vtctl/workflow/materializer_test.go +++ b/go/vt/vtctl/workflow/materializer_test.go @@ -45,15 +45,16 @@ 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() @@ -79,7 +80,7 @@ var ( "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), + fmt.Sprintf("1|wf1|%s|MySQL56/%s|NULL|0|Running|vt_ks|1686577659|0|||1|0|0|0||0|10", binlogSource, position), ) ) @@ -450,8 +451,8 @@ func TestMigrateVSchema(t *testing.T) { defer env.close() env.tmc.expectVRQuery(100, mzCheckJournal, &sqltypes.Result{}) - env.tmc.expectVRQuery(200, "select distinct table_name from _vt.copy_state cs, _vt.vreplication vr where vr.id = cs.vrepl_id and vr.id = 1", &sqltypes.Result{}) - env.tmc.expectVRQuery(200, "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)", &sqltypes.Result{}) + env.tmc.expectVRQuery(200, mzGetCopyState, &sqltypes.Result{}) + env.tmc.expectVRQuery(200, mzGetLatestCopyState, &sqltypes.Result{}) _, err := env.ws.MoveTablesCreate(ctx, &vtctldatapb.MoveTablesCreateRequest{ Workflow: ms.Workflow, @@ -508,18 +509,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, @@ -560,18 +558,15 @@ 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 := 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, @@ -663,8 +658,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{}) @@ -2377,10 +2373,8 @@ func TestExternalizeLookupVindex(t *testing.T) { 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) + env.tmc.expectVRQuery(200, mzGetCopyState, &sqltypes.Result{}) + env.tmc.expectVRQuery(200, mzGetLatestCopyState, &sqltypes.Result{}) preWorkflowDeleteCalls := env.tmc.workflowDeleteCalls _, err = env.ws.LookupVindexExternalize(ctx, tcase.request) diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index 0ea476ed2e0..5b1fabb31ae 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -557,6 +557,10 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows stream.CopyStates = copyState } + if rstream.TimeUpdated == nil { + rstream.TimeUpdated = &vttimepb.Time{} + } + switch { case strings.Contains(strings.ToLower(stream.Message), "error"): stream.State = binlogdatapb.VReplicationWorkflowState_Error.String() @@ -1990,6 +1994,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 From 4056b30e0545636626b18f08a8b1742862785996 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 24 Jan 2024 22:57:43 -0500 Subject: [PATCH 20/35] Migrate materializer unit tests from workflow to tabletmanager Signed-off-by: Matt Lord --- go/vt/vtctl/workflow/materializer_env_test.go | 37 - go/vt/vtctl/workflow/materializer_test.go | 1130 ----------- go/vt/vtctl/workflow/server.go | 5 + .../vttablet/tabletmanager/framework_test.go | 71 +- .../tabletmanager/rpc_vreplication_test.go | 1763 ++++++++++++++++- 5 files changed, 1824 insertions(+), 1182 deletions(-) diff --git a/go/vt/vtctl/workflow/materializer_env_test.go b/go/vt/vtctl/workflow/materializer_env_test.go index 8078918dd81..e841be49f0e 100644 --- a/go/vt/vtctl/workflow/materializer_env_test.go +++ b/go/vt/vtctl/workflow/materializer_env_test.go @@ -21,7 +21,6 @@ import ( "fmt" "os" "regexp" - "strconv" "strings" "sync" "testing" @@ -118,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) @@ -186,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 @@ -198,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 } } @@ -262,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 == "/.*/" { diff --git a/go/vt/vtctl/workflow/materializer_test.go b/go/vt/vtctl/workflow/materializer_test.go index bae84a4ad9c..17b0dc67738 100644 --- a/go/vt/vtctl/workflow/materializer_test.go +++ b/go/vt/vtctl/workflow/materializer_test.go @@ -34,7 +34,6 @@ import ( "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/test/utils" "vitess.io/vitess/go/vt/topo/memorytopo" - "vitess.io/vitess/go/vt/topo/topoproto" "vitess.io/vitess/go/vt/vtgate/vindexes" binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata" @@ -58,30 +57,6 @@ const ( 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/%s|NULL|0|Running|vt_ks|1686577659|0|||1|0|0|0||0|10", binlogSource, position), - ) ) func TestStripForeignKeys(t *testing.T) { @@ -2176,1111 +2151,6 @@ 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()) - defer cancel() - - env := newTestMaterializerEnv(t, ctx, ms, []string{"0"}, []string{"-80", "80-"}) - defer env.close() - - 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", - }}, - }, - }, - } - 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 - }{ - { - 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 := env.topoServ.SaveVSchema(ctx, tcase.request.Keyspace, sourceVschema) - require.NoError(t, err) - err = env.topoServ.RebuildSrvVSchema(ctx, []string{env.cell}) - require.NoError(t, err) - - env.tmc.expectVRQuery(200, mzGetCopyState, &sqltypes.Result{}) - env.tmc.expectVRQuery(200, mzGetLatestCopyState, &sqltypes.Result{}) - - 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 diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index 5b1fabb31ae..1cf03dcd6c7 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -1250,6 +1250,11 @@ func (s *Server) Materialize(ctx context.Context, ms *vtctldatapb.MaterializeSet 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, ","), diff --git a/go/vt/vttablet/tabletmanager/framework_test.go b/go/vt/vttablet/tabletmanager/framework_test.go index fbbd87fb1d4..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 } @@ -460,6 +514,17 @@ func (tmc *fakeTMClient) CreateVReplicationWorkflow(ctx context.Context, tablet 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) } diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go index 276f2215b94..b10906a85f8 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go @@ -25,6 +25,7 @@ import ( "runtime/debug" "strings" "testing" + "time" "github.com/stretchr/testify/require" @@ -34,6 +35,8 @@ import ( "vitess.io/vitess/go/textutil" "vitess.io/vitess/go/vt/binlog/binlogplayer" "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" @@ -46,7 +49,7 @@ import ( topodatapb "vitess.io/vitess/go/vt/proto/topodata" vschemapb "vitess.io/vitess/go/vt/proto/vschema" vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata" - "vitess.io/vitess/go/vt/proto/vttime" + vttimepb "vitess.io/vitess/go/vt/proto/vttime" ) const ( @@ -199,10 +202,10 @@ func TestCreateVReplicationWorkflow(t *testing.T) { // 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(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) - tenv.tmc.tablets[targetTabletUID].vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, targetKs, ""), &sqltypes.Result{}, nil) - tenv.tmc.tablets[targetTabletUID].vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) - tenv.tmc.tablets[targetTabletUID].vrdbClient.ExpectRequest(tt.query, &sqltypes.Result{}, errShortCircuit) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, targetKs, ""), &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) @@ -247,7 +250,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": { @@ -255,7 +258,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": { @@ -275,6 +279,7 @@ func TestMoveTables(t *testing.T) { }, }, }) + require.NoError(t, err) ws := workflow.NewServer(vtenv.NewTestEnv(), tenv.ts, tenv.tmc) @@ -411,7 +416,7 @@ func TestMoveTables(t *testing.T) { Keyspace: targetKs, Workflow: wf, Cells: tenv.cells, - MaxReplicationLagAllowed: &vttime.Duration{Seconds: 922337203}, + MaxReplicationLagAllowed: &vttimepb.Duration{Seconds: 922337203}, EnableReverseReplication: true, InitializeTargetSequences: true, Direction: int32(workflow.DirectionForward), @@ -448,7 +453,7 @@ func TestMoveTables(t *testing.T) { Keyspace: targetKs, Workflow: wf, Cells: tenv.cells, - MaxReplicationLagAllowed: &vttime.Duration{Seconds: 922337203}, + MaxReplicationLagAllowed: &vttimepb.Duration{Seconds: 922337203}, EnableReverseReplication: true, Direction: int32(workflow.DirectionBackward), }) @@ -660,7 +665,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": { @@ -676,7 +681,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": { @@ -692,6 +698,7 @@ func TestSourceShardSelection(t *testing.T) { }, }, }) + require.NoError(t, err) tests := []struct { name string @@ -789,7 +796,8 @@ 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 { @@ -1241,3 +1249,1734 @@ func addInvariants(dbClient *binlogplayer.MockDBClient, vreplID, sourceTabletUID )) 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, targetKs, ""), &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, targetKs, ""), &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, targetKs, ""), &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, targetKs, ""), &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, targetKs, ""), &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, targetKs, ""), &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, targetKs, ""), &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, targetKs, ""), &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, targetKs, ""), &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, targetKs, ""), &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, targetKs, ""), &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, targetKs, ""), &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, targetKs, ""), &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, targetKs, ""), &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, targetKs, ""), &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, targetKs, ""), &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, targetKs, ""), &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, targetKs, ""), &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, targetKs, ""), &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, targetKs, ""), &sqltypes.Result{}, nil) + errs = append(errs, errNoVindex) + } + + err = ws.Materialize(ctx, ms) + require.EqualError(t, err, strings.Join(errs, "\n")) +} From c7baccd4553415040e3cd9ec3e3ede2a93c8891b Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Mon, 5 Feb 2024 21:31:55 -0500 Subject: [PATCH 21/35] Changes after self review Signed-off-by: Matt Lord --- go/vt/vtctl/workflow/resharder.go | 83 ++----------------- go/vt/vtctl/workflow/server.go | 31 ++++--- .../tabletmanager/rpc_vreplication.go | 8 +- 3 files changed, 33 insertions(+), 89 deletions(-) diff --git a/go/vt/vtctl/workflow/resharder.go b/go/vt/vtctl/workflow/resharder.go index 9a4c9fc6a78..b05811bb91f 100644 --- a/go/vt/vtctl/workflow/resharder.go +++ b/go/vt/vtctl/workflow/resharder.go @@ -23,6 +23,7 @@ import ( "sync" "time" + "vitess.io/vitess/go/textutil" "vitess.io/vitess/go/vt/concurrency" "vitess.io/vitess/go/vt/key" "vitess.io/vitess/go/vt/schema" @@ -34,6 +35,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" vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" ) @@ -142,79 +144,6 @@ func (rs *resharder) validateTargets(ctx context.Context) error { return err } -/* -func (rs *resharder) readRefStreams(ctx context.Context) error { - var mu sync.Mutex - 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) - if err != nil { - return vterrors.Wrapf(err, "VReplicationExec(%v, %s)", sourcePrimary.Tablet, query) - } - qr := sqltypes.Proto3ToResult(p3qr) - - mu.Lock() - defer mu.Unlock() - - mustCreate := false - var ref map[string]bool - if rs.refStreams == nil { - rs.refStreams = make(map[string]*refStream) - mustCreate = true - } else { - // Copy the ref streams for comparison. - ref = make(map[string]bool, len(rs.refStreams)) - for k := range rs.refStreams { - ref[k] = true - } - } - for _, row := range qr.Rows { - - workflow := row[0].ToString() - if 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(), - } - } else { - if !ref[refKey] { - return fmt.Errorf("streams are mismatched across source shards for workflow: %s", workflow) - } - delete(ref, refKey) - } - } - if len(ref) != 0 { - return fmt.Errorf("streams are mismatched across source shards: %v", ref) - } - return nil - }) - return err -} -*/ - func (rs *resharder) readRefStreams(ctx context.Context) error { var mu sync.Mutex err := rs.forAll(rs.sourceShards, func(source *topo.ShardInfo) error { @@ -395,11 +324,15 @@ 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. req := &tabletmanagerdatapb.UpdateVReplicationWorkflowRequest{ Workflow: rs.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), } if _, err := rs.s.tmc.UpdateVReplicationWorkflow(ctx, targetPrimary.Tablet, req); err != nil { return vterrors.Wrapf(err, "UpdateVReplicationWorkflow(%v, 'state='%s')", diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index 1cf03dcd6c7..5936050b7c3 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -397,20 +397,20 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows return nil, err } results := make(map[*topo.TabletInfo]*tabletmanagerdatapb.ReadVReplicationWorkflowsResponse, len(shards)) - rctx, rcancel := context.WithTimeout(ctx, topo.RemoteOperationTimeout) + rctx, rcancel := context.WithTimeout(ctx, topo.RemoteOperationTimeout*3) // We use this with all 3 errgroups defer rcancel() - erg, erctx := errgroup.WithContext(rctx) + getTabletsEg, getTabletsCtx := errgroup.WithContext(rctx) for _, shard := range shards { shard := shard // https://golang.org/doc/faq#closures_and_goroutines - erg.Go(func() error { - si, err := s.ts.GetShard(erctx, req.Keyspace, shard) + getTabletsEg.Go(func() error { + si, err := s.ts.GetShard(getTabletsCtx, 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(ctx, si.PrimaryAlias) + primary, err := s.ts.GetTablet(getTabletsCtx, si.PrimaryAlias) if err != nil { return err } @@ -420,7 +420,7 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows // Clone the request so that we can set the correct DB name for tablet. req := readReq.CloneVT() req.DbName = primary.DbName() - wres, err := s.tmc.ReadVReplicationWorkflows(ctx, primary.Tablet, req) + wres, err := s.tmc.ReadVReplicationWorkflows(getTabletsCtx, primary.Tablet, req) if err != nil { return err } @@ -430,7 +430,7 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows return nil }) } - if erg.Wait() != nil { + if getTabletsEg.Wait() != nil { return nil, err } @@ -463,7 +463,7 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows return nil } - fetchCopyStatesEg, fetchCopyStatesCtx := errgroup.WithContext(ctx) + fetchCopyStatesEg, fetchCopyStatesCtx := errgroup.WithContext(rctx) for tablet, result := range results { tablet := tablet // loop closure @@ -664,6 +664,8 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows return nil } + scanWorkflowEg, scanWorkflowCtx := errgroup.WithContext(rctx) + for tablet, result := range results { // 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 @@ -690,12 +692,19 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows targetShardsByWorkflow[workflowName] = sets.New[string]() } - if err := scanWorkflow(ctx, workflow, wfres, tablet); err != nil { - return nil, err - } + // https://golang.org/doc/faq#closures_and_goroutines + wfres := wfres + tablet := tablet + getTabletsEg.Go(func() error { + return scanWorkflow(scanWorkflowCtx, workflow, wfres, tablet) + }) } } + if scanWorkflowEg.Wait() != nil { + return nil, err + } + var ( fetchLogsWG sync.WaitGroup vrepLogQuery = strings.TrimSpace(` diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication.go b/go/vt/vttablet/tabletmanager/rpc_vreplication.go index 13d25e33fc6..0a40da4e82c 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -44,7 +44,8 @@ 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. + // 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" @@ -143,6 +144,7 @@ func (tm *TabletManager) HasVReplicationWorkflows(ctx context.Context, req *tabl 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 } @@ -234,7 +236,7 @@ func (tm *TabletManager) ReadVReplicationWorkflows(ctx context.Context, req *tab return resp, nil } rows := res.Named().Rows - workflows := make(map[string]*tabletmanagerdatapb.ReadVReplicationWorkflowResponse) + workflows := make(map[string]*tabletmanagerdatapb.ReadVReplicationWorkflowResponse, len(rows)) for _, row := range rows { workflow := row["workflow"].ToString() @@ -488,7 +490,7 @@ func (tm *TabletManager) UpdateVReplicationWorkflow(ctx context.Context, req *ta } tabletTypesStr := topoproto.MakeStringTypeCSV(tabletTypes) if (inorder && req.TabletSelectionPreference == tabletmanagerdatapb.TabletSelectionPreference_UNKNOWN) || - req.TabletSelectionPreference == tabletmanagerdatapb.TabletSelectionPreference_INORDER { + (req.TabletSelectionPreference == tabletmanagerdatapb.TabletSelectionPreference_INORDER) { tabletTypesStr = discovery.InOrderHint + tabletTypesStr } if err = prototext.Unmarshal(source, bls); err != nil { From c8b264d38967f15bdc63f15618122501a1820f4d Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Mon, 5 Feb 2024 23:12:04 -0500 Subject: [PATCH 22/35] Re-correct scanWorkflow concurrency Signed-off-by: Matt Lord --- go/vt/vtctl/workflow/server.go | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index 5936050b7c3..7b0c2fb2155 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -397,7 +397,7 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows return nil, err } results := make(map[*topo.TabletInfo]*tabletmanagerdatapb.ReadVReplicationWorkflowsResponse, len(shards)) - rctx, rcancel := context.WithTimeout(ctx, topo.RemoteOperationTimeout*3) // We use this with all 3 errgroups + rctx, rcancel := context.WithTimeout(ctx, topo.RemoteOperationTimeout*2) // We use this with all errgroups defer rcancel() getTabletsEg, getTabletsCtx := errgroup.WithContext(rctx) for _, shard := range shards { @@ -664,8 +664,6 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows return nil } - scanWorkflowEg, scanWorkflowCtx := errgroup.WithContext(rctx) - for tablet, result := range results { // 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 @@ -692,19 +690,12 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows targetShardsByWorkflow[workflowName] = sets.New[string]() } - // https://golang.org/doc/faq#closures_and_goroutines - wfres := wfres - tablet := tablet - getTabletsEg.Go(func() error { - return scanWorkflow(scanWorkflowCtx, workflow, wfres, tablet) - }) + if err := scanWorkflow(ctx, workflow, wfres, tablet); err != nil { + return nil, err + } } } - if scanWorkflowEg.Wait() != nil { - return nil, err - } - var ( fetchLogsWG sync.WaitGroup vrepLogQuery = strings.TrimSpace(` From 47c04f66cfa1b84cd8bcbbd59ddd0cdcec3386d3 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Tue, 6 Feb 2024 06:57:10 -0500 Subject: [PATCH 23/35] Minor tweaks from self review Signed-off-by: Matt Lord --- go/vt/vtctl/workflow/server.go | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index 7b0c2fb2155..8c01e543461 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -397,20 +397,18 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows return nil, err } results := make(map[*topo.TabletInfo]*tabletmanagerdatapb.ReadVReplicationWorkflowsResponse, len(shards)) - rctx, rcancel := context.WithTimeout(ctx, topo.RemoteOperationTimeout*2) // We use this with all errgroups - defer rcancel() - getTabletsEg, getTabletsCtx := errgroup.WithContext(rctx) + readWorkflowsEg, readWorkflowsCtx := errgroup.WithContext(ctx) for _, shard := range shards { shard := shard // https://golang.org/doc/faq#closures_and_goroutines - getTabletsEg.Go(func() error { - si, err := s.ts.GetShard(getTabletsCtx, req.Keyspace, shard) + 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(getTabletsCtx, si.PrimaryAlias) + primary, err := s.ts.GetTablet(readWorkflowsCtx, si.PrimaryAlias) if err != nil { return err } @@ -420,7 +418,7 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows // Clone the request so that we can set the correct DB name for tablet. req := readReq.CloneVT() req.DbName = primary.DbName() - wres, err := s.tmc.ReadVReplicationWorkflows(getTabletsCtx, primary.Tablet, req) + wres, err := s.tmc.ReadVReplicationWorkflows(readWorkflowsCtx, primary.Tablet, req) if err != nil { return err } @@ -430,7 +428,7 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows return nil }) } - if getTabletsEg.Wait() != nil { + if readWorkflowsEg.Wait() != nil { return nil, err } @@ -463,8 +461,7 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows return nil } - fetchCopyStatesEg, fetchCopyStatesCtx := errgroup.WithContext(rctx) - + fetchCopyStatesEg, fetchCopyStatesCtx := errgroup.WithContext(ctx) for tablet, result := range results { tablet := tablet // loop closure From 9162c6f471a6a320a4d5564d517815fcb0f7bae9 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Mon, 12 Feb 2024 16:38:30 -0500 Subject: [PATCH 24/35] Modify stream check to catch unmigrated streams Signed-off-by: Matt Lord --- go/test/endtoend/vreplication/helper_test.go | 14 ++++++++++++-- go/test/endtoend/vreplication/migrate_test.go | 4 ++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/go/test/endtoend/vreplication/helper_test.go b/go/test/endtoend/vreplication/helper_test.go index 54d057fe6e9..b27444fc417 100644 --- a/go/test/endtoend/vreplication/helper_test.go +++ b/go/test/endtoend/vreplication/helper_test.go @@ -568,8 +568,18 @@ 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 { + query = sqlparser.BuildParsedQuery("select count(*) from %s.vreplication where workflow='%s' and state='%s'", + sidecarDBIdentifier, workflow, binlogdatapb.VReplicationWorkflowState_Running.String()).Query + } else { + 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)) } 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", From 9831ee57f9616b60c28a429aa8037122e80a0afe Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Tue, 5 Mar 2024 12:44:58 -0500 Subject: [PATCH 25/35] Add RPC to update the state for multiple workflows and address review comments Signed-off-by: Matt Lord --- .../tabletmanagerdata/tabletmanagerdata.pb.go | 670 +++++++++++------- .../tabletmanagerdata_vtproto.pb.go | 527 ++++++++++++++ .../tabletmanagerservice.pb.go | 378 +++++----- .../tabletmanagerservice_grpc.pb.go | 36 + go/vt/vtcombo/tablet_map.go | 4 + go/vt/vtctl/workflow/resharder.go | 20 +- go/vt/vttablet/faketmclient/fake_client.go | 4 + go/vt/vttablet/grpctmclient/client.go | 13 + go/vt/vttablet/grpctmserver/server.go | 7 + go/vt/vttablet/tabletmanager/rpc_agent.go | 1 + .../tabletmanager/rpc_vreplication.go | 79 +++ .../tabletmanager/rpc_vreplication_test.go | 103 +++ go/vt/vttablet/tmclient/rpc_client_api.go | 1 + go/vt/vttablet/tmrpctest/test_tm_rpc.go | 5 + go/vt/wrangler/switcher.go | 8 +- go/vt/wrangler/switcher_dry_run.go | 6 - go/vt/wrangler/switcher_interface.go | 1 - go/vt/wrangler/traffic_switcher.go | 2 +- proto/tabletmanagerdata.proto | 13 + proto/tabletmanagerservice.proto | 1 + web/vtadmin/src/proto/vtadmin.d.ts | 224 ++++++ web/vtadmin/src/proto/vtadmin.js | 605 ++++++++++++++++ 22 files changed, 2257 insertions(+), 451 deletions(-) diff --git a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go index 8b787e37cdc..3b0d2c00d33 100644 --- a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go +++ b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go @@ -6057,6 +6057,140 @@ func (x *UpdateVReplicationWorkflowResponse) GetResult() *query.QueryResult { return nil } +type UpdateVReplicationWorkflowsStateRequest 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 *UpdateVReplicationWorkflowsStateRequest) Reset() { + *x = UpdateVReplicationWorkflowsStateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_tabletmanagerdata_proto_msgTypes[114] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateVReplicationWorkflowsStateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateVReplicationWorkflowsStateRequest) ProtoMessage() {} + +func (x *UpdateVReplicationWorkflowsStateRequest) 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 UpdateVReplicationWorkflowsStateRequest.ProtoReflect.Descriptor instead. +func (*UpdateVReplicationWorkflowsStateRequest) Descriptor() ([]byte, []int) { + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{114} +} + +func (x *UpdateVReplicationWorkflowsStateRequest) GetAllWorkflows() bool { + if x != nil { + return x.AllWorkflows + } + return false +} + +func (x *UpdateVReplicationWorkflowsStateRequest) GetIncludeWorkflows() []string { + if x != nil { + return x.IncludeWorkflows + } + return nil +} + +func (x *UpdateVReplicationWorkflowsStateRequest) GetExcludeWorkflows() []string { + if x != nil { + return x.ExcludeWorkflows + } + return nil +} + +func (x *UpdateVReplicationWorkflowsStateRequest) GetState() binlogdata.VReplicationWorkflowState { + if x != nil { + return x.State + } + return binlogdata.VReplicationWorkflowState(0) +} + +func (x *UpdateVReplicationWorkflowsStateRequest) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *UpdateVReplicationWorkflowsStateRequest) GetStopPosition() string { + if x != nil { + return x.StopPosition + } + return "" +} + +type UpdateVReplicationWorkflowsStateResponse 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 *UpdateVReplicationWorkflowsStateResponse) Reset() { + *x = UpdateVReplicationWorkflowsStateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_tabletmanagerdata_proto_msgTypes[115] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateVReplicationWorkflowsStateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateVReplicationWorkflowsStateResponse) ProtoMessage() {} + +func (x *UpdateVReplicationWorkflowsStateResponse) 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 UpdateVReplicationWorkflowsStateResponse.ProtoReflect.Descriptor instead. +func (*UpdateVReplicationWorkflowsStateResponse) Descriptor() ([]byte, []int) { + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{115} +} + +func (x *UpdateVReplicationWorkflowsStateResponse) GetResult() *query.QueryResult { + if x != nil { + return x.Result + } + return nil +} + type ResetSequencesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -6068,7 +6202,7 @@ type ResetSequencesRequest struct { func (x *ResetSequencesRequest) Reset() { *x = ResetSequencesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[114] + mi := &file_tabletmanagerdata_proto_msgTypes[116] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6081,7 +6215,7 @@ func (x *ResetSequencesRequest) String() string { func (*ResetSequencesRequest) ProtoMessage() {} func (x *ResetSequencesRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[114] + mi := &file_tabletmanagerdata_proto_msgTypes[116] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6094,7 +6228,7 @@ func (x *ResetSequencesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ResetSequencesRequest.ProtoReflect.Descriptor instead. func (*ResetSequencesRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{114} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{116} } func (x *ResetSequencesRequest) GetTables() []string { @@ -6113,7 +6247,7 @@ type ResetSequencesResponse struct { func (x *ResetSequencesResponse) Reset() { *x = ResetSequencesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[115] + mi := &file_tabletmanagerdata_proto_msgTypes[117] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6126,7 +6260,7 @@ func (x *ResetSequencesResponse) String() string { func (*ResetSequencesResponse) ProtoMessage() {} func (x *ResetSequencesResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[115] + mi := &file_tabletmanagerdata_proto_msgTypes[117] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6139,7 +6273,7 @@ func (x *ResetSequencesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ResetSequencesResponse.ProtoReflect.Descriptor instead. func (*ResetSequencesResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{115} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{117} } type CheckThrottlerRequest struct { @@ -6153,7 +6287,7 @@ type CheckThrottlerRequest struct { func (x *CheckThrottlerRequest) Reset() { *x = CheckThrottlerRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[116] + mi := &file_tabletmanagerdata_proto_msgTypes[118] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6166,7 +6300,7 @@ func (x *CheckThrottlerRequest) String() string { func (*CheckThrottlerRequest) ProtoMessage() {} func (x *CheckThrottlerRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[116] + mi := &file_tabletmanagerdata_proto_msgTypes[118] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6179,7 +6313,7 @@ func (x *CheckThrottlerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckThrottlerRequest.ProtoReflect.Descriptor instead. func (*CheckThrottlerRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{116} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{118} } func (x *CheckThrottlerRequest) GetAppName() string { @@ -6212,7 +6346,7 @@ type CheckThrottlerResponse struct { func (x *CheckThrottlerResponse) Reset() { *x = CheckThrottlerResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[117] + mi := &file_tabletmanagerdata_proto_msgTypes[119] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6225,7 +6359,7 @@ func (x *CheckThrottlerResponse) String() string { func (*CheckThrottlerResponse) ProtoMessage() {} func (x *CheckThrottlerResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[117] + mi := &file_tabletmanagerdata_proto_msgTypes[119] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6238,7 +6372,7 @@ func (x *CheckThrottlerResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckThrottlerResponse.ProtoReflect.Descriptor instead. func (*CheckThrottlerResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{117} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{119} } func (x *CheckThrottlerResponse) GetStatusCode() int32 { @@ -6307,7 +6441,7 @@ type ReadVReplicationWorkflowResponse_Stream struct { func (x *ReadVReplicationWorkflowResponse_Stream) Reset() { *x = ReadVReplicationWorkflowResponse_Stream{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[121] + mi := &file_tabletmanagerdata_proto_msgTypes[123] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6320,7 +6454,7 @@ func (x *ReadVReplicationWorkflowResponse_Stream) String() string { func (*ReadVReplicationWorkflowResponse_Stream) ProtoMessage() {} func (x *ReadVReplicationWorkflowResponse_Stream) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[121] + mi := &file_tabletmanagerdata_proto_msgTypes[123] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7181,35 +7315,59 @@ var file_tabletmanagerdata_proto_rawDesc = []byte{ 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, + 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xa4, 0x02, 0x0a, 0x27, + 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, 0x53, 0x74, 0x61, 0x74, 0x65, + 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, 0x56, 0x0a, 0x28, 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, 0x53, 0x74, 0x61, 0x74, 0x65, 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 ( @@ -7225,223 +7383,227 @@ func file_tabletmanagerdata_proto_rawDescGZIP() []byte { } var file_tabletmanagerdata_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_tabletmanagerdata_proto_msgTypes = make([]protoimpl.MessageInfo, 122) +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 - (*SchemaDefinition)(nil), // 2: tabletmanagerdata.SchemaDefinition - (*SchemaChangeResult)(nil), // 3: tabletmanagerdata.SchemaChangeResult - (*UserPermission)(nil), // 4: tabletmanagerdata.UserPermission - (*DbPermission)(nil), // 5: tabletmanagerdata.DbPermission - (*Permissions)(nil), // 6: tabletmanagerdata.Permissions - (*PingRequest)(nil), // 7: tabletmanagerdata.PingRequest - (*PingResponse)(nil), // 8: tabletmanagerdata.PingResponse - (*SleepRequest)(nil), // 9: tabletmanagerdata.SleepRequest - (*SleepResponse)(nil), // 10: tabletmanagerdata.SleepResponse - (*ExecuteHookRequest)(nil), // 11: tabletmanagerdata.ExecuteHookRequest - (*ExecuteHookResponse)(nil), // 12: tabletmanagerdata.ExecuteHookResponse - (*GetSchemaRequest)(nil), // 13: tabletmanagerdata.GetSchemaRequest - (*GetSchemaResponse)(nil), // 14: tabletmanagerdata.GetSchemaResponse - (*GetPermissionsRequest)(nil), // 15: tabletmanagerdata.GetPermissionsRequest - (*GetPermissionsResponse)(nil), // 16: tabletmanagerdata.GetPermissionsResponse - (*SetReadOnlyRequest)(nil), // 17: tabletmanagerdata.SetReadOnlyRequest - (*SetReadOnlyResponse)(nil), // 18: tabletmanagerdata.SetReadOnlyResponse - (*SetReadWriteRequest)(nil), // 19: tabletmanagerdata.SetReadWriteRequest - (*SetReadWriteResponse)(nil), // 20: tabletmanagerdata.SetReadWriteResponse - (*ChangeTypeRequest)(nil), // 21: tabletmanagerdata.ChangeTypeRequest - (*ChangeTypeResponse)(nil), // 22: tabletmanagerdata.ChangeTypeResponse - (*RefreshStateRequest)(nil), // 23: tabletmanagerdata.RefreshStateRequest - (*RefreshStateResponse)(nil), // 24: tabletmanagerdata.RefreshStateResponse - (*RunHealthCheckRequest)(nil), // 25: tabletmanagerdata.RunHealthCheckRequest - (*RunHealthCheckResponse)(nil), // 26: tabletmanagerdata.RunHealthCheckResponse - (*ReloadSchemaRequest)(nil), // 27: tabletmanagerdata.ReloadSchemaRequest - (*ReloadSchemaResponse)(nil), // 28: tabletmanagerdata.ReloadSchemaResponse - (*PreflightSchemaRequest)(nil), // 29: tabletmanagerdata.PreflightSchemaRequest - (*PreflightSchemaResponse)(nil), // 30: tabletmanagerdata.PreflightSchemaResponse - (*ApplySchemaRequest)(nil), // 31: tabletmanagerdata.ApplySchemaRequest - (*ApplySchemaResponse)(nil), // 32: tabletmanagerdata.ApplySchemaResponse - (*LockTablesRequest)(nil), // 33: tabletmanagerdata.LockTablesRequest - (*LockTablesResponse)(nil), // 34: tabletmanagerdata.LockTablesResponse - (*UnlockTablesRequest)(nil), // 35: tabletmanagerdata.UnlockTablesRequest - (*UnlockTablesResponse)(nil), // 36: tabletmanagerdata.UnlockTablesResponse - (*ExecuteQueryRequest)(nil), // 37: tabletmanagerdata.ExecuteQueryRequest - (*ExecuteQueryResponse)(nil), // 38: tabletmanagerdata.ExecuteQueryResponse - (*ExecuteFetchAsDbaRequest)(nil), // 39: tabletmanagerdata.ExecuteFetchAsDbaRequest - (*ExecuteFetchAsDbaResponse)(nil), // 40: tabletmanagerdata.ExecuteFetchAsDbaResponse - (*ExecuteFetchAsAllPrivsRequest)(nil), // 41: tabletmanagerdata.ExecuteFetchAsAllPrivsRequest - (*ExecuteFetchAsAllPrivsResponse)(nil), // 42: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse - (*ExecuteFetchAsAppRequest)(nil), // 43: tabletmanagerdata.ExecuteFetchAsAppRequest - (*ExecuteFetchAsAppResponse)(nil), // 44: tabletmanagerdata.ExecuteFetchAsAppResponse - (*ReplicationStatusRequest)(nil), // 45: tabletmanagerdata.ReplicationStatusRequest - (*ReplicationStatusResponse)(nil), // 46: tabletmanagerdata.ReplicationStatusResponse - (*PrimaryStatusRequest)(nil), // 47: tabletmanagerdata.PrimaryStatusRequest - (*PrimaryStatusResponse)(nil), // 48: tabletmanagerdata.PrimaryStatusResponse - (*PrimaryPositionRequest)(nil), // 49: tabletmanagerdata.PrimaryPositionRequest - (*PrimaryPositionResponse)(nil), // 50: tabletmanagerdata.PrimaryPositionResponse - (*WaitForPositionRequest)(nil), // 51: tabletmanagerdata.WaitForPositionRequest - (*WaitForPositionResponse)(nil), // 52: tabletmanagerdata.WaitForPositionResponse - (*StopReplicationRequest)(nil), // 53: tabletmanagerdata.StopReplicationRequest - (*StopReplicationResponse)(nil), // 54: tabletmanagerdata.StopReplicationResponse - (*StopReplicationMinimumRequest)(nil), // 55: tabletmanagerdata.StopReplicationMinimumRequest - (*StopReplicationMinimumResponse)(nil), // 56: tabletmanagerdata.StopReplicationMinimumResponse - (*StartReplicationRequest)(nil), // 57: tabletmanagerdata.StartReplicationRequest - (*StartReplicationResponse)(nil), // 58: tabletmanagerdata.StartReplicationResponse - (*StartReplicationUntilAfterRequest)(nil), // 59: tabletmanagerdata.StartReplicationUntilAfterRequest - (*StartReplicationUntilAfterResponse)(nil), // 60: tabletmanagerdata.StartReplicationUntilAfterResponse - (*GetReplicasRequest)(nil), // 61: tabletmanagerdata.GetReplicasRequest - (*GetReplicasResponse)(nil), // 62: tabletmanagerdata.GetReplicasResponse - (*ResetReplicationRequest)(nil), // 63: tabletmanagerdata.ResetReplicationRequest - (*ResetReplicationResponse)(nil), // 64: tabletmanagerdata.ResetReplicationResponse - (*VReplicationExecRequest)(nil), // 65: tabletmanagerdata.VReplicationExecRequest - (*VReplicationExecResponse)(nil), // 66: tabletmanagerdata.VReplicationExecResponse - (*VReplicationWaitForPosRequest)(nil), // 67: tabletmanagerdata.VReplicationWaitForPosRequest - (*VReplicationWaitForPosResponse)(nil), // 68: tabletmanagerdata.VReplicationWaitForPosResponse - (*InitPrimaryRequest)(nil), // 69: tabletmanagerdata.InitPrimaryRequest - (*InitPrimaryResponse)(nil), // 70: tabletmanagerdata.InitPrimaryResponse - (*PopulateReparentJournalRequest)(nil), // 71: tabletmanagerdata.PopulateReparentJournalRequest - (*PopulateReparentJournalResponse)(nil), // 72: tabletmanagerdata.PopulateReparentJournalResponse - (*InitReplicaRequest)(nil), // 73: tabletmanagerdata.InitReplicaRequest - (*InitReplicaResponse)(nil), // 74: tabletmanagerdata.InitReplicaResponse - (*DemotePrimaryRequest)(nil), // 75: tabletmanagerdata.DemotePrimaryRequest - (*DemotePrimaryResponse)(nil), // 76: tabletmanagerdata.DemotePrimaryResponse - (*UndoDemotePrimaryRequest)(nil), // 77: tabletmanagerdata.UndoDemotePrimaryRequest - (*UndoDemotePrimaryResponse)(nil), // 78: tabletmanagerdata.UndoDemotePrimaryResponse - (*ReplicaWasPromotedRequest)(nil), // 79: tabletmanagerdata.ReplicaWasPromotedRequest - (*ReplicaWasPromotedResponse)(nil), // 80: tabletmanagerdata.ReplicaWasPromotedResponse - (*ResetReplicationParametersRequest)(nil), // 81: tabletmanagerdata.ResetReplicationParametersRequest - (*ResetReplicationParametersResponse)(nil), // 82: tabletmanagerdata.ResetReplicationParametersResponse - (*FullStatusRequest)(nil), // 83: tabletmanagerdata.FullStatusRequest - (*FullStatusResponse)(nil), // 84: tabletmanagerdata.FullStatusResponse - (*SetReplicationSourceRequest)(nil), // 85: tabletmanagerdata.SetReplicationSourceRequest - (*SetReplicationSourceResponse)(nil), // 86: tabletmanagerdata.SetReplicationSourceResponse - (*ReplicaWasRestartedRequest)(nil), // 87: tabletmanagerdata.ReplicaWasRestartedRequest - (*ReplicaWasRestartedResponse)(nil), // 88: tabletmanagerdata.ReplicaWasRestartedResponse - (*StopReplicationAndGetStatusRequest)(nil), // 89: tabletmanagerdata.StopReplicationAndGetStatusRequest - (*StopReplicationAndGetStatusResponse)(nil), // 90: tabletmanagerdata.StopReplicationAndGetStatusResponse - (*PromoteReplicaRequest)(nil), // 91: tabletmanagerdata.PromoteReplicaRequest - (*PromoteReplicaResponse)(nil), // 92: tabletmanagerdata.PromoteReplicaResponse - (*BackupRequest)(nil), // 93: tabletmanagerdata.BackupRequest - (*BackupResponse)(nil), // 94: tabletmanagerdata.BackupResponse - (*RestoreFromBackupRequest)(nil), // 95: tabletmanagerdata.RestoreFromBackupRequest - (*RestoreFromBackupResponse)(nil), // 96: tabletmanagerdata.RestoreFromBackupResponse - (*CreateVReplicationWorkflowRequest)(nil), // 97: tabletmanagerdata.CreateVReplicationWorkflowRequest - (*CreateVReplicationWorkflowResponse)(nil), // 98: tabletmanagerdata.CreateVReplicationWorkflowResponse - (*DeleteVReplicationWorkflowRequest)(nil), // 99: tabletmanagerdata.DeleteVReplicationWorkflowRequest - (*DeleteVReplicationWorkflowResponse)(nil), // 100: tabletmanagerdata.DeleteVReplicationWorkflowResponse - (*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 - (*ResetSequencesRequest)(nil), // 115: tabletmanagerdata.ResetSequencesRequest - (*ResetSequencesResponse)(nil), // 116: tabletmanagerdata.ResetSequencesResponse - (*CheckThrottlerRequest)(nil), // 117: tabletmanagerdata.CheckThrottlerRequest - (*CheckThrottlerResponse)(nil), // 118: tabletmanagerdata.CheckThrottlerResponse - nil, // 119: tabletmanagerdata.UserPermission.PrivilegesEntry - nil, // 120: tabletmanagerdata.DbPermission.PrivilegesEntry - nil, // 121: tabletmanagerdata.ExecuteHookRequest.ExtraEnvEntry - (*ReadVReplicationWorkflowResponse_Stream)(nil), // 122: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - (*query.Field)(nil), // 123: query.Field - (topodata.TabletType)(0), // 124: topodata.TabletType - (*vtrpc.CallerID)(nil), // 125: vtrpc.CallerID - (*query.QueryResult)(nil), // 126: query.QueryResult - (*replicationdata.Status)(nil), // 127: replicationdata.Status - (*replicationdata.PrimaryStatus)(nil), // 128: replicationdata.PrimaryStatus - (*topodata.TabletAlias)(nil), // 129: topodata.TabletAlias - (*replicationdata.FullStatus)(nil), // 130: replicationdata.FullStatus - (replicationdata.StopReplicationMode)(0), // 131: replicationdata.StopReplicationMode - (*replicationdata.StopReplicationStatus)(nil), // 132: replicationdata.StopReplicationStatus - (*logutil.Event)(nil), // 133: logutil.Event - (*vttime.Time)(nil), // 134: vttime.Time - (*binlogdata.BinlogSource)(nil), // 135: binlogdata.BinlogSource - (binlogdata.VReplicationWorkflowType)(0), // 136: binlogdata.VReplicationWorkflowType - (binlogdata.VReplicationWorkflowSubType)(0), // 137: binlogdata.VReplicationWorkflowSubType - (binlogdata.VReplicationWorkflowState)(0), // 138: binlogdata.VReplicationWorkflowState - (binlogdata.OnDDLAction)(0), // 139: binlogdata.OnDDLAction + (TabletSelectionPreference)(0), // 0: tabletmanagerdata.TabletSelectionPreference + (*TableDefinition)(nil), // 1: tabletmanagerdata.TableDefinition + (*SchemaDefinition)(nil), // 2: tabletmanagerdata.SchemaDefinition + (*SchemaChangeResult)(nil), // 3: tabletmanagerdata.SchemaChangeResult + (*UserPermission)(nil), // 4: tabletmanagerdata.UserPermission + (*DbPermission)(nil), // 5: tabletmanagerdata.DbPermission + (*Permissions)(nil), // 6: tabletmanagerdata.Permissions + (*PingRequest)(nil), // 7: tabletmanagerdata.PingRequest + (*PingResponse)(nil), // 8: tabletmanagerdata.PingResponse + (*SleepRequest)(nil), // 9: tabletmanagerdata.SleepRequest + (*SleepResponse)(nil), // 10: tabletmanagerdata.SleepResponse + (*ExecuteHookRequest)(nil), // 11: tabletmanagerdata.ExecuteHookRequest + (*ExecuteHookResponse)(nil), // 12: tabletmanagerdata.ExecuteHookResponse + (*GetSchemaRequest)(nil), // 13: tabletmanagerdata.GetSchemaRequest + (*GetSchemaResponse)(nil), // 14: tabletmanagerdata.GetSchemaResponse + (*GetPermissionsRequest)(nil), // 15: tabletmanagerdata.GetPermissionsRequest + (*GetPermissionsResponse)(nil), // 16: tabletmanagerdata.GetPermissionsResponse + (*SetReadOnlyRequest)(nil), // 17: tabletmanagerdata.SetReadOnlyRequest + (*SetReadOnlyResponse)(nil), // 18: tabletmanagerdata.SetReadOnlyResponse + (*SetReadWriteRequest)(nil), // 19: tabletmanagerdata.SetReadWriteRequest + (*SetReadWriteResponse)(nil), // 20: tabletmanagerdata.SetReadWriteResponse + (*ChangeTypeRequest)(nil), // 21: tabletmanagerdata.ChangeTypeRequest + (*ChangeTypeResponse)(nil), // 22: tabletmanagerdata.ChangeTypeResponse + (*RefreshStateRequest)(nil), // 23: tabletmanagerdata.RefreshStateRequest + (*RefreshStateResponse)(nil), // 24: tabletmanagerdata.RefreshStateResponse + (*RunHealthCheckRequest)(nil), // 25: tabletmanagerdata.RunHealthCheckRequest + (*RunHealthCheckResponse)(nil), // 26: tabletmanagerdata.RunHealthCheckResponse + (*ReloadSchemaRequest)(nil), // 27: tabletmanagerdata.ReloadSchemaRequest + (*ReloadSchemaResponse)(nil), // 28: tabletmanagerdata.ReloadSchemaResponse + (*PreflightSchemaRequest)(nil), // 29: tabletmanagerdata.PreflightSchemaRequest + (*PreflightSchemaResponse)(nil), // 30: tabletmanagerdata.PreflightSchemaResponse + (*ApplySchemaRequest)(nil), // 31: tabletmanagerdata.ApplySchemaRequest + (*ApplySchemaResponse)(nil), // 32: tabletmanagerdata.ApplySchemaResponse + (*LockTablesRequest)(nil), // 33: tabletmanagerdata.LockTablesRequest + (*LockTablesResponse)(nil), // 34: tabletmanagerdata.LockTablesResponse + (*UnlockTablesRequest)(nil), // 35: tabletmanagerdata.UnlockTablesRequest + (*UnlockTablesResponse)(nil), // 36: tabletmanagerdata.UnlockTablesResponse + (*ExecuteQueryRequest)(nil), // 37: tabletmanagerdata.ExecuteQueryRequest + (*ExecuteQueryResponse)(nil), // 38: tabletmanagerdata.ExecuteQueryResponse + (*ExecuteFetchAsDbaRequest)(nil), // 39: tabletmanagerdata.ExecuteFetchAsDbaRequest + (*ExecuteFetchAsDbaResponse)(nil), // 40: tabletmanagerdata.ExecuteFetchAsDbaResponse + (*ExecuteFetchAsAllPrivsRequest)(nil), // 41: tabletmanagerdata.ExecuteFetchAsAllPrivsRequest + (*ExecuteFetchAsAllPrivsResponse)(nil), // 42: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse + (*ExecuteFetchAsAppRequest)(nil), // 43: tabletmanagerdata.ExecuteFetchAsAppRequest + (*ExecuteFetchAsAppResponse)(nil), // 44: tabletmanagerdata.ExecuteFetchAsAppResponse + (*ReplicationStatusRequest)(nil), // 45: tabletmanagerdata.ReplicationStatusRequest + (*ReplicationStatusResponse)(nil), // 46: tabletmanagerdata.ReplicationStatusResponse + (*PrimaryStatusRequest)(nil), // 47: tabletmanagerdata.PrimaryStatusRequest + (*PrimaryStatusResponse)(nil), // 48: tabletmanagerdata.PrimaryStatusResponse + (*PrimaryPositionRequest)(nil), // 49: tabletmanagerdata.PrimaryPositionRequest + (*PrimaryPositionResponse)(nil), // 50: tabletmanagerdata.PrimaryPositionResponse + (*WaitForPositionRequest)(nil), // 51: tabletmanagerdata.WaitForPositionRequest + (*WaitForPositionResponse)(nil), // 52: tabletmanagerdata.WaitForPositionResponse + (*StopReplicationRequest)(nil), // 53: tabletmanagerdata.StopReplicationRequest + (*StopReplicationResponse)(nil), // 54: tabletmanagerdata.StopReplicationResponse + (*StopReplicationMinimumRequest)(nil), // 55: tabletmanagerdata.StopReplicationMinimumRequest + (*StopReplicationMinimumResponse)(nil), // 56: tabletmanagerdata.StopReplicationMinimumResponse + (*StartReplicationRequest)(nil), // 57: tabletmanagerdata.StartReplicationRequest + (*StartReplicationResponse)(nil), // 58: tabletmanagerdata.StartReplicationResponse + (*StartReplicationUntilAfterRequest)(nil), // 59: tabletmanagerdata.StartReplicationUntilAfterRequest + (*StartReplicationUntilAfterResponse)(nil), // 60: tabletmanagerdata.StartReplicationUntilAfterResponse + (*GetReplicasRequest)(nil), // 61: tabletmanagerdata.GetReplicasRequest + (*GetReplicasResponse)(nil), // 62: tabletmanagerdata.GetReplicasResponse + (*ResetReplicationRequest)(nil), // 63: tabletmanagerdata.ResetReplicationRequest + (*ResetReplicationResponse)(nil), // 64: tabletmanagerdata.ResetReplicationResponse + (*VReplicationExecRequest)(nil), // 65: tabletmanagerdata.VReplicationExecRequest + (*VReplicationExecResponse)(nil), // 66: tabletmanagerdata.VReplicationExecResponse + (*VReplicationWaitForPosRequest)(nil), // 67: tabletmanagerdata.VReplicationWaitForPosRequest + (*VReplicationWaitForPosResponse)(nil), // 68: tabletmanagerdata.VReplicationWaitForPosResponse + (*InitPrimaryRequest)(nil), // 69: tabletmanagerdata.InitPrimaryRequest + (*InitPrimaryResponse)(nil), // 70: tabletmanagerdata.InitPrimaryResponse + (*PopulateReparentJournalRequest)(nil), // 71: tabletmanagerdata.PopulateReparentJournalRequest + (*PopulateReparentJournalResponse)(nil), // 72: tabletmanagerdata.PopulateReparentJournalResponse + (*InitReplicaRequest)(nil), // 73: tabletmanagerdata.InitReplicaRequest + (*InitReplicaResponse)(nil), // 74: tabletmanagerdata.InitReplicaResponse + (*DemotePrimaryRequest)(nil), // 75: tabletmanagerdata.DemotePrimaryRequest + (*DemotePrimaryResponse)(nil), // 76: tabletmanagerdata.DemotePrimaryResponse + (*UndoDemotePrimaryRequest)(nil), // 77: tabletmanagerdata.UndoDemotePrimaryRequest + (*UndoDemotePrimaryResponse)(nil), // 78: tabletmanagerdata.UndoDemotePrimaryResponse + (*ReplicaWasPromotedRequest)(nil), // 79: tabletmanagerdata.ReplicaWasPromotedRequest + (*ReplicaWasPromotedResponse)(nil), // 80: tabletmanagerdata.ReplicaWasPromotedResponse + (*ResetReplicationParametersRequest)(nil), // 81: tabletmanagerdata.ResetReplicationParametersRequest + (*ResetReplicationParametersResponse)(nil), // 82: tabletmanagerdata.ResetReplicationParametersResponse + (*FullStatusRequest)(nil), // 83: tabletmanagerdata.FullStatusRequest + (*FullStatusResponse)(nil), // 84: tabletmanagerdata.FullStatusResponse + (*SetReplicationSourceRequest)(nil), // 85: tabletmanagerdata.SetReplicationSourceRequest + (*SetReplicationSourceResponse)(nil), // 86: tabletmanagerdata.SetReplicationSourceResponse + (*ReplicaWasRestartedRequest)(nil), // 87: tabletmanagerdata.ReplicaWasRestartedRequest + (*ReplicaWasRestartedResponse)(nil), // 88: tabletmanagerdata.ReplicaWasRestartedResponse + (*StopReplicationAndGetStatusRequest)(nil), // 89: tabletmanagerdata.StopReplicationAndGetStatusRequest + (*StopReplicationAndGetStatusResponse)(nil), // 90: tabletmanagerdata.StopReplicationAndGetStatusResponse + (*PromoteReplicaRequest)(nil), // 91: tabletmanagerdata.PromoteReplicaRequest + (*PromoteReplicaResponse)(nil), // 92: tabletmanagerdata.PromoteReplicaResponse + (*BackupRequest)(nil), // 93: tabletmanagerdata.BackupRequest + (*BackupResponse)(nil), // 94: tabletmanagerdata.BackupResponse + (*RestoreFromBackupRequest)(nil), // 95: tabletmanagerdata.RestoreFromBackupRequest + (*RestoreFromBackupResponse)(nil), // 96: tabletmanagerdata.RestoreFromBackupResponse + (*CreateVReplicationWorkflowRequest)(nil), // 97: tabletmanagerdata.CreateVReplicationWorkflowRequest + (*CreateVReplicationWorkflowResponse)(nil), // 98: tabletmanagerdata.CreateVReplicationWorkflowResponse + (*DeleteVReplicationWorkflowRequest)(nil), // 99: tabletmanagerdata.DeleteVReplicationWorkflowRequest + (*DeleteVReplicationWorkflowResponse)(nil), // 100: tabletmanagerdata.DeleteVReplicationWorkflowResponse + (*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 + (*UpdateVReplicationWorkflowsStateRequest)(nil), // 115: tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + (*UpdateVReplicationWorkflowsStateResponse)(nil), // 116: tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + (*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{ - 123, // 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 - 119, // 4: tabletmanagerdata.UserPermission.privileges:type_name -> tabletmanagerdata.UserPermission.PrivilegesEntry - 120, // 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 - 121, // 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 - 124, // 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 - 125, // 17: tabletmanagerdata.ExecuteQueryRequest.caller_id:type_name -> vtrpc.CallerID - 126, // 18: tabletmanagerdata.ExecuteQueryResponse.result:type_name -> query.QueryResult - 126, // 19: tabletmanagerdata.ExecuteFetchAsDbaResponse.result:type_name -> query.QueryResult - 126, // 20: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse.result:type_name -> query.QueryResult - 126, // 21: tabletmanagerdata.ExecuteFetchAsAppResponse.result:type_name -> query.QueryResult - 127, // 22: tabletmanagerdata.ReplicationStatusResponse.status:type_name -> replicationdata.Status - 128, // 23: tabletmanagerdata.PrimaryStatusResponse.status:type_name -> replicationdata.PrimaryStatus - 126, // 24: tabletmanagerdata.VReplicationExecResponse.result:type_name -> query.QueryResult - 129, // 25: tabletmanagerdata.PopulateReparentJournalRequest.primary_alias:type_name -> topodata.TabletAlias - 129, // 26: tabletmanagerdata.InitReplicaRequest.parent:type_name -> topodata.TabletAlias - 128, // 27: tabletmanagerdata.DemotePrimaryResponse.primary_status:type_name -> replicationdata.PrimaryStatus - 130, // 28: tabletmanagerdata.FullStatusResponse.status:type_name -> replicationdata.FullStatus - 129, // 29: tabletmanagerdata.SetReplicationSourceRequest.parent:type_name -> topodata.TabletAlias - 129, // 30: tabletmanagerdata.ReplicaWasRestartedRequest.parent:type_name -> topodata.TabletAlias - 131, // 31: tabletmanagerdata.StopReplicationAndGetStatusRequest.stop_replication_mode:type_name -> replicationdata.StopReplicationMode - 132, // 32: tabletmanagerdata.StopReplicationAndGetStatusResponse.status:type_name -> replicationdata.StopReplicationStatus - 133, // 33: tabletmanagerdata.BackupResponse.event:type_name -> logutil.Event - 134, // 34: tabletmanagerdata.RestoreFromBackupRequest.backup_time:type_name -> vttime.Time - 134, // 35: tabletmanagerdata.RestoreFromBackupRequest.restore_to_timestamp:type_name -> vttime.Time - 133, // 36: tabletmanagerdata.RestoreFromBackupResponse.event:type_name -> logutil.Event - 135, // 37: tabletmanagerdata.CreateVReplicationWorkflowRequest.binlog_source:type_name -> binlogdata.BinlogSource - 124, // 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 - 136, // 40: tabletmanagerdata.CreateVReplicationWorkflowRequest.workflow_type:type_name -> binlogdata.VReplicationWorkflowType - 137, // 41: tabletmanagerdata.CreateVReplicationWorkflowRequest.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType - 126, // 42: tabletmanagerdata.CreateVReplicationWorkflowResponse.result:type_name -> query.QueryResult - 126, // 43: tabletmanagerdata.DeleteVReplicationWorkflowResponse.result:type_name -> query.QueryResult - 138, // 44: tabletmanagerdata.ReadVReplicationWorkflowsRequest.include_states:type_name -> binlogdata.VReplicationWorkflowState - 138, // 45: tabletmanagerdata.ReadVReplicationWorkflowsRequest.exclude_states:type_name -> binlogdata.VReplicationWorkflowState + 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 - 124, // 47: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_types:type_name -> topodata.TabletType + 126, // 47: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_types:type_name -> topodata.TabletType 0, // 48: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 136, // 49: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_type:type_name -> binlogdata.VReplicationWorkflowType - 137, // 50: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType - 122, // 51: tabletmanagerdata.ReadVReplicationWorkflowResponse.streams:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + 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 - 126, // 53: tabletmanagerdata.VDiffResponse.output:type_name -> query.QueryResult + 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 - 124, // 57: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_types:type_name -> topodata.TabletType + 126, // 57: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_types:type_name -> topodata.TabletType 0, // 58: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 139, // 59: tabletmanagerdata.UpdateVReplicationWorkflowRequest.on_ddl:type_name -> binlogdata.OnDDLAction - 138, // 60: tabletmanagerdata.UpdateVReplicationWorkflowRequest.state:type_name -> binlogdata.VReplicationWorkflowState - 126, // 61: tabletmanagerdata.UpdateVReplicationWorkflowResponse.result:type_name -> query.QueryResult - 135, // 62: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.bls:type_name -> binlogdata.BinlogSource - 134, // 63: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_updated:type_name -> vttime.Time - 134, // 64: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.transaction_timestamp:type_name -> vttime.Time - 138, // 65: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.state:type_name -> binlogdata.VReplicationWorkflowState - 134, // 66: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_heartbeat:type_name -> vttime.Time - 134, // 67: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_throttled:type_name -> vttime.Time - 68, // [68:68] is the sub-list for method output_type - 68, // [68:68] is the sub-list for method input_type - 68, // [68:68] is the sub-list for extension type_name - 68, // [68:68] is the sub-list for extension extendee - 0, // [0:68] is the sub-list for field type_name + 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.UpdateVReplicationWorkflowsStateRequest.state:type_name -> binlogdata.VReplicationWorkflowState + 128, // 63: tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse.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() } @@ -8819,7 +8981,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[114].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResetSequencesRequest); i { + switch v := v.(*UpdateVReplicationWorkflowsStateRequest); i { case 0: return &v.state case 1: @@ -8831,7 +8993,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[115].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResetSequencesResponse); i { + switch v := v.(*UpdateVReplicationWorkflowsStateResponse); i { case 0: return &v.state case 1: @@ -8843,7 +9005,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[116].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CheckThrottlerRequest); i { + switch v := v.(*ResetSequencesRequest); i { case 0: return &v.state case 1: @@ -8855,6 +9017,30 @@ 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 @@ -8866,7 +9052,7 @@ func file_tabletmanagerdata_proto_init() { return nil } } - file_tabletmanagerdata_proto_msgTypes[121].Exporter = func(v interface{}, i int) interface{} { + file_tabletmanagerdata_proto_msgTypes[123].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReadVReplicationWorkflowResponse_Stream); i { case 0: return &v.state @@ -8885,7 +9071,7 @@ func file_tabletmanagerdata_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_tabletmanagerdata_proto_rawDesc, NumEnums: 1, - NumMessages: 122, + 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 bba88e1cffd..d675093d09d 100644 --- a/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go +++ b/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go @@ -2295,6 +2295,55 @@ func (m *UpdateVReplicationWorkflowResponse) CloneMessageVT() proto.Message { return m.CloneVT() } +func (m *UpdateVReplicationWorkflowsStateRequest) CloneVT() *UpdateVReplicationWorkflowsStateRequest { + if m == nil { + return (*UpdateVReplicationWorkflowsStateRequest)(nil) + } + r := &UpdateVReplicationWorkflowsStateRequest{ + 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 *UpdateVReplicationWorkflowsStateRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *UpdateVReplicationWorkflowsStateResponse) CloneVT() *UpdateVReplicationWorkflowsStateResponse { + if m == nil { + return (*UpdateVReplicationWorkflowsStateResponse)(nil) + } + r := &UpdateVReplicationWorkflowsStateResponse{ + 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 *UpdateVReplicationWorkflowsStateResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + func (m *ResetSequencesRequest) CloneVT() *ResetSequencesRequest { if m == nil { return (*ResetSequencesRequest)(nil) @@ -7893,6 +7942,129 @@ func (m *UpdateVReplicationWorkflowResponse) MarshalToSizedBufferVT(dAtA []byte) return len(dAtA) - i, nil } +func (m *UpdateVReplicationWorkflowsStateRequest) 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 *UpdateVReplicationWorkflowsStateRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UpdateVReplicationWorkflowsStateRequest) 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.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 *UpdateVReplicationWorkflowsStateResponse) 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 *UpdateVReplicationWorkflowsStateResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UpdateVReplicationWorkflowsStateResponse) 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 @@ -10052,6 +10224,56 @@ func (m *UpdateVReplicationWorkflowResponse) SizeVT() (n int) { return n } +func (m *UpdateVReplicationWorkflowsStateRequest) 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 *UpdateVReplicationWorkflowsStateResponse) 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 @@ -22287,6 +22509,311 @@ func (m *UpdateVReplicationWorkflowResponse) UnmarshalVT(dAtA []byte) error { } return nil } +func (m *UpdateVReplicationWorkflowsStateRequest) 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: UpdateVReplicationWorkflowsStateRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateVReplicationWorkflowsStateRequest: 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 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 != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExcludeWorkflows", 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.ExcludeWorkflows = append(m.ExcludeWorkflows, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + 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 + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", 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.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StopPosition", 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.StopPosition = 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 *UpdateVReplicationWorkflowsStateResponse) 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: UpdateVReplicationWorkflowsStateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateVReplicationWorkflowsStateResponse: 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 *ResetSequencesRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/go/vt/proto/tabletmanagerservice/tabletmanagerservice.pb.go b/go/vt/proto/tabletmanagerservice/tabletmanagerservice.pb.go index b275dd36e88..96680d69daa 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, 0xdd, 0x2e, 0x0a, 0x0d, + 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xfd, 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, @@ -302,6 +302,16 @@ var file_tabletmanagerservice_proto_rawDesc = []byte{ 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, 0x9d, 0x01, 0x0a, 0x20, 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, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3a, 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, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3b, 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, 0x53, 0x74, 0x61, 0x74, 0x65, 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, @@ -427,114 +437,116 @@ var file_tabletmanagerservice_proto_rawDesc = []byte{ } var file_tabletmanagerservice_proto_goTypes = []interface{}{ - (*tabletmanagerdata.PingRequest)(nil), // 0: tabletmanagerdata.PingRequest - (*tabletmanagerdata.SleepRequest)(nil), // 1: tabletmanagerdata.SleepRequest - (*tabletmanagerdata.ExecuteHookRequest)(nil), // 2: tabletmanagerdata.ExecuteHookRequest - (*tabletmanagerdata.GetSchemaRequest)(nil), // 3: tabletmanagerdata.GetSchemaRequest - (*tabletmanagerdata.GetPermissionsRequest)(nil), // 4: tabletmanagerdata.GetPermissionsRequest - (*tabletmanagerdata.SetReadOnlyRequest)(nil), // 5: tabletmanagerdata.SetReadOnlyRequest - (*tabletmanagerdata.SetReadWriteRequest)(nil), // 6: tabletmanagerdata.SetReadWriteRequest - (*tabletmanagerdata.ChangeTypeRequest)(nil), // 7: tabletmanagerdata.ChangeTypeRequest - (*tabletmanagerdata.RefreshStateRequest)(nil), // 8: tabletmanagerdata.RefreshStateRequest - (*tabletmanagerdata.RunHealthCheckRequest)(nil), // 9: tabletmanagerdata.RunHealthCheckRequest - (*tabletmanagerdata.ReloadSchemaRequest)(nil), // 10: tabletmanagerdata.ReloadSchemaRequest - (*tabletmanagerdata.PreflightSchemaRequest)(nil), // 11: tabletmanagerdata.PreflightSchemaRequest - (*tabletmanagerdata.ApplySchemaRequest)(nil), // 12: tabletmanagerdata.ApplySchemaRequest - (*tabletmanagerdata.ResetSequencesRequest)(nil), // 13: tabletmanagerdata.ResetSequencesRequest - (*tabletmanagerdata.LockTablesRequest)(nil), // 14: tabletmanagerdata.LockTablesRequest - (*tabletmanagerdata.UnlockTablesRequest)(nil), // 15: tabletmanagerdata.UnlockTablesRequest - (*tabletmanagerdata.ExecuteQueryRequest)(nil), // 16: tabletmanagerdata.ExecuteQueryRequest - (*tabletmanagerdata.ExecuteFetchAsDbaRequest)(nil), // 17: tabletmanagerdata.ExecuteFetchAsDbaRequest - (*tabletmanagerdata.ExecuteFetchAsAllPrivsRequest)(nil), // 18: tabletmanagerdata.ExecuteFetchAsAllPrivsRequest - (*tabletmanagerdata.ExecuteFetchAsAppRequest)(nil), // 19: tabletmanagerdata.ExecuteFetchAsAppRequest - (*tabletmanagerdata.ReplicationStatusRequest)(nil), // 20: tabletmanagerdata.ReplicationStatusRequest - (*tabletmanagerdata.PrimaryStatusRequest)(nil), // 21: tabletmanagerdata.PrimaryStatusRequest - (*tabletmanagerdata.PrimaryPositionRequest)(nil), // 22: tabletmanagerdata.PrimaryPositionRequest - (*tabletmanagerdata.WaitForPositionRequest)(nil), // 23: tabletmanagerdata.WaitForPositionRequest - (*tabletmanagerdata.StopReplicationRequest)(nil), // 24: tabletmanagerdata.StopReplicationRequest - (*tabletmanagerdata.StopReplicationMinimumRequest)(nil), // 25: tabletmanagerdata.StopReplicationMinimumRequest - (*tabletmanagerdata.StartReplicationRequest)(nil), // 26: tabletmanagerdata.StartReplicationRequest - (*tabletmanagerdata.StartReplicationUntilAfterRequest)(nil), // 27: tabletmanagerdata.StartReplicationUntilAfterRequest - (*tabletmanagerdata.GetReplicasRequest)(nil), // 28: tabletmanagerdata.GetReplicasRequest - (*tabletmanagerdata.CreateVReplicationWorkflowRequest)(nil), // 29: tabletmanagerdata.CreateVReplicationWorkflowRequest - (*tabletmanagerdata.DeleteVReplicationWorkflowRequest)(nil), // 30: tabletmanagerdata.DeleteVReplicationWorkflowRequest - (*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.VDiffRequest)(nil), // 37: tabletmanagerdata.VDiffRequest - (*tabletmanagerdata.ResetReplicationRequest)(nil), // 38: tabletmanagerdata.ResetReplicationRequest - (*tabletmanagerdata.InitPrimaryRequest)(nil), // 39: tabletmanagerdata.InitPrimaryRequest - (*tabletmanagerdata.PopulateReparentJournalRequest)(nil), // 40: tabletmanagerdata.PopulateReparentJournalRequest - (*tabletmanagerdata.InitReplicaRequest)(nil), // 41: tabletmanagerdata.InitReplicaRequest - (*tabletmanagerdata.DemotePrimaryRequest)(nil), // 42: tabletmanagerdata.DemotePrimaryRequest - (*tabletmanagerdata.UndoDemotePrimaryRequest)(nil), // 43: tabletmanagerdata.UndoDemotePrimaryRequest - (*tabletmanagerdata.ReplicaWasPromotedRequest)(nil), // 44: tabletmanagerdata.ReplicaWasPromotedRequest - (*tabletmanagerdata.ResetReplicationParametersRequest)(nil), // 45: tabletmanagerdata.ResetReplicationParametersRequest - (*tabletmanagerdata.FullStatusRequest)(nil), // 46: tabletmanagerdata.FullStatusRequest - (*tabletmanagerdata.SetReplicationSourceRequest)(nil), // 47: tabletmanagerdata.SetReplicationSourceRequest - (*tabletmanagerdata.ReplicaWasRestartedRequest)(nil), // 48: tabletmanagerdata.ReplicaWasRestartedRequest - (*tabletmanagerdata.StopReplicationAndGetStatusRequest)(nil), // 49: tabletmanagerdata.StopReplicationAndGetStatusRequest - (*tabletmanagerdata.PromoteReplicaRequest)(nil), // 50: tabletmanagerdata.PromoteReplicaRequest - (*tabletmanagerdata.BackupRequest)(nil), // 51: tabletmanagerdata.BackupRequest - (*tabletmanagerdata.RestoreFromBackupRequest)(nil), // 52: tabletmanagerdata.RestoreFromBackupRequest - (*tabletmanagerdata.CheckThrottlerRequest)(nil), // 53: tabletmanagerdata.CheckThrottlerRequest - (*tabletmanagerdata.PingResponse)(nil), // 54: tabletmanagerdata.PingResponse - (*tabletmanagerdata.SleepResponse)(nil), // 55: tabletmanagerdata.SleepResponse - (*tabletmanagerdata.ExecuteHookResponse)(nil), // 56: tabletmanagerdata.ExecuteHookResponse - (*tabletmanagerdata.GetSchemaResponse)(nil), // 57: tabletmanagerdata.GetSchemaResponse - (*tabletmanagerdata.GetPermissionsResponse)(nil), // 58: tabletmanagerdata.GetPermissionsResponse - (*tabletmanagerdata.SetReadOnlyResponse)(nil), // 59: tabletmanagerdata.SetReadOnlyResponse - (*tabletmanagerdata.SetReadWriteResponse)(nil), // 60: tabletmanagerdata.SetReadWriteResponse - (*tabletmanagerdata.ChangeTypeResponse)(nil), // 61: tabletmanagerdata.ChangeTypeResponse - (*tabletmanagerdata.RefreshStateResponse)(nil), // 62: tabletmanagerdata.RefreshStateResponse - (*tabletmanagerdata.RunHealthCheckResponse)(nil), // 63: tabletmanagerdata.RunHealthCheckResponse - (*tabletmanagerdata.ReloadSchemaResponse)(nil), // 64: tabletmanagerdata.ReloadSchemaResponse - (*tabletmanagerdata.PreflightSchemaResponse)(nil), // 65: tabletmanagerdata.PreflightSchemaResponse - (*tabletmanagerdata.ApplySchemaResponse)(nil), // 66: tabletmanagerdata.ApplySchemaResponse - (*tabletmanagerdata.ResetSequencesResponse)(nil), // 67: tabletmanagerdata.ResetSequencesResponse - (*tabletmanagerdata.LockTablesResponse)(nil), // 68: tabletmanagerdata.LockTablesResponse - (*tabletmanagerdata.UnlockTablesResponse)(nil), // 69: tabletmanagerdata.UnlockTablesResponse - (*tabletmanagerdata.ExecuteQueryResponse)(nil), // 70: tabletmanagerdata.ExecuteQueryResponse - (*tabletmanagerdata.ExecuteFetchAsDbaResponse)(nil), // 71: tabletmanagerdata.ExecuteFetchAsDbaResponse - (*tabletmanagerdata.ExecuteFetchAsAllPrivsResponse)(nil), // 72: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse - (*tabletmanagerdata.ExecuteFetchAsAppResponse)(nil), // 73: tabletmanagerdata.ExecuteFetchAsAppResponse - (*tabletmanagerdata.ReplicationStatusResponse)(nil), // 74: tabletmanagerdata.ReplicationStatusResponse - (*tabletmanagerdata.PrimaryStatusResponse)(nil), // 75: tabletmanagerdata.PrimaryStatusResponse - (*tabletmanagerdata.PrimaryPositionResponse)(nil), // 76: tabletmanagerdata.PrimaryPositionResponse - (*tabletmanagerdata.WaitForPositionResponse)(nil), // 77: tabletmanagerdata.WaitForPositionResponse - (*tabletmanagerdata.StopReplicationResponse)(nil), // 78: tabletmanagerdata.StopReplicationResponse - (*tabletmanagerdata.StopReplicationMinimumResponse)(nil), // 79: tabletmanagerdata.StopReplicationMinimumResponse - (*tabletmanagerdata.StartReplicationResponse)(nil), // 80: tabletmanagerdata.StartReplicationResponse - (*tabletmanagerdata.StartReplicationUntilAfterResponse)(nil), // 81: tabletmanagerdata.StartReplicationUntilAfterResponse - (*tabletmanagerdata.GetReplicasResponse)(nil), // 82: tabletmanagerdata.GetReplicasResponse - (*tabletmanagerdata.CreateVReplicationWorkflowResponse)(nil), // 83: tabletmanagerdata.CreateVReplicationWorkflowResponse - (*tabletmanagerdata.DeleteVReplicationWorkflowResponse)(nil), // 84: tabletmanagerdata.DeleteVReplicationWorkflowResponse - (*tabletmanagerdata.HasVReplicationWorkflowsResponse)(nil), // 85: tabletmanagerdata.HasVReplicationWorkflowsResponse - (*tabletmanagerdata.ReadVReplicationWorkflowResponse)(nil), // 86: tabletmanagerdata.ReadVReplicationWorkflowResponse - (*tabletmanagerdata.ReadVReplicationWorkflowsResponse)(nil), // 87: tabletmanagerdata.ReadVReplicationWorkflowsResponse - (*tabletmanagerdata.VReplicationExecResponse)(nil), // 88: tabletmanagerdata.VReplicationExecResponse - (*tabletmanagerdata.VReplicationWaitForPosResponse)(nil), // 89: tabletmanagerdata.VReplicationWaitForPosResponse - (*tabletmanagerdata.UpdateVReplicationWorkflowResponse)(nil), // 90: tabletmanagerdata.UpdateVReplicationWorkflowResponse - (*tabletmanagerdata.VDiffResponse)(nil), // 91: tabletmanagerdata.VDiffResponse - (*tabletmanagerdata.ResetReplicationResponse)(nil), // 92: tabletmanagerdata.ResetReplicationResponse - (*tabletmanagerdata.InitPrimaryResponse)(nil), // 93: tabletmanagerdata.InitPrimaryResponse - (*tabletmanagerdata.PopulateReparentJournalResponse)(nil), // 94: tabletmanagerdata.PopulateReparentJournalResponse - (*tabletmanagerdata.InitReplicaResponse)(nil), // 95: tabletmanagerdata.InitReplicaResponse - (*tabletmanagerdata.DemotePrimaryResponse)(nil), // 96: tabletmanagerdata.DemotePrimaryResponse - (*tabletmanagerdata.UndoDemotePrimaryResponse)(nil), // 97: tabletmanagerdata.UndoDemotePrimaryResponse - (*tabletmanagerdata.ReplicaWasPromotedResponse)(nil), // 98: tabletmanagerdata.ReplicaWasPromotedResponse - (*tabletmanagerdata.ResetReplicationParametersResponse)(nil), // 99: tabletmanagerdata.ResetReplicationParametersResponse - (*tabletmanagerdata.FullStatusResponse)(nil), // 100: tabletmanagerdata.FullStatusResponse - (*tabletmanagerdata.SetReplicationSourceResponse)(nil), // 101: tabletmanagerdata.SetReplicationSourceResponse - (*tabletmanagerdata.ReplicaWasRestartedResponse)(nil), // 102: tabletmanagerdata.ReplicaWasRestartedResponse - (*tabletmanagerdata.StopReplicationAndGetStatusResponse)(nil), // 103: tabletmanagerdata.StopReplicationAndGetStatusResponse - (*tabletmanagerdata.PromoteReplicaResponse)(nil), // 104: tabletmanagerdata.PromoteReplicaResponse - (*tabletmanagerdata.BackupResponse)(nil), // 105: tabletmanagerdata.BackupResponse - (*tabletmanagerdata.RestoreFromBackupResponse)(nil), // 106: tabletmanagerdata.RestoreFromBackupResponse - (*tabletmanagerdata.CheckThrottlerResponse)(nil), // 107: tabletmanagerdata.CheckThrottlerResponse + (*tabletmanagerdata.PingRequest)(nil), // 0: tabletmanagerdata.PingRequest + (*tabletmanagerdata.SleepRequest)(nil), // 1: tabletmanagerdata.SleepRequest + (*tabletmanagerdata.ExecuteHookRequest)(nil), // 2: tabletmanagerdata.ExecuteHookRequest + (*tabletmanagerdata.GetSchemaRequest)(nil), // 3: tabletmanagerdata.GetSchemaRequest + (*tabletmanagerdata.GetPermissionsRequest)(nil), // 4: tabletmanagerdata.GetPermissionsRequest + (*tabletmanagerdata.SetReadOnlyRequest)(nil), // 5: tabletmanagerdata.SetReadOnlyRequest + (*tabletmanagerdata.SetReadWriteRequest)(nil), // 6: tabletmanagerdata.SetReadWriteRequest + (*tabletmanagerdata.ChangeTypeRequest)(nil), // 7: tabletmanagerdata.ChangeTypeRequest + (*tabletmanagerdata.RefreshStateRequest)(nil), // 8: tabletmanagerdata.RefreshStateRequest + (*tabletmanagerdata.RunHealthCheckRequest)(nil), // 9: tabletmanagerdata.RunHealthCheckRequest + (*tabletmanagerdata.ReloadSchemaRequest)(nil), // 10: tabletmanagerdata.ReloadSchemaRequest + (*tabletmanagerdata.PreflightSchemaRequest)(nil), // 11: tabletmanagerdata.PreflightSchemaRequest + (*tabletmanagerdata.ApplySchemaRequest)(nil), // 12: tabletmanagerdata.ApplySchemaRequest + (*tabletmanagerdata.ResetSequencesRequest)(nil), // 13: tabletmanagerdata.ResetSequencesRequest + (*tabletmanagerdata.LockTablesRequest)(nil), // 14: tabletmanagerdata.LockTablesRequest + (*tabletmanagerdata.UnlockTablesRequest)(nil), // 15: tabletmanagerdata.UnlockTablesRequest + (*tabletmanagerdata.ExecuteQueryRequest)(nil), // 16: tabletmanagerdata.ExecuteQueryRequest + (*tabletmanagerdata.ExecuteFetchAsDbaRequest)(nil), // 17: tabletmanagerdata.ExecuteFetchAsDbaRequest + (*tabletmanagerdata.ExecuteFetchAsAllPrivsRequest)(nil), // 18: tabletmanagerdata.ExecuteFetchAsAllPrivsRequest + (*tabletmanagerdata.ExecuteFetchAsAppRequest)(nil), // 19: tabletmanagerdata.ExecuteFetchAsAppRequest + (*tabletmanagerdata.ReplicationStatusRequest)(nil), // 20: tabletmanagerdata.ReplicationStatusRequest + (*tabletmanagerdata.PrimaryStatusRequest)(nil), // 21: tabletmanagerdata.PrimaryStatusRequest + (*tabletmanagerdata.PrimaryPositionRequest)(nil), // 22: tabletmanagerdata.PrimaryPositionRequest + (*tabletmanagerdata.WaitForPositionRequest)(nil), // 23: tabletmanagerdata.WaitForPositionRequest + (*tabletmanagerdata.StopReplicationRequest)(nil), // 24: tabletmanagerdata.StopReplicationRequest + (*tabletmanagerdata.StopReplicationMinimumRequest)(nil), // 25: tabletmanagerdata.StopReplicationMinimumRequest + (*tabletmanagerdata.StartReplicationRequest)(nil), // 26: tabletmanagerdata.StartReplicationRequest + (*tabletmanagerdata.StartReplicationUntilAfterRequest)(nil), // 27: tabletmanagerdata.StartReplicationUntilAfterRequest + (*tabletmanagerdata.GetReplicasRequest)(nil), // 28: tabletmanagerdata.GetReplicasRequest + (*tabletmanagerdata.CreateVReplicationWorkflowRequest)(nil), // 29: tabletmanagerdata.CreateVReplicationWorkflowRequest + (*tabletmanagerdata.DeleteVReplicationWorkflowRequest)(nil), // 30: tabletmanagerdata.DeleteVReplicationWorkflowRequest + (*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.UpdateVReplicationWorkflowsStateRequest)(nil), // 37: tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + (*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.UpdateVReplicationWorkflowsStateResponse)(nil), // 92: tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + (*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 @@ -574,79 +586,81 @@ var file_tabletmanagerservice_proto_depIdxs = []int32{ 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.VDiff:input_type -> tabletmanagerdata.VDiffRequest - 38, // 38: tabletmanagerservice.TabletManager.ResetReplication:input_type -> tabletmanagerdata.ResetReplicationRequest - 39, // 39: tabletmanagerservice.TabletManager.InitPrimary:input_type -> tabletmanagerdata.InitPrimaryRequest - 40, // 40: tabletmanagerservice.TabletManager.PopulateReparentJournal:input_type -> tabletmanagerdata.PopulateReparentJournalRequest - 41, // 41: tabletmanagerservice.TabletManager.InitReplica:input_type -> tabletmanagerdata.InitReplicaRequest - 42, // 42: tabletmanagerservice.TabletManager.DemotePrimary:input_type -> tabletmanagerdata.DemotePrimaryRequest - 43, // 43: tabletmanagerservice.TabletManager.UndoDemotePrimary:input_type -> tabletmanagerdata.UndoDemotePrimaryRequest - 44, // 44: tabletmanagerservice.TabletManager.ReplicaWasPromoted:input_type -> tabletmanagerdata.ReplicaWasPromotedRequest - 45, // 45: tabletmanagerservice.TabletManager.ResetReplicationParameters:input_type -> tabletmanagerdata.ResetReplicationParametersRequest - 46, // 46: tabletmanagerservice.TabletManager.FullStatus:input_type -> tabletmanagerdata.FullStatusRequest - 47, // 47: tabletmanagerservice.TabletManager.SetReplicationSource:input_type -> tabletmanagerdata.SetReplicationSourceRequest - 48, // 48: tabletmanagerservice.TabletManager.ReplicaWasRestarted:input_type -> tabletmanagerdata.ReplicaWasRestartedRequest - 49, // 49: tabletmanagerservice.TabletManager.StopReplicationAndGetStatus:input_type -> tabletmanagerdata.StopReplicationAndGetStatusRequest - 50, // 50: tabletmanagerservice.TabletManager.PromoteReplica:input_type -> tabletmanagerdata.PromoteReplicaRequest - 51, // 51: tabletmanagerservice.TabletManager.Backup:input_type -> tabletmanagerdata.BackupRequest - 52, // 52: tabletmanagerservice.TabletManager.RestoreFromBackup:input_type -> tabletmanagerdata.RestoreFromBackupRequest - 53, // 53: tabletmanagerservice.TabletManager.CheckThrottler:input_type -> tabletmanagerdata.CheckThrottlerRequest - 54, // 54: tabletmanagerservice.TabletManager.Ping:output_type -> tabletmanagerdata.PingResponse - 55, // 55: tabletmanagerservice.TabletManager.Sleep:output_type -> tabletmanagerdata.SleepResponse - 56, // 56: tabletmanagerservice.TabletManager.ExecuteHook:output_type -> tabletmanagerdata.ExecuteHookResponse - 57, // 57: tabletmanagerservice.TabletManager.GetSchema:output_type -> tabletmanagerdata.GetSchemaResponse - 58, // 58: tabletmanagerservice.TabletManager.GetPermissions:output_type -> tabletmanagerdata.GetPermissionsResponse - 59, // 59: tabletmanagerservice.TabletManager.SetReadOnly:output_type -> tabletmanagerdata.SetReadOnlyResponse - 60, // 60: tabletmanagerservice.TabletManager.SetReadWrite:output_type -> tabletmanagerdata.SetReadWriteResponse - 61, // 61: tabletmanagerservice.TabletManager.ChangeType:output_type -> tabletmanagerdata.ChangeTypeResponse - 62, // 62: tabletmanagerservice.TabletManager.RefreshState:output_type -> tabletmanagerdata.RefreshStateResponse - 63, // 63: tabletmanagerservice.TabletManager.RunHealthCheck:output_type -> tabletmanagerdata.RunHealthCheckResponse - 64, // 64: tabletmanagerservice.TabletManager.ReloadSchema:output_type -> tabletmanagerdata.ReloadSchemaResponse - 65, // 65: tabletmanagerservice.TabletManager.PreflightSchema:output_type -> tabletmanagerdata.PreflightSchemaResponse - 66, // 66: tabletmanagerservice.TabletManager.ApplySchema:output_type -> tabletmanagerdata.ApplySchemaResponse - 67, // 67: tabletmanagerservice.TabletManager.ResetSequences:output_type -> tabletmanagerdata.ResetSequencesResponse - 68, // 68: tabletmanagerservice.TabletManager.LockTables:output_type -> tabletmanagerdata.LockTablesResponse - 69, // 69: tabletmanagerservice.TabletManager.UnlockTables:output_type -> tabletmanagerdata.UnlockTablesResponse - 70, // 70: tabletmanagerservice.TabletManager.ExecuteQuery:output_type -> tabletmanagerdata.ExecuteQueryResponse - 71, // 71: tabletmanagerservice.TabletManager.ExecuteFetchAsDba:output_type -> tabletmanagerdata.ExecuteFetchAsDbaResponse - 72, // 72: tabletmanagerservice.TabletManager.ExecuteFetchAsAllPrivs:output_type -> tabletmanagerdata.ExecuteFetchAsAllPrivsResponse - 73, // 73: tabletmanagerservice.TabletManager.ExecuteFetchAsApp:output_type -> tabletmanagerdata.ExecuteFetchAsAppResponse - 74, // 74: tabletmanagerservice.TabletManager.ReplicationStatus:output_type -> tabletmanagerdata.ReplicationStatusResponse - 75, // 75: tabletmanagerservice.TabletManager.PrimaryStatus:output_type -> tabletmanagerdata.PrimaryStatusResponse - 76, // 76: tabletmanagerservice.TabletManager.PrimaryPosition:output_type -> tabletmanagerdata.PrimaryPositionResponse - 77, // 77: tabletmanagerservice.TabletManager.WaitForPosition:output_type -> tabletmanagerdata.WaitForPositionResponse - 78, // 78: tabletmanagerservice.TabletManager.StopReplication:output_type -> tabletmanagerdata.StopReplicationResponse - 79, // 79: tabletmanagerservice.TabletManager.StopReplicationMinimum:output_type -> tabletmanagerdata.StopReplicationMinimumResponse - 80, // 80: tabletmanagerservice.TabletManager.StartReplication:output_type -> tabletmanagerdata.StartReplicationResponse - 81, // 81: tabletmanagerservice.TabletManager.StartReplicationUntilAfter:output_type -> tabletmanagerdata.StartReplicationUntilAfterResponse - 82, // 82: tabletmanagerservice.TabletManager.GetReplicas:output_type -> tabletmanagerdata.GetReplicasResponse - 83, // 83: tabletmanagerservice.TabletManager.CreateVReplicationWorkflow:output_type -> tabletmanagerdata.CreateVReplicationWorkflowResponse - 84, // 84: tabletmanagerservice.TabletManager.DeleteVReplicationWorkflow:output_type -> tabletmanagerdata.DeleteVReplicationWorkflowResponse - 85, // 85: tabletmanagerservice.TabletManager.HasVReplicationWorkflows:output_type -> tabletmanagerdata.HasVReplicationWorkflowsResponse - 86, // 86: tabletmanagerservice.TabletManager.ReadVReplicationWorkflow:output_type -> tabletmanagerdata.ReadVReplicationWorkflowResponse - 87, // 87: tabletmanagerservice.TabletManager.ReadVReplicationWorkflows:output_type -> tabletmanagerdata.ReadVReplicationWorkflowsResponse - 88, // 88: tabletmanagerservice.TabletManager.VReplicationExec:output_type -> tabletmanagerdata.VReplicationExecResponse - 89, // 89: tabletmanagerservice.TabletManager.VReplicationWaitForPos:output_type -> tabletmanagerdata.VReplicationWaitForPosResponse - 90, // 90: tabletmanagerservice.TabletManager.UpdateVReplicationWorkflow:output_type -> tabletmanagerdata.UpdateVReplicationWorkflowResponse - 91, // 91: tabletmanagerservice.TabletManager.VDiff:output_type -> tabletmanagerdata.VDiffResponse - 92, // 92: tabletmanagerservice.TabletManager.ResetReplication:output_type -> tabletmanagerdata.ResetReplicationResponse - 93, // 93: tabletmanagerservice.TabletManager.InitPrimary:output_type -> tabletmanagerdata.InitPrimaryResponse - 94, // 94: tabletmanagerservice.TabletManager.PopulateReparentJournal:output_type -> tabletmanagerdata.PopulateReparentJournalResponse - 95, // 95: tabletmanagerservice.TabletManager.InitReplica:output_type -> tabletmanagerdata.InitReplicaResponse - 96, // 96: tabletmanagerservice.TabletManager.DemotePrimary:output_type -> tabletmanagerdata.DemotePrimaryResponse - 97, // 97: tabletmanagerservice.TabletManager.UndoDemotePrimary:output_type -> tabletmanagerdata.UndoDemotePrimaryResponse - 98, // 98: tabletmanagerservice.TabletManager.ReplicaWasPromoted:output_type -> tabletmanagerdata.ReplicaWasPromotedResponse - 99, // 99: tabletmanagerservice.TabletManager.ResetReplicationParameters:output_type -> tabletmanagerdata.ResetReplicationParametersResponse - 100, // 100: tabletmanagerservice.TabletManager.FullStatus:output_type -> tabletmanagerdata.FullStatusResponse - 101, // 101: tabletmanagerservice.TabletManager.SetReplicationSource:output_type -> tabletmanagerdata.SetReplicationSourceResponse - 102, // 102: tabletmanagerservice.TabletManager.ReplicaWasRestarted:output_type -> tabletmanagerdata.ReplicaWasRestartedResponse - 103, // 103: tabletmanagerservice.TabletManager.StopReplicationAndGetStatus:output_type -> tabletmanagerdata.StopReplicationAndGetStatusResponse - 104, // 104: tabletmanagerservice.TabletManager.PromoteReplica:output_type -> tabletmanagerdata.PromoteReplicaResponse - 105, // 105: tabletmanagerservice.TabletManager.Backup:output_type -> tabletmanagerdata.BackupResponse - 106, // 106: tabletmanagerservice.TabletManager.RestoreFromBackup:output_type -> tabletmanagerdata.RestoreFromBackupResponse - 107, // 107: tabletmanagerservice.TabletManager.CheckThrottler:output_type -> tabletmanagerdata.CheckThrottlerResponse - 54, // [54:108] is the sub-list for method output_type - 0, // [0:54] is the sub-list for method input_type + 37, // 37: tabletmanagerservice.TabletManager.UpdateVReplicationWorkflowsState:input_type -> tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + 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.UpdateVReplicationWorkflowsState:output_type -> tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + 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 a9d060d6d63..6db6ac90edb 100644 --- a/go/vt/proto/tabletmanagerservice/tabletmanagerservice_grpc.pb.go +++ b/go/vt/proto/tabletmanagerservice/tabletmanagerservice_grpc.pb.go @@ -78,6 +78,7 @@ type TabletManagerClient interface { 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) + UpdateVReplicationWorkflowsState(ctx context.Context, in *tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest, opts ...grpc.CallOption) (*tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse, error) // VDiff API VDiff(ctx context.Context, in *tabletmanagerdata.VDiffRequest, opts ...grpc.CallOption) (*tabletmanagerdata.VDiffResponse, error) // ResetReplication makes the target not replicating @@ -456,6 +457,15 @@ func (c *tabletManagerClient) UpdateVReplicationWorkflow(ctx context.Context, in return out, nil } +func (c *tabletManagerClient) UpdateVReplicationWorkflowsState(ctx context.Context, in *tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest, opts ...grpc.CallOption) (*tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse, error) { + out := new(tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse) + err := c.cc.Invoke(ctx, "/tabletmanagerservice.TabletManager/UpdateVReplicationWorkflowsState", 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...) @@ -714,6 +724,7 @@ type TabletManagerServer interface { VReplicationExec(context.Context, *tabletmanagerdata.VReplicationExecRequest) (*tabletmanagerdata.VReplicationExecResponse, error) VReplicationWaitForPos(context.Context, *tabletmanagerdata.VReplicationWaitForPosRequest) (*tabletmanagerdata.VReplicationWaitForPosResponse, error) UpdateVReplicationWorkflow(context.Context, *tabletmanagerdata.UpdateVReplicationWorkflowRequest) (*tabletmanagerdata.UpdateVReplicationWorkflowResponse, error) + UpdateVReplicationWorkflowsState(context.Context, *tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest) (*tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse, error) // VDiff API VDiff(context.Context, *tabletmanagerdata.VDiffRequest) (*tabletmanagerdata.VDiffResponse, error) // ResetReplication makes the target not replicating @@ -867,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) UpdateVReplicationWorkflowsState(context.Context, *tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest) (*tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateVReplicationWorkflowsState not implemented") +} func (UnimplementedTabletManagerServer) VDiff(context.Context, *tabletmanagerdata.VDiffRequest) (*tabletmanagerdata.VDiffResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method VDiff not implemented") } @@ -1597,6 +1611,24 @@ func _TabletManager_UpdateVReplicationWorkflow_Handler(srv interface{}, ctx cont return interceptor(ctx, in, info, handler) } +func _TabletManager_UpdateVReplicationWorkflowsState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TabletManagerServer).UpdateVReplicationWorkflowsState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tabletmanagerservice.TabletManager/UpdateVReplicationWorkflowsState", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TabletManagerServer).UpdateVReplicationWorkflowsState(ctx, req.(*tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest)) + } + 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 { @@ -2064,6 +2096,10 @@ var TabletManager_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdateVReplicationWorkflow", Handler: _TabletManager_UpdateVReplicationWorkflow_Handler, }, + { + MethodName: "UpdateVReplicationWorkflowsState", + Handler: _TabletManager_UpdateVReplicationWorkflowsState_Handler, + }, { MethodName: "VDiff", Handler: _TabletManager_VDiff_Handler, diff --git a/go/vt/vtcombo/tablet_map.go b/go/vt/vtcombo/tablet_map.go index 2f23a9ea660..d15e1aa6a57 100644 --- a/go/vt/vtcombo/tablet_map.go +++ b/go/vt/vtcombo/tablet_map.go @@ -893,6 +893,10 @@ func (itmc *internalTabletManagerClient) UpdateVReplicationWorkflow(context.Cont return nil, fmt.Errorf("not implemented in vtcombo") } +func (itmc *internalTabletManagerClient) UpdateVReplicationWorkflowsState(context.Context, *topodatapb.Tablet, *tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsStateResponse, 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/resharder.go b/go/vt/vtctl/workflow/resharder.go index 364a8eee6e3..43e84b377e2 100644 --- a/go/vt/vtctl/workflow/resharder.go +++ b/go/vt/vtctl/workflow/resharder.go @@ -36,7 +36,6 @@ 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" vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" ) @@ -325,18 +324,15 @@ 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. - req := &tabletmanagerdatapb.UpdateVReplicationWorkflowRequest{ - Workflow: rs.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), + req := &tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest{ + 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.UpdateVReplicationWorkflow(ctx, targetPrimary.Tablet, req); err != nil { - return vterrors.Wrapf(err, "UpdateVReplicationWorkflow(%v, 'state='%s')", + if _, err := rs.s.tmc.UpdateVReplicationWorkflowsState(ctx, targetPrimary.Tablet, req); err != nil { + return vterrors.Wrapf(err, "UpdateVReplicationWorkflowsState(%v, 'state='%s')", targetPrimary.Tablet, binlogdatapb.VReplicationWorkflowState_Running.String()) } return nil diff --git a/go/vt/vttablet/faketmclient/fake_client.go b/go/vt/vttablet/faketmclient/fake_client.go index d4847f12ae7..e8d1954d259 100644 --- a/go/vt/vttablet/faketmclient/fake_client.go +++ b/go/vt/vttablet/faketmclient/fake_client.go @@ -90,6 +90,10 @@ func (client *FakeTabletManagerClient) UpdateVReplicationWorkflow(ctx context.Co return nil, nil } +func (client *FakeTabletManagerClient) UpdateVReplicationWorkflowsState(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsStateResponse, 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 14831d63736..03947c7a89e 100644 --- a/go/vt/vttablet/grpctmclient/client.go +++ b/go/vt/vttablet/grpctmclient/client.go @@ -799,6 +799,19 @@ func (client *Client) UpdateVReplicationWorkflow(ctx context.Context, tablet *to return response, nil } +func (client *Client) UpdateVReplicationWorkflowsState(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsStateResponse, error) { + c, closer, err := client.dialer.dial(ctx, tablet) + if err != nil { + return nil, err + } + defer closer.Close() + response, err := c.UpdateVReplicationWorkflowsState(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 1a4468970fd..89ed3032183 100644 --- a/go/vt/vttablet/grpctmserver/server.go +++ b/go/vt/vttablet/grpctmserver/server.go @@ -410,6 +410,13 @@ func (s *server) UpdateVReplicationWorkflow(ctx context.Context, request *tablet return s.tm.UpdateVReplicationWorkflow(ctx, request) } +func (s *server) UpdateVReplicationWorkflowsState(ctx context.Context, request *tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest) (response *tabletmanagerdatapb.UpdateVReplicationWorkflowsStateResponse, err error) { + defer s.tm.HandleRPCPanic(ctx, "UpdateVReplicationWorkflowsState", request, response, true /*verbose*/, &err) + ctx = callinfo.GRPCCallInfo(ctx) + response = &tabletmanagerdatapb.UpdateVReplicationWorkflowsStateResponse{} + return s.tm.UpdateVReplicationWorkflowsState(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/rpc_agent.go b/go/vt/vttablet/tabletmanager/rpc_agent.go index c7c6498d6bf..4e951da60f0 100644 --- a/go/vt/vttablet/tabletmanager/rpc_agent.go +++ b/go/vt/vttablet/tabletmanager/rpc_agent.go @@ -107,6 +107,7 @@ type RPCTM interface { 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) + UpdateVReplicationWorkflowsState(ctx context.Context, req *tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsStateResponse, 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 2e97ee506ae..beb7b76b5f5 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -29,6 +29,7 @@ import ( "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/textutil" "vitess.io/vitess/go/vt/discovery" + "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/proto/vttime" "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/topo/topoproto" @@ -56,6 +57,9 @@ 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 state values for multiple workflows. The final format specifier is + // used to optionally add any additional predicates to the query. + sqlUpdateVReplicationWorkflowsState = "update /*vt+ ALLOW_UNSAFE_VREPLICATION_WRITE */ %s.vreplication set%s where db_name = 'vt_%s'%s" ) func (tm *TabletManager) CreateVReplicationWorkflow(ctx context.Context, req *tabletmanagerdatapb.CreateVReplicationWorkflowRequest) (*tabletmanagerdatapb.CreateVReplicationWorkflowResponse, error) { @@ -535,6 +539,81 @@ func (tm *TabletManager) UpdateVReplicationWorkflow(ctx context.Context, req *ta }, nil } +// UpdateVReplicationWorkflowsState operates in much the same way that +// UpdateVReplicationWorkflow does, but it allows you to update the state +// related fields -- state, message, 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) UpdateVReplicationWorkflowsState(ctx context.Context, req *tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsStateResponse, error) { + if req.GetAllWorkflows() && (len(req.GetIncludeWorkflows()) > 0 || len(req.GetExcludeWorkflows()) > 0) { + return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "cannot specify all workflows along with either of include or exclude workflows") + } + if textutil.ValueIsSimulatedNull(req.GetState()) && textutil.ValueIsSimulatedNull(req.GetMessage()) && textutil.ValueIsSimulatedNull(req.GetStopPosition()) { + return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "no state fields values to update") + } + 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 nil, 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.WriteString(")") + } + 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.WriteString(")") + } + + query := sqlparser.BuildParsedQuery(sqlUpdateVReplicationWorkflowsState, sidecar.GetIdentifier(), sets.String(), tm.DBConfigs.DBName, predicates.String()).Query + log.Errorf("DEBUG: %s", query) + res, err := tm.VREngine.Exec(query) + if err != nil { + return nil, err + } + + return &tabletmanagerdatapb.UpdateVReplicationWorkflowsStateResponse{ + 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. diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go index eaa7fa7f7f4..754cadb4c6a 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go @@ -697,6 +697,109 @@ func TestUpdateVReplicationWorkflow(t *testing.T) { } } +func TestUpdateVReplicationWorkflowsState(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.UpdateVReplicationWorkflowsStateRequest + query string + }{ + { + name: "update only state=running for all workflows", + request: &tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest{ + 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.UpdateVReplicationWorkflowsStateRequest{ + 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.UpdateVReplicationWorkflowsStateRequest{ + 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.UpdateVReplicationWorkflowsStateRequest{ + 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 = 'vt_%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.UpdateVReplicationWorkflowsState(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. // diff --git a/go/vt/vttablet/tmclient/rpc_client_api.go b/go/vt/vttablet/tmclient/rpc_client_api.go index f620151e4cc..54bc6d90975 100644 --- a/go/vt/vttablet/tmclient/rpc_client_api.go +++ b/go/vt/vttablet/tmclient/rpc_client_api.go @@ -181,6 +181,7 @@ type TabletManagerClient interface { 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) + UpdateVReplicationWorkflowsState(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsStateResponse, 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 45e3865a299..5079f4bc7d2 100644 --- a/go/vt/vttablet/tmrpctest/test_tm_rpc.go +++ b/go/vt/vttablet/tmrpctest/test_tm_rpc.go @@ -85,6 +85,11 @@ func (fra *fakeRPCTM) UpdateVReplicationWorkflow(ctx context.Context, req *table panic("implement me") } +func (fra *fakeRPCTM) UpdateVReplicationWorkflowsState(ctx context.Context, req *tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsStateResponse, 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 72c7e96dbde..c9e22f4669e 100644 --- a/go/vt/wrangler/switcher.go +++ b/go/vt/wrangler/switcher.go @@ -108,14 +108,8 @@ func (r *switcher) stopSourceWrites(ctx context.Context) error { return r.ts.stopSourceWrites(ctx) } -// Note: this is a legacy function that is only used by the legacy wrangler migrater and it -// should be deleted along with the vtctl client / wrangler. -func (r *switcher) legacyStopStreams(ctx context.Context, sm *workflow.StreamMigrator) ([]string, error) { - return sm.LegacyStopStreams(ctx) -} - 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/switcher_dry_run.go b/go/vt/wrangler/switcher_dry_run.go index 8e07535f4d4..6c1b48bb5c6 100644 --- a/go/vt/wrangler/switcher_dry_run.go +++ b/go/vt/wrangler/switcher_dry_run.go @@ -209,12 +209,6 @@ func (dr *switcherDryRun) stopSourceWrites(ctx context.Context) error { return nil } -// Note: this is a legacy function that is only used by the legacy wrangler migrater and it -// should be deleted along with the vtctl client / wrangler. -func (dr *switcherDryRun) legacyStopStreams(ctx context.Context, sm *workflow.StreamMigrator) ([]string, error) { - return dr.stopStreams(ctx, sm) -} - func (dr *switcherDryRun) stopStreams(ctx context.Context, sm *workflow.StreamMigrator) ([]string, error) { logs := make([]string, 0) for _, streams := range sm.Streams() { diff --git a/go/vt/wrangler/switcher_interface.go b/go/vt/wrangler/switcher_interface.go index 09b083740de..bae165ec2ea 100644 --- a/go/vt/wrangler/switcher_interface.go +++ b/go/vt/wrangler/switcher_interface.go @@ -28,7 +28,6 @@ import ( type iswitcher interface { lockKeyspace(ctx context.Context, keyspace, action string) (context.Context, func(*error), error) cancelMigration(ctx context.Context, sm *workflow.StreamMigrator) - legacyStopStreams(ctx context.Context, sm *workflow.StreamMigrator) ([]string, error) stopStreams(ctx context.Context, sm *workflow.StreamMigrator) ([]string, error) stopSourceWrites(ctx context.Context) error waitForCatchup(ctx context.Context, filteredReplicationWaitTime time.Duration) error diff --git a/go/vt/wrangler/traffic_switcher.go b/go/vt/wrangler/traffic_switcher.go index 8dee12e4b83..b81aa96e19b 100644 --- a/go/vt/wrangler/traffic_switcher.go +++ b/go/vt/wrangler/traffic_switcher.go @@ -563,7 +563,7 @@ func (wr *Wrangler) SwitchWrites(ctx context.Context, targetKeyspace, workflowNa } ts.Logger().Infof("Stopping streams") - sourceWorkflows, err = sw.legacyStopStreams(ctx, sm) + sourceWorkflows, err = sw.stopStreams(ctx, sm) if err != nil { for key, streams := range sm.Streams() { for _, stream := range streams { diff --git a/proto/tabletmanagerdata.proto b/proto/tabletmanagerdata.proto index 75e5765e913..1356470d055 100644 --- a/proto/tabletmanagerdata.proto +++ b/proto/tabletmanagerdata.proto @@ -666,6 +666,19 @@ message UpdateVReplicationWorkflowResponse { query.QueryResult result = 1; } +message UpdateVReplicationWorkflowsStateRequest { + 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 UpdateVReplicationWorkflowsStateResponse { + query.QueryResult result = 1; +} + message ResetSequencesRequest { repeated string tables = 1; } diff --git a/proto/tabletmanagerservice.proto b/proto/tabletmanagerservice.proto index 83c94b5be14..ccd4d159163 100644 --- a/proto/tabletmanagerservice.proto +++ b/proto/tabletmanagerservice.proto @@ -122,6 +122,7 @@ service TabletManager { rpc VReplicationExec(tabletmanagerdata.VReplicationExecRequest) returns(tabletmanagerdata.VReplicationExecResponse) {}; rpc VReplicationWaitForPos(tabletmanagerdata.VReplicationWaitForPosRequest) returns(tabletmanagerdata.VReplicationWaitForPosResponse) {}; rpc UpdateVReplicationWorkflow(tabletmanagerdata.UpdateVReplicationWorkflowRequest) returns(tabletmanagerdata.UpdateVReplicationWorkflowResponse) {}; + rpc UpdateVReplicationWorkflowsState(tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest) returns(tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse) {}; // 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 53948b23628..262465639f5 100644 --- a/web/vtadmin/src/proto/vtadmin.d.ts +++ b/web/vtadmin/src/proto/vtadmin.d.ts @@ -29555,6 +29555,230 @@ export namespace tabletmanagerdata { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an UpdateVReplicationWorkflowsStateRequest. */ + interface IUpdateVReplicationWorkflowsStateRequest { + + /** UpdateVReplicationWorkflowsStateRequest all_workflows */ + all_workflows?: (boolean|null); + + /** UpdateVReplicationWorkflowsStateRequest include_workflows */ + include_workflows?: (string[]|null); + + /** UpdateVReplicationWorkflowsStateRequest exclude_workflows */ + exclude_workflows?: (string[]|null); + + /** UpdateVReplicationWorkflowsStateRequest state */ + state?: (binlogdata.VReplicationWorkflowState|null); + + /** UpdateVReplicationWorkflowsStateRequest message */ + message?: (string|null); + + /** UpdateVReplicationWorkflowsStateRequest stop_position */ + stop_position?: (string|null); + } + + /** Represents an UpdateVReplicationWorkflowsStateRequest. */ + class UpdateVReplicationWorkflowsStateRequest implements IUpdateVReplicationWorkflowsStateRequest { + + /** + * Constructs a new UpdateVReplicationWorkflowsStateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: tabletmanagerdata.IUpdateVReplicationWorkflowsStateRequest); + + /** UpdateVReplicationWorkflowsStateRequest all_workflows. */ + public all_workflows: boolean; + + /** UpdateVReplicationWorkflowsStateRequest include_workflows. */ + public include_workflows: string[]; + + /** UpdateVReplicationWorkflowsStateRequest exclude_workflows. */ + public exclude_workflows: string[]; + + /** UpdateVReplicationWorkflowsStateRequest state. */ + public state: binlogdata.VReplicationWorkflowState; + + /** UpdateVReplicationWorkflowsStateRequest message. */ + public message: string; + + /** UpdateVReplicationWorkflowsStateRequest stop_position. */ + public stop_position: string; + + /** + * Creates a new UpdateVReplicationWorkflowsStateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateVReplicationWorkflowsStateRequest instance + */ + public static create(properties?: tabletmanagerdata.IUpdateVReplicationWorkflowsStateRequest): tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest; + + /** + * Encodes the specified UpdateVReplicationWorkflowsStateRequest message. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest.verify|verify} messages. + * @param message UpdateVReplicationWorkflowsStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: tabletmanagerdata.IUpdateVReplicationWorkflowsStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateVReplicationWorkflowsStateRequest message, length delimited. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest.verify|verify} messages. + * @param message UpdateVReplicationWorkflowsStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: tabletmanagerdata.IUpdateVReplicationWorkflowsStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateVReplicationWorkflowsStateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateVReplicationWorkflowsStateRequest + * @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.UpdateVReplicationWorkflowsStateRequest; + + /** + * Decodes an UpdateVReplicationWorkflowsStateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateVReplicationWorkflowsStateRequest + * @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.UpdateVReplicationWorkflowsStateRequest; + + /** + * Verifies an UpdateVReplicationWorkflowsStateRequest 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 UpdateVReplicationWorkflowsStateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateVReplicationWorkflowsStateRequest + */ + public static fromObject(object: { [k: string]: any }): tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest; + + /** + * Creates a plain object from an UpdateVReplicationWorkflowsStateRequest message. Also converts values to other types if specified. + * @param message UpdateVReplicationWorkflowsStateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateVReplicationWorkflowsStateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateVReplicationWorkflowsStateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateVReplicationWorkflowsStateResponse. */ + interface IUpdateVReplicationWorkflowsStateResponse { + + /** UpdateVReplicationWorkflowsStateResponse result */ + result?: (query.IQueryResult|null); + } + + /** Represents an UpdateVReplicationWorkflowsStateResponse. */ + class UpdateVReplicationWorkflowsStateResponse implements IUpdateVReplicationWorkflowsStateResponse { + + /** + * Constructs a new UpdateVReplicationWorkflowsStateResponse. + * @param [properties] Properties to set + */ + constructor(properties?: tabletmanagerdata.IUpdateVReplicationWorkflowsStateResponse); + + /** UpdateVReplicationWorkflowsStateResponse result. */ + public result?: (query.IQueryResult|null); + + /** + * Creates a new UpdateVReplicationWorkflowsStateResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateVReplicationWorkflowsStateResponse instance + */ + public static create(properties?: tabletmanagerdata.IUpdateVReplicationWorkflowsStateResponse): tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse; + + /** + * Encodes the specified UpdateVReplicationWorkflowsStateResponse message. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse.verify|verify} messages. + * @param message UpdateVReplicationWorkflowsStateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: tabletmanagerdata.IUpdateVReplicationWorkflowsStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateVReplicationWorkflowsStateResponse message, length delimited. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse.verify|verify} messages. + * @param message UpdateVReplicationWorkflowsStateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: tabletmanagerdata.IUpdateVReplicationWorkflowsStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateVReplicationWorkflowsStateResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateVReplicationWorkflowsStateResponse + * @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.UpdateVReplicationWorkflowsStateResponse; + + /** + * Decodes an UpdateVReplicationWorkflowsStateResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateVReplicationWorkflowsStateResponse + * @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.UpdateVReplicationWorkflowsStateResponse; + + /** + * Verifies an UpdateVReplicationWorkflowsStateResponse 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 UpdateVReplicationWorkflowsStateResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateVReplicationWorkflowsStateResponse + */ + public static fromObject(object: { [k: string]: any }): tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse; + + /** + * Creates a plain object from an UpdateVReplicationWorkflowsStateResponse message. Also converts values to other types if specified. + * @param message UpdateVReplicationWorkflowsStateResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateVReplicationWorkflowsStateResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateVReplicationWorkflowsStateResponse + * @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 e06d2bb45a5..ff61fa154d7 100644 --- a/web/vtadmin/src/proto/vtadmin.js +++ b/web/vtadmin/src/proto/vtadmin.js @@ -68587,6 +68587,611 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { return UpdateVReplicationWorkflowResponse; })(); + tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest = (function() { + + /** + * Properties of an UpdateVReplicationWorkflowsStateRequest. + * @memberof tabletmanagerdata + * @interface IUpdateVReplicationWorkflowsStateRequest + * @property {boolean|null} [all_workflows] UpdateVReplicationWorkflowsStateRequest all_workflows + * @property {Array.|null} [include_workflows] UpdateVReplicationWorkflowsStateRequest include_workflows + * @property {Array.|null} [exclude_workflows] UpdateVReplicationWorkflowsStateRequest exclude_workflows + * @property {binlogdata.VReplicationWorkflowState|null} [state] UpdateVReplicationWorkflowsStateRequest state + * @property {string|null} [message] UpdateVReplicationWorkflowsStateRequest message + * @property {string|null} [stop_position] UpdateVReplicationWorkflowsStateRequest stop_position + */ + + /** + * Constructs a new UpdateVReplicationWorkflowsStateRequest. + * @memberof tabletmanagerdata + * @classdesc Represents an UpdateVReplicationWorkflowsStateRequest. + * @implements IUpdateVReplicationWorkflowsStateRequest + * @constructor + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsStateRequest=} [properties] Properties to set + */ + function UpdateVReplicationWorkflowsStateRequest(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) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateVReplicationWorkflowsStateRequest all_workflows. + * @member {boolean} all_workflows + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @instance + */ + UpdateVReplicationWorkflowsStateRequest.prototype.all_workflows = false; + + /** + * UpdateVReplicationWorkflowsStateRequest include_workflows. + * @member {Array.} include_workflows + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @instance + */ + UpdateVReplicationWorkflowsStateRequest.prototype.include_workflows = $util.emptyArray; + + /** + * UpdateVReplicationWorkflowsStateRequest exclude_workflows. + * @member {Array.} exclude_workflows + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @instance + */ + UpdateVReplicationWorkflowsStateRequest.prototype.exclude_workflows = $util.emptyArray; + + /** + * UpdateVReplicationWorkflowsStateRequest state. + * @member {binlogdata.VReplicationWorkflowState} state + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @instance + */ + UpdateVReplicationWorkflowsStateRequest.prototype.state = 0; + + /** + * UpdateVReplicationWorkflowsStateRequest message. + * @member {string} message + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @instance + */ + UpdateVReplicationWorkflowsStateRequest.prototype.message = ""; + + /** + * UpdateVReplicationWorkflowsStateRequest stop_position. + * @member {string} stop_position + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @instance + */ + UpdateVReplicationWorkflowsStateRequest.prototype.stop_position = ""; + + /** + * Creates a new UpdateVReplicationWorkflowsStateRequest instance using the specified properties. + * @function create + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @static + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsStateRequest=} [properties] Properties to set + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest} UpdateVReplicationWorkflowsStateRequest instance + */ + UpdateVReplicationWorkflowsStateRequest.create = function create(properties) { + return new UpdateVReplicationWorkflowsStateRequest(properties); + }; + + /** + * Encodes the specified UpdateVReplicationWorkflowsStateRequest message. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest.verify|verify} messages. + * @function encode + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @static + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsStateRequest} message UpdateVReplicationWorkflowsStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateVReplicationWorkflowsStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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 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 UpdateVReplicationWorkflowsStateRequest message, length delimited. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @static + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsStateRequest} message UpdateVReplicationWorkflowsStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateVReplicationWorkflowsStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateVReplicationWorkflowsStateRequest message from the specified reader or buffer. + * @function decode + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest} UpdateVReplicationWorkflowsStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateVReplicationWorkflowsStateRequest.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.UpdateVReplicationWorkflowsStateRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.all_workflows = reader.bool(); + 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.exclude_workflows && message.exclude_workflows.length)) + message.exclude_workflows = []; + message.exclude_workflows.push(reader.string()); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.message = reader.string(); + break; + } + case 6: { + message.stop_position = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateVReplicationWorkflowsStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest} UpdateVReplicationWorkflowsStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateVReplicationWorkflowsStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateVReplicationWorkflowsStateRequest message. + * @function verify + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateVReplicationWorkflowsStateRequest.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: + 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.stop_position != null && message.hasOwnProperty("stop_position")) + if (!$util.isString(message.stop_position)) + return "stop_position: string expected"; + return null; + }; + + /** + * Creates an UpdateVReplicationWorkflowsStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @static + * @param {Object.} object Plain object + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest} UpdateVReplicationWorkflowsStateRequest + */ + UpdateVReplicationWorkflowsStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest) + return object; + let message = new $root.tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest(); + 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.UpdateVReplicationWorkflowsStateRequest.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.exclude_workflows) { + if (!Array.isArray(object.exclude_workflows)) + throw TypeError(".tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest.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: + 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.stop_position != null) + message.stop_position = String(object.stop_position); + return message; + }; + + /** + * Creates a plain object from an UpdateVReplicationWorkflowsStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @static + * @param {tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest} message UpdateVReplicationWorkflowsStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateVReplicationWorkflowsStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.include_workflows = []; + object.exclude_workflows = []; + } + if (options.defaults) { + object.all_workflows = false; + object.state = options.enums === String ? "Unknown" : 0; + object.message = ""; + object.stop_position = ""; + } + 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.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.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.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 UpdateVReplicationWorkflowsStateRequest to JSON. + * @function toJSON + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateVReplicationWorkflowsStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateVReplicationWorkflowsStateRequest + * @function getTypeUrl + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateVReplicationWorkflowsStateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest"; + }; + + return UpdateVReplicationWorkflowsStateRequest; + })(); + + tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse = (function() { + + /** + * Properties of an UpdateVReplicationWorkflowsStateResponse. + * @memberof tabletmanagerdata + * @interface IUpdateVReplicationWorkflowsStateResponse + * @property {query.IQueryResult|null} [result] UpdateVReplicationWorkflowsStateResponse result + */ + + /** + * Constructs a new UpdateVReplicationWorkflowsStateResponse. + * @memberof tabletmanagerdata + * @classdesc Represents an UpdateVReplicationWorkflowsStateResponse. + * @implements IUpdateVReplicationWorkflowsStateResponse + * @constructor + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsStateResponse=} [properties] Properties to set + */ + function UpdateVReplicationWorkflowsStateResponse(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]]; + } + + /** + * UpdateVReplicationWorkflowsStateResponse result. + * @member {query.IQueryResult|null|undefined} result + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + * @instance + */ + UpdateVReplicationWorkflowsStateResponse.prototype.result = null; + + /** + * Creates a new UpdateVReplicationWorkflowsStateResponse instance using the specified properties. + * @function create + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + * @static + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsStateResponse=} [properties] Properties to set + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse} UpdateVReplicationWorkflowsStateResponse instance + */ + UpdateVReplicationWorkflowsStateResponse.create = function create(properties) { + return new UpdateVReplicationWorkflowsStateResponse(properties); + }; + + /** + * Encodes the specified UpdateVReplicationWorkflowsStateResponse message. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse.verify|verify} messages. + * @function encode + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + * @static + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsStateResponse} message UpdateVReplicationWorkflowsStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateVReplicationWorkflowsStateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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 UpdateVReplicationWorkflowsStateResponse message, length delimited. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + * @static + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsStateResponse} message UpdateVReplicationWorkflowsStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateVReplicationWorkflowsStateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateVReplicationWorkflowsStateResponse message from the specified reader or buffer. + * @function decode + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse} UpdateVReplicationWorkflowsStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateVReplicationWorkflowsStateResponse.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.UpdateVReplicationWorkflowsStateResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.result = $root.query.QueryResult.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateVReplicationWorkflowsStateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse} UpdateVReplicationWorkflowsStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateVReplicationWorkflowsStateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateVReplicationWorkflowsStateResponse message. + * @function verify + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateVReplicationWorkflowsStateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.result != null && message.hasOwnProperty("result")) { + let error = $root.query.QueryResult.verify(message.result); + if (error) + return "result." + error; + } + return null; + }; + + /** + * Creates an UpdateVReplicationWorkflowsStateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + * @static + * @param {Object.} object Plain object + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse} UpdateVReplicationWorkflowsStateResponse + */ + UpdateVReplicationWorkflowsStateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse) + return object; + let message = new $root.tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse(); + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse.result: object expected"); + message.result = $root.query.QueryResult.fromObject(object.result); + } + return message; + }; + + /** + * Creates a plain object from an UpdateVReplicationWorkflowsStateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + * @static + * @param {tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse} message UpdateVReplicationWorkflowsStateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateVReplicationWorkflowsStateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + 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 UpdateVReplicationWorkflowsStateResponse to JSON. + * @function toJSON + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + * @instance + * @returns {Object.} JSON object + */ + UpdateVReplicationWorkflowsStateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateVReplicationWorkflowsStateResponse + * @function getTypeUrl + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateVReplicationWorkflowsStateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse"; + }; + + return UpdateVReplicationWorkflowsStateResponse; + })(); + tabletmanagerdata.ResetSequencesRequest = (function() { /** From c82c8e5ba19bc5f509c2d40cda80cd44534402da Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Tue, 5 Mar 2024 16:04:50 -0500 Subject: [PATCH 26/35] Fix db_name usage in new RPC Signed-off-by: Matt Lord --- go/vt/vttablet/tabletmanager/rpc_vreplication.go | 2 +- go/vt/vttablet/tabletmanager/rpc_vreplication_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication.go b/go/vt/vttablet/tabletmanager/rpc_vreplication.go index beb7b76b5f5..70b35e55cab 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -59,7 +59,7 @@ const ( sqlUpdateVReplicationWorkflowStreamConfig = "update %s.vreplication set state = %a, source = %a, cell = %a, tablet_types = %a where id = %a" // Update state values for multiple workflows. The final format specifier is // used to optionally add any additional predicates to the query. - sqlUpdateVReplicationWorkflowsState = "update /*vt+ ALLOW_UNSAFE_VREPLICATION_WRITE */ %s.vreplication set%s where db_name = 'vt_%s'%s" + sqlUpdateVReplicationWorkflowsState = "update /*vt+ ALLOW_UNSAFE_VREPLICATION_WRITE */ %s.vreplication set%s where db_name = '%s'%s" ) func (tm *TabletManager) CreateVReplicationWorkflow(ctx context.Context, req *tabletmanagerdatapb.CreateVReplicationWorkflowRequest) (*tabletmanagerdatapb.CreateVReplicationWorkflowResponse, error) { diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go index 754cadb4c6a..43083183164 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go @@ -780,7 +780,7 @@ func TestUpdateVReplicationWorkflowsState(t *testing.T) { 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 = 'vt_%s'%s", tenv.dbName, addlPredicates), + 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", From 292c4c64e4629ce23389183fcd68d7a435c15509 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Tue, 5 Mar 2024 21:51:58 -0500 Subject: [PATCH 27/35] Several things... 1. Add a new check to the e2e test that confirms all streams are running after a Reshard. 2. Address a TODO on Reshard stream migrations 3. Fix a bug in readRefStreams (was using the workflow struct rather (than workflow name in the map key) 4. Moves more spots to using proto getters as they are nil safe Signed-off-by: Matt Lord --- .../vreplication/materialize/create.go | 1 + go/test/endtoend/vreplication/helper_test.go | 8 ++++ .../vreplication/vreplication_test.go | 3 ++ go/vt/vtctl/workflow/resharder.go | 38 ++++++++------- .../tabletmanager/rpc_vreplication.go | 48 +++++++++---------- 5 files changed, 55 insertions(+), 43 deletions(-) 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 b27444fc417..2cecfa6ffcb 100644 --- a/go/test/endtoend/vreplication/helper_test.go +++ b/go/test/endtoend/vreplication/helper_test.go @@ -583,6 +583,14 @@ func expectNumberOfStreams(t *testing.T, vtgateConn *mysql.Conn, name string, wo 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/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/vtctl/workflow/resharder.go b/go/vt/vtctl/workflow/resharder.go index 43e84b377e2..405227ae281 100644 --- a/go/vt/vtctl/workflow/resharder.go +++ b/go/vt/vtctl/workflow/resharder.go @@ -60,14 +60,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, @@ -78,7 +79,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) } @@ -86,14 +87,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) } @@ -101,7 +102,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) } @@ -114,7 +115,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") } @@ -186,13 +187,15 @@ func (rs *resharder) readRefStreams(ctx context.Context) error { if !isReference { continue } - refKey := fmt.Sprintf("%s:%s:%s", workflow, bls.Keyspace, bls.Shard) + 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: buildTabletTypesString(workflow.TabletTypes, workflow.TabletSelectionPreference), + workflow: workflow.Workflow, + bls: bls, + cell: workflow.Cells, + tabletTypes: buildTabletTypesString(workflow.TabletTypes, workflow.TabletSelectionPreference), + workflowType: workflow.WorkflowType, + workflowSubType: workflow.WorkflowSubType, } } else { if !ref[refKey] { @@ -302,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() diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication.go b/go/vt/vttablet/tabletmanager/rpc_vreplication.go index 70b35e55cab..146aa24d660 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -29,7 +29,6 @@ import ( "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/textutil" "vitess.io/vitess/go/vt/discovery" - "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/proto/vttime" "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/topo/topoproto" @@ -168,65 +167,65 @@ func (tm *TabletManager) HasVReplicationWorkflows(ctx context.Context, req *tabl } func (tm *TabletManager) ReadVReplicationWorkflows(ctx context.Context, req *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowsResponse, error) { - if req == nil || req.DbName == "" { + if req == nil || req.GetDbName() == "" { return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "invalid request, no DB name provided") } bindVars := map[string]*querypb.BindVariable{ - "db": sqltypes.StringBindVariable(req.DbName), + "db": sqltypes.StringBindVariable(req.GetDbName()), } additionalPredicates := strings.Builder{} - if req.ExcludeFrozen { + if req.GetExcludeFrozen() { additionalPredicates.WriteString(fmt.Sprintf(" and message != '%s'", workflow.Frozen)) } - if len(req.IncludeIds) > 0 { + if len(req.GetIncludeIds()) > 0 { additionalPredicates.WriteString(" and id in (") - for i, id := range req.IncludeIds { + for i, id := range req.GetIncludeIds() { if i > 0 { - additionalPredicates.WriteString(",") + additionalPredicates.WriteByte(',') } additionalPredicates.WriteString(fmt.Sprintf("%d", id)) } - additionalPredicates.WriteString(")") + additionalPredicates.WriteByte(')') } - if len(req.IncludeWorkflows) > 0 { + if len(req.GetIncludeWorkflows()) > 0 { additionalPredicates.WriteString(" and workflow in (") - for i, wf := range req.IncludeWorkflows { + for i, wf := range req.GetIncludeWorkflows() { if i > 0 { - additionalPredicates.WriteString(",") + additionalPredicates.WriteByte(',') } additionalPredicates.WriteString(sqltypes.EncodeStringSQL(wf)) } - additionalPredicates.WriteString(")") + additionalPredicates.WriteByte(')') } - if len(req.ExcludeWorkflows) > 0 { + if len(req.GetExcludeWorkflows()) > 0 { additionalPredicates.WriteString(" and workflow not in (") - for i, wf := range req.ExcludeWorkflows { + for i, wf := range req.GetExcludeWorkflows() { if i > 0 { - additionalPredicates.WriteString(",") + additionalPredicates.WriteByte(',') } additionalPredicates.WriteString(sqltypes.EncodeStringSQL(wf)) } - additionalPredicates.WriteString(")") + additionalPredicates.WriteByte(')') } - if len(req.IncludeStates) > 0 { + if len(req.GetIncludeStates()) > 0 { additionalPredicates.WriteString(" and state in (") - for i, state := range req.IncludeStates { + for i, state := range req.GetIncludeStates() { if i > 0 { - additionalPredicates.WriteString(",") + additionalPredicates.WriteByte(',') } additionalPredicates.WriteString(sqltypes.EncodeStringSQL(state.String())) } - additionalPredicates.WriteString(")") + additionalPredicates.WriteByte(')') } - if len(req.ExcludeStates) > 0 { + if len(req.GetExcludeStates()) > 0 { additionalPredicates.WriteString(" and state not in (") - for i, state := range req.ExcludeStates { + for i, state := range req.GetExcludeStates() { if i > 0 { - additionalPredicates.WriteString(",") + additionalPredicates.WriteByte(',') } additionalPredicates.WriteString(sqltypes.EncodeStringSQL(state.String())) } - additionalPredicates.WriteString(")") + additionalPredicates.WriteByte(')') } parsed := sqlparser.BuildParsedQuery(sqlReadVReplicationWorkflows, sidecar.GetIdentifier(), ":db", additionalPredicates.String()) stmt, err := parsed.GenerateQuery(bindVars, nil) @@ -601,7 +600,6 @@ func (tm *TabletManager) UpdateVReplicationWorkflowsState(ctx context.Context, r } query := sqlparser.BuildParsedQuery(sqlUpdateVReplicationWorkflowsState, sidecar.GetIdentifier(), sets.String(), tm.DBConfigs.DBName, predicates.String()).Query - log.Errorf("DEBUG: %s", query) res, err := tm.VREngine.Exec(query) if err != nil { return nil, err From 798c50968a96d65369207766a76615a46343b12f Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Tue, 5 Mar 2024 22:28:00 -0500 Subject: [PATCH 28/35] Minor changes after self review of new code Signed-off-by: Matt Lord --- go/test/endtoend/vreplication/helper_test.go | 4 ++-- go/vt/vttablet/tabletmanager/rpc_vreplication.go | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go/test/endtoend/vreplication/helper_test.go b/go/test/endtoend/vreplication/helper_test.go index 2cecfa6ffcb..8716b3b0289 100644 --- a/go/test/endtoend/vreplication/helper_test.go +++ b/go/test/endtoend/vreplication/helper_test.go @@ -583,8 +583,8 @@ func expectNumberOfStreams(t *testing.T, vtgateConn *mysql.Conn, name string, wo waitForQueryResult(t, vtgateConn, database, query, fmt.Sprintf(`[[INT64(%d)]]`, want)) } -// confirmAllStreamsRunning confirms that all of the migrated streams -// are running after a Reshard. +// 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 diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication.go b/go/vt/vttablet/tabletmanager/rpc_vreplication.go index 146aa24d660..fa6f57dca22 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -134,11 +134,11 @@ func (tm *TabletManager) DeleteVReplicationWorkflow(ctx context.Context, req *ta } func (tm *TabletManager) HasVReplicationWorkflows(ctx context.Context, req *tabletmanagerdatapb.HasVReplicationWorkflowsRequest) (*tabletmanagerdatapb.HasVReplicationWorkflowsResponse, error) { - if req == nil || req.DbName == "" { + if req.GetDbName() == "" { return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "invalid request, no DB name provided") } bindVars := map[string]*querypb.BindVariable{ - "db": sqltypes.StringBindVariable(req.DbName), + "db": sqltypes.StringBindVariable(req.GetDbName()), } parsed := sqlparser.BuildParsedQuery(sqlHasVReplicationWorkflows, sidecar.GetIdentifier(), ":db") stmt, err := parsed.GenerateQuery(bindVars, nil) @@ -167,7 +167,7 @@ func (tm *TabletManager) HasVReplicationWorkflows(ctx context.Context, req *tabl } func (tm *TabletManager) ReadVReplicationWorkflows(ctx context.Context, req *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowsResponse, error) { - if req == nil || req.GetDbName() == "" { + if req.GetDbName() == "" { return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "invalid request, no DB name provided") } bindVars := map[string]*querypb.BindVariable{ @@ -586,7 +586,7 @@ func (tm *TabletManager) UpdateVReplicationWorkflowsState(ctx context.Context, r } predicates.WriteString(sqltypes.EncodeStringSQL(wf)) } - predicates.WriteString(")") + predicates.WriteByte(')') } if len(req.GetExcludeWorkflows()) > 0 { predicates.WriteString(" and workflow not in (") @@ -596,7 +596,7 @@ func (tm *TabletManager) UpdateVReplicationWorkflowsState(ctx context.Context, r } predicates.WriteString(sqltypes.EncodeStringSQL(wf)) } - predicates.WriteString(")") + predicates.WriteByte(')') } query := sqlparser.BuildParsedQuery(sqlUpdateVReplicationWorkflowsState, sidecar.GetIdentifier(), sets.String(), tm.DBConfigs.DBName, predicates.String()).Query From bb1219c5522ce87274f0601c2fe35545f0ef7d36 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Sat, 9 Mar 2024 19:59:35 -0500 Subject: [PATCH 29/35] Address review comments Signed-off-by: Matt Lord --- go/test/endtoend/vreplication/helper_test.go | 8 ++--- go/vt/discovery/tablet_picker.go | 11 +++++++ go/vt/vtctl/workflow/materializer_test.go | 29 +++++++++++++++---- go/vt/vtctl/workflow/resharder.go | 3 +- go/vt/vtctl/workflow/server.go | 8 ++--- go/vt/vtctl/workflow/utils.go | 8 ----- .../tabletmanager/rpc_vreplication.go | 6 ++-- 7 files changed, 44 insertions(+), 29 deletions(-) diff --git a/go/test/endtoend/vreplication/helper_test.go b/go/test/endtoend/vreplication/helper_test.go index 8716b3b0289..022262d4b15 100644 --- a/go/test/endtoend/vreplication/helper_test.go +++ b/go/test/endtoend/vreplication/helper_test.go @@ -574,12 +574,10 @@ func isTableInDenyList(t *testing.T, vc *VitessCluster, ksShard string, table st 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 { - query = sqlparser.BuildParsedQuery("select count(*) from %s.vreplication where workflow='%s' and state='%s'", - sidecarDBIdentifier, workflow, binlogdatapb.VReplicationWorkflowState_Running.String()).Query - } else { - query = sqlparser.BuildParsedQuery("select count(*) from %s.vreplication where workflow='%s' and state in ('%s')", - sidecarDBIdentifier, workflow, strings.Join(states, "','")).Query + 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)) } 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/vtctl/workflow/materializer_test.go b/go/vt/vtctl/workflow/materializer_test.go index 17b0dc67738..4f26a2bf626 100644 --- a/go/vt/vtctl/workflow/materializer_test.go +++ b/go/vt/vtctl/workflow/materializer_test.go @@ -28,12 +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/vtenv" "vitess.io/vitess/go/vt/vtgate/vindexes" binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata" @@ -540,8 +539,26 @@ func TestMoveTablesNoRoutingRules(t *testing.T) { 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:\"%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) + 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, @@ -551,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) diff --git a/go/vt/vtctl/workflow/resharder.go b/go/vt/vtctl/workflow/resharder.go index 405227ae281..5919aeb4789 100644 --- a/go/vt/vtctl/workflow/resharder.go +++ b/go/vt/vtctl/workflow/resharder.go @@ -26,6 +26,7 @@ import ( "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" @@ -193,7 +194,7 @@ func (rs *resharder) readRefStreams(ctx context.Context) error { workflow: workflow.Workflow, bls: bls, cell: workflow.Cells, - tabletTypes: buildTabletTypesString(workflow.TabletTypes, workflow.TabletSelectionPreference), + tabletTypes: discovery.BuildTabletTypesString(workflow.TabletTypes, workflow.TabletSelectionPreference), workflowType: workflow.WorkflowType, workflowSubType: workflow.WorkflowSubType, } diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index 756e9edeca4..e2b48ad8940 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -400,7 +400,6 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows results := make(map[*topo.TabletInfo]*tabletmanagerdatapb.ReadVReplicationWorkflowsResponse, len(shards)) readWorkflowsEg, readWorkflowsCtx := errgroup.WithContext(ctx) for _, shard := range shards { - shard := shard // https://golang.org/doc/faq#closures_and_goroutines readWorkflowsEg.Go(func() error { si, err := s.ts.GetShard(readWorkflowsCtx, req.Keyspace, shard) if err != nil { @@ -1603,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") @@ -1653,7 +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 := buildTabletTypesString(req.TabletTypes, req.TabletSelectionPreference) + 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. diff --git a/go/vt/vtctl/workflow/utils.go b/go/vt/vtctl/workflow/utils.go index 864359808e2..a015b785acd 100644 --- a/go/vt/vtctl/workflow/utils.go +++ b/go/vt/vtctl/workflow/utils.go @@ -767,11 +767,3 @@ func LegacyBuildTargets(ctx context.Context, ts *topo.Server, tmc tmclient.Table WorkflowSubType: workflowSubType, }, nil } - -func buildTabletTypesString(tabletTypes []topodatapb.TabletType, tabletSelectionPreference tabletmanagerdatapb.TabletSelectionPreference) string { - tabletTypesStr := topoproto.MakeStringTypeCSV(tabletTypes) - if tabletSelectionPreference == tabletmanagerdatapb.TabletSelectionPreference_INORDER { - tabletTypesStr = discovery.InOrderHint + tabletTypesStr - } - return tabletTypesStr -} diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication.go b/go/vt/vttablet/tabletmanager/rpc_vreplication.go index fa6f57dca22..72fba028368 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -284,12 +284,12 @@ func (tm *TabletManager) ReadVReplicationWorkflows(ctx context.Context, req *tab if err != nil { return nil, vterrors.Wrap(err, "error parsing binlog_source field from vreplication table record") } - blspb := &binlogdatapb.BinlogSource{} - err = prototext.Unmarshal(srcBytes, blspb) + 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 = blspb + stream.Bls = bls stream.Pos = row["pos"].ToString() stream.StopPos = row["stop_pos"].ToString() if stream.MaxTps, err = row["max_tps"].ToInt64(); err != nil { From 7a1b5d97c95f58256261b16c3a3e746bb2b9ecb0 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Sat, 9 Mar 2024 21:15:03 -0500 Subject: [PATCH 30/35] Address more review comments Signed-off-by: Matt Lord --- .../tabletmanagerdata/tabletmanagerdata.pb.go | 442 ++++++++-------- .../tabletmanagerdata_vtproto.pb.go | 44 +- .../tabletmanagerservice.pb.go | 479 +++++++++--------- .../tabletmanagerservice_grpc.pb.go | 28 +- go/vt/vtcombo/tablet_map.go | 2 +- go/vt/vtctl/workflow/resharder.go | 6 +- go/vt/vttablet/faketmclient/fake_client.go | 2 +- go/vt/vttablet/grpctmclient/client.go | 4 +- go/vt/vttablet/grpctmserver/server.go | 8 +- go/vt/vttablet/tabletmanager/rpc_agent.go | 2 +- .../tabletmanager/rpc_vreplication.go | 98 ++-- .../tabletmanager/rpc_vreplication_test.go | 100 +++- go/vt/vttablet/tmclient/rpc_client_api.go | 2 +- go/vt/vttablet/tmrpctest/test_tm_rpc.go | 2 +- proto/tabletmanagerdata.proto | 4 +- proto/tabletmanagerservice.proto | 2 +- web/vtadmin/src/proto/vtadmin.d.ts | 148 +++--- web/vtadmin/src/proto/vtadmin.js | 270 +++++----- 18 files changed, 872 insertions(+), 771 deletions(-) diff --git a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go index a698bd5521b..0f0f25d8ea1 100644 --- a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go +++ b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go @@ -6065,7 +6065,7 @@ func (x *UpdateVReplicationWorkflowResponse) GetResult() *query.QueryResult { return nil } -type UpdateVReplicationWorkflowsStateRequest struct { +type UpdateVReplicationWorkflowsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -6078,8 +6078,8 @@ type UpdateVReplicationWorkflowsStateRequest struct { StopPosition string `protobuf:"bytes,6,opt,name=stop_position,json=stopPosition,proto3" json:"stop_position,omitempty"` } -func (x *UpdateVReplicationWorkflowsStateRequest) Reset() { - *x = UpdateVReplicationWorkflowsStateRequest{} +func (x *UpdateVReplicationWorkflowsRequest) Reset() { + *x = UpdateVReplicationWorkflowsRequest{} if protoimpl.UnsafeEnabled { mi := &file_tabletmanagerdata_proto_msgTypes[114] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6087,13 +6087,13 @@ func (x *UpdateVReplicationWorkflowsStateRequest) Reset() { } } -func (x *UpdateVReplicationWorkflowsStateRequest) String() string { +func (x *UpdateVReplicationWorkflowsRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UpdateVReplicationWorkflowsStateRequest) ProtoMessage() {} +func (*UpdateVReplicationWorkflowsRequest) ProtoMessage() {} -func (x *UpdateVReplicationWorkflowsStateRequest) ProtoReflect() protoreflect.Message { +func (x *UpdateVReplicationWorkflowsRequest) ProtoReflect() protoreflect.Message { mi := &file_tabletmanagerdata_proto_msgTypes[114] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6105,54 +6105,54 @@ func (x *UpdateVReplicationWorkflowsStateRequest) ProtoReflect() protoreflect.Me return mi.MessageOf(x) } -// Deprecated: Use UpdateVReplicationWorkflowsStateRequest.ProtoReflect.Descriptor instead. -func (*UpdateVReplicationWorkflowsStateRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use UpdateVReplicationWorkflowsRequest.ProtoReflect.Descriptor instead. +func (*UpdateVReplicationWorkflowsRequest) Descriptor() ([]byte, []int) { return file_tabletmanagerdata_proto_rawDescGZIP(), []int{114} } -func (x *UpdateVReplicationWorkflowsStateRequest) GetAllWorkflows() bool { +func (x *UpdateVReplicationWorkflowsRequest) GetAllWorkflows() bool { if x != nil { return x.AllWorkflows } return false } -func (x *UpdateVReplicationWorkflowsStateRequest) GetIncludeWorkflows() []string { +func (x *UpdateVReplicationWorkflowsRequest) GetIncludeWorkflows() []string { if x != nil { return x.IncludeWorkflows } return nil } -func (x *UpdateVReplicationWorkflowsStateRequest) GetExcludeWorkflows() []string { +func (x *UpdateVReplicationWorkflowsRequest) GetExcludeWorkflows() []string { if x != nil { return x.ExcludeWorkflows } return nil } -func (x *UpdateVReplicationWorkflowsStateRequest) GetState() binlogdata.VReplicationWorkflowState { +func (x *UpdateVReplicationWorkflowsRequest) GetState() binlogdata.VReplicationWorkflowState { if x != nil { return x.State } return binlogdata.VReplicationWorkflowState(0) } -func (x *UpdateVReplicationWorkflowsStateRequest) GetMessage() string { +func (x *UpdateVReplicationWorkflowsRequest) GetMessage() string { if x != nil { return x.Message } return "" } -func (x *UpdateVReplicationWorkflowsStateRequest) GetStopPosition() string { +func (x *UpdateVReplicationWorkflowsRequest) GetStopPosition() string { if x != nil { return x.StopPosition } return "" } -type UpdateVReplicationWorkflowsStateResponse struct { +type UpdateVReplicationWorkflowsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -6160,8 +6160,8 @@ type UpdateVReplicationWorkflowsStateResponse struct { Result *query.QueryResult `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` } -func (x *UpdateVReplicationWorkflowsStateResponse) Reset() { - *x = UpdateVReplicationWorkflowsStateResponse{} +func (x *UpdateVReplicationWorkflowsResponse) Reset() { + *x = UpdateVReplicationWorkflowsResponse{} if protoimpl.UnsafeEnabled { mi := &file_tabletmanagerdata_proto_msgTypes[115] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6169,13 +6169,13 @@ func (x *UpdateVReplicationWorkflowsStateResponse) Reset() { } } -func (x *UpdateVReplicationWorkflowsStateResponse) String() string { +func (x *UpdateVReplicationWorkflowsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UpdateVReplicationWorkflowsStateResponse) ProtoMessage() {} +func (*UpdateVReplicationWorkflowsResponse) ProtoMessage() {} -func (x *UpdateVReplicationWorkflowsStateResponse) ProtoReflect() protoreflect.Message { +func (x *UpdateVReplicationWorkflowsResponse) ProtoReflect() protoreflect.Message { mi := &file_tabletmanagerdata_proto_msgTypes[115] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6187,12 +6187,12 @@ func (x *UpdateVReplicationWorkflowsStateResponse) ProtoReflect() protoreflect.M return mi.MessageOf(x) } -// Deprecated: Use UpdateVReplicationWorkflowsStateResponse.ProtoReflect.Descriptor instead. -func (*UpdateVReplicationWorkflowsStateResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use UpdateVReplicationWorkflowsResponse.ProtoReflect.Descriptor instead. +func (*UpdateVReplicationWorkflowsResponse) Descriptor() ([]byte, []int) { return file_tabletmanagerdata_proto_rawDescGZIP(), []int{115} } -func (x *UpdateVReplicationWorkflowsStateResponse) GetResult() *query.QueryResult { +func (x *UpdateVReplicationWorkflowsResponse) GetResult() *query.QueryResult { if x != nil { return x.Result } @@ -7327,59 +7327,59 @@ var file_tabletmanagerdata_proto_rawDesc = []byte{ 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, 0xa4, 0x02, 0x0a, 0x27, 0x55, 0x70, 0x64, + 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, 0x53, 0x74, 0x61, 0x74, 0x65, 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, - 0x56, 0x0a, 0x28, 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, 0x53, 0x74, - 0x61, 0x74, 0x65, 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, + 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 ( @@ -7397,148 +7397,148 @@ func file_tabletmanagerdata_proto_rawDescGZIP() []byte { var file_tabletmanagerdata_proto_enumTypes = make([]protoimpl.EnumInfo, 1) 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 - (*SchemaDefinition)(nil), // 2: tabletmanagerdata.SchemaDefinition - (*SchemaChangeResult)(nil), // 3: tabletmanagerdata.SchemaChangeResult - (*UserPermission)(nil), // 4: tabletmanagerdata.UserPermission - (*DbPermission)(nil), // 5: tabletmanagerdata.DbPermission - (*Permissions)(nil), // 6: tabletmanagerdata.Permissions - (*PingRequest)(nil), // 7: tabletmanagerdata.PingRequest - (*PingResponse)(nil), // 8: tabletmanagerdata.PingResponse - (*SleepRequest)(nil), // 9: tabletmanagerdata.SleepRequest - (*SleepResponse)(nil), // 10: tabletmanagerdata.SleepResponse - (*ExecuteHookRequest)(nil), // 11: tabletmanagerdata.ExecuteHookRequest - (*ExecuteHookResponse)(nil), // 12: tabletmanagerdata.ExecuteHookResponse - (*GetSchemaRequest)(nil), // 13: tabletmanagerdata.GetSchemaRequest - (*GetSchemaResponse)(nil), // 14: tabletmanagerdata.GetSchemaResponse - (*GetPermissionsRequest)(nil), // 15: tabletmanagerdata.GetPermissionsRequest - (*GetPermissionsResponse)(nil), // 16: tabletmanagerdata.GetPermissionsResponse - (*SetReadOnlyRequest)(nil), // 17: tabletmanagerdata.SetReadOnlyRequest - (*SetReadOnlyResponse)(nil), // 18: tabletmanagerdata.SetReadOnlyResponse - (*SetReadWriteRequest)(nil), // 19: tabletmanagerdata.SetReadWriteRequest - (*SetReadWriteResponse)(nil), // 20: tabletmanagerdata.SetReadWriteResponse - (*ChangeTypeRequest)(nil), // 21: tabletmanagerdata.ChangeTypeRequest - (*ChangeTypeResponse)(nil), // 22: tabletmanagerdata.ChangeTypeResponse - (*RefreshStateRequest)(nil), // 23: tabletmanagerdata.RefreshStateRequest - (*RefreshStateResponse)(nil), // 24: tabletmanagerdata.RefreshStateResponse - (*RunHealthCheckRequest)(nil), // 25: tabletmanagerdata.RunHealthCheckRequest - (*RunHealthCheckResponse)(nil), // 26: tabletmanagerdata.RunHealthCheckResponse - (*ReloadSchemaRequest)(nil), // 27: tabletmanagerdata.ReloadSchemaRequest - (*ReloadSchemaResponse)(nil), // 28: tabletmanagerdata.ReloadSchemaResponse - (*PreflightSchemaRequest)(nil), // 29: tabletmanagerdata.PreflightSchemaRequest - (*PreflightSchemaResponse)(nil), // 30: tabletmanagerdata.PreflightSchemaResponse - (*ApplySchemaRequest)(nil), // 31: tabletmanagerdata.ApplySchemaRequest - (*ApplySchemaResponse)(nil), // 32: tabletmanagerdata.ApplySchemaResponse - (*LockTablesRequest)(nil), // 33: tabletmanagerdata.LockTablesRequest - (*LockTablesResponse)(nil), // 34: tabletmanagerdata.LockTablesResponse - (*UnlockTablesRequest)(nil), // 35: tabletmanagerdata.UnlockTablesRequest - (*UnlockTablesResponse)(nil), // 36: tabletmanagerdata.UnlockTablesResponse - (*ExecuteQueryRequest)(nil), // 37: tabletmanagerdata.ExecuteQueryRequest - (*ExecuteQueryResponse)(nil), // 38: tabletmanagerdata.ExecuteQueryResponse - (*ExecuteFetchAsDbaRequest)(nil), // 39: tabletmanagerdata.ExecuteFetchAsDbaRequest - (*ExecuteFetchAsDbaResponse)(nil), // 40: tabletmanagerdata.ExecuteFetchAsDbaResponse - (*ExecuteFetchAsAllPrivsRequest)(nil), // 41: tabletmanagerdata.ExecuteFetchAsAllPrivsRequest - (*ExecuteFetchAsAllPrivsResponse)(nil), // 42: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse - (*ExecuteFetchAsAppRequest)(nil), // 43: tabletmanagerdata.ExecuteFetchAsAppRequest - (*ExecuteFetchAsAppResponse)(nil), // 44: tabletmanagerdata.ExecuteFetchAsAppResponse - (*ReplicationStatusRequest)(nil), // 45: tabletmanagerdata.ReplicationStatusRequest - (*ReplicationStatusResponse)(nil), // 46: tabletmanagerdata.ReplicationStatusResponse - (*PrimaryStatusRequest)(nil), // 47: tabletmanagerdata.PrimaryStatusRequest - (*PrimaryStatusResponse)(nil), // 48: tabletmanagerdata.PrimaryStatusResponse - (*PrimaryPositionRequest)(nil), // 49: tabletmanagerdata.PrimaryPositionRequest - (*PrimaryPositionResponse)(nil), // 50: tabletmanagerdata.PrimaryPositionResponse - (*WaitForPositionRequest)(nil), // 51: tabletmanagerdata.WaitForPositionRequest - (*WaitForPositionResponse)(nil), // 52: tabletmanagerdata.WaitForPositionResponse - (*StopReplicationRequest)(nil), // 53: tabletmanagerdata.StopReplicationRequest - (*StopReplicationResponse)(nil), // 54: tabletmanagerdata.StopReplicationResponse - (*StopReplicationMinimumRequest)(nil), // 55: tabletmanagerdata.StopReplicationMinimumRequest - (*StopReplicationMinimumResponse)(nil), // 56: tabletmanagerdata.StopReplicationMinimumResponse - (*StartReplicationRequest)(nil), // 57: tabletmanagerdata.StartReplicationRequest - (*StartReplicationResponse)(nil), // 58: tabletmanagerdata.StartReplicationResponse - (*StartReplicationUntilAfterRequest)(nil), // 59: tabletmanagerdata.StartReplicationUntilAfterRequest - (*StartReplicationUntilAfterResponse)(nil), // 60: tabletmanagerdata.StartReplicationUntilAfterResponse - (*GetReplicasRequest)(nil), // 61: tabletmanagerdata.GetReplicasRequest - (*GetReplicasResponse)(nil), // 62: tabletmanagerdata.GetReplicasResponse - (*ResetReplicationRequest)(nil), // 63: tabletmanagerdata.ResetReplicationRequest - (*ResetReplicationResponse)(nil), // 64: tabletmanagerdata.ResetReplicationResponse - (*VReplicationExecRequest)(nil), // 65: tabletmanagerdata.VReplicationExecRequest - (*VReplicationExecResponse)(nil), // 66: tabletmanagerdata.VReplicationExecResponse - (*VReplicationWaitForPosRequest)(nil), // 67: tabletmanagerdata.VReplicationWaitForPosRequest - (*VReplicationWaitForPosResponse)(nil), // 68: tabletmanagerdata.VReplicationWaitForPosResponse - (*InitPrimaryRequest)(nil), // 69: tabletmanagerdata.InitPrimaryRequest - (*InitPrimaryResponse)(nil), // 70: tabletmanagerdata.InitPrimaryResponse - (*PopulateReparentJournalRequest)(nil), // 71: tabletmanagerdata.PopulateReparentJournalRequest - (*PopulateReparentJournalResponse)(nil), // 72: tabletmanagerdata.PopulateReparentJournalResponse - (*InitReplicaRequest)(nil), // 73: tabletmanagerdata.InitReplicaRequest - (*InitReplicaResponse)(nil), // 74: tabletmanagerdata.InitReplicaResponse - (*DemotePrimaryRequest)(nil), // 75: tabletmanagerdata.DemotePrimaryRequest - (*DemotePrimaryResponse)(nil), // 76: tabletmanagerdata.DemotePrimaryResponse - (*UndoDemotePrimaryRequest)(nil), // 77: tabletmanagerdata.UndoDemotePrimaryRequest - (*UndoDemotePrimaryResponse)(nil), // 78: tabletmanagerdata.UndoDemotePrimaryResponse - (*ReplicaWasPromotedRequest)(nil), // 79: tabletmanagerdata.ReplicaWasPromotedRequest - (*ReplicaWasPromotedResponse)(nil), // 80: tabletmanagerdata.ReplicaWasPromotedResponse - (*ResetReplicationParametersRequest)(nil), // 81: tabletmanagerdata.ResetReplicationParametersRequest - (*ResetReplicationParametersResponse)(nil), // 82: tabletmanagerdata.ResetReplicationParametersResponse - (*FullStatusRequest)(nil), // 83: tabletmanagerdata.FullStatusRequest - (*FullStatusResponse)(nil), // 84: tabletmanagerdata.FullStatusResponse - (*SetReplicationSourceRequest)(nil), // 85: tabletmanagerdata.SetReplicationSourceRequest - (*SetReplicationSourceResponse)(nil), // 86: tabletmanagerdata.SetReplicationSourceResponse - (*ReplicaWasRestartedRequest)(nil), // 87: tabletmanagerdata.ReplicaWasRestartedRequest - (*ReplicaWasRestartedResponse)(nil), // 88: tabletmanagerdata.ReplicaWasRestartedResponse - (*StopReplicationAndGetStatusRequest)(nil), // 89: tabletmanagerdata.StopReplicationAndGetStatusRequest - (*StopReplicationAndGetStatusResponse)(nil), // 90: tabletmanagerdata.StopReplicationAndGetStatusResponse - (*PromoteReplicaRequest)(nil), // 91: tabletmanagerdata.PromoteReplicaRequest - (*PromoteReplicaResponse)(nil), // 92: tabletmanagerdata.PromoteReplicaResponse - (*BackupRequest)(nil), // 93: tabletmanagerdata.BackupRequest - (*BackupResponse)(nil), // 94: tabletmanagerdata.BackupResponse - (*RestoreFromBackupRequest)(nil), // 95: tabletmanagerdata.RestoreFromBackupRequest - (*RestoreFromBackupResponse)(nil), // 96: tabletmanagerdata.RestoreFromBackupResponse - (*CreateVReplicationWorkflowRequest)(nil), // 97: tabletmanagerdata.CreateVReplicationWorkflowRequest - (*CreateVReplicationWorkflowResponse)(nil), // 98: tabletmanagerdata.CreateVReplicationWorkflowResponse - (*DeleteVReplicationWorkflowRequest)(nil), // 99: tabletmanagerdata.DeleteVReplicationWorkflowRequest - (*DeleteVReplicationWorkflowResponse)(nil), // 100: tabletmanagerdata.DeleteVReplicationWorkflowResponse - (*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 - (*UpdateVReplicationWorkflowsStateRequest)(nil), // 115: tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest - (*UpdateVReplicationWorkflowsStateResponse)(nil), // 116: tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse - (*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 + (TabletSelectionPreference)(0), // 0: tabletmanagerdata.TabletSelectionPreference + (*TableDefinition)(nil), // 1: tabletmanagerdata.TableDefinition + (*SchemaDefinition)(nil), // 2: tabletmanagerdata.SchemaDefinition + (*SchemaChangeResult)(nil), // 3: tabletmanagerdata.SchemaChangeResult + (*UserPermission)(nil), // 4: tabletmanagerdata.UserPermission + (*DbPermission)(nil), // 5: tabletmanagerdata.DbPermission + (*Permissions)(nil), // 6: tabletmanagerdata.Permissions + (*PingRequest)(nil), // 7: tabletmanagerdata.PingRequest + (*PingResponse)(nil), // 8: tabletmanagerdata.PingResponse + (*SleepRequest)(nil), // 9: tabletmanagerdata.SleepRequest + (*SleepResponse)(nil), // 10: tabletmanagerdata.SleepResponse + (*ExecuteHookRequest)(nil), // 11: tabletmanagerdata.ExecuteHookRequest + (*ExecuteHookResponse)(nil), // 12: tabletmanagerdata.ExecuteHookResponse + (*GetSchemaRequest)(nil), // 13: tabletmanagerdata.GetSchemaRequest + (*GetSchemaResponse)(nil), // 14: tabletmanagerdata.GetSchemaResponse + (*GetPermissionsRequest)(nil), // 15: tabletmanagerdata.GetPermissionsRequest + (*GetPermissionsResponse)(nil), // 16: tabletmanagerdata.GetPermissionsResponse + (*SetReadOnlyRequest)(nil), // 17: tabletmanagerdata.SetReadOnlyRequest + (*SetReadOnlyResponse)(nil), // 18: tabletmanagerdata.SetReadOnlyResponse + (*SetReadWriteRequest)(nil), // 19: tabletmanagerdata.SetReadWriteRequest + (*SetReadWriteResponse)(nil), // 20: tabletmanagerdata.SetReadWriteResponse + (*ChangeTypeRequest)(nil), // 21: tabletmanagerdata.ChangeTypeRequest + (*ChangeTypeResponse)(nil), // 22: tabletmanagerdata.ChangeTypeResponse + (*RefreshStateRequest)(nil), // 23: tabletmanagerdata.RefreshStateRequest + (*RefreshStateResponse)(nil), // 24: tabletmanagerdata.RefreshStateResponse + (*RunHealthCheckRequest)(nil), // 25: tabletmanagerdata.RunHealthCheckRequest + (*RunHealthCheckResponse)(nil), // 26: tabletmanagerdata.RunHealthCheckResponse + (*ReloadSchemaRequest)(nil), // 27: tabletmanagerdata.ReloadSchemaRequest + (*ReloadSchemaResponse)(nil), // 28: tabletmanagerdata.ReloadSchemaResponse + (*PreflightSchemaRequest)(nil), // 29: tabletmanagerdata.PreflightSchemaRequest + (*PreflightSchemaResponse)(nil), // 30: tabletmanagerdata.PreflightSchemaResponse + (*ApplySchemaRequest)(nil), // 31: tabletmanagerdata.ApplySchemaRequest + (*ApplySchemaResponse)(nil), // 32: tabletmanagerdata.ApplySchemaResponse + (*LockTablesRequest)(nil), // 33: tabletmanagerdata.LockTablesRequest + (*LockTablesResponse)(nil), // 34: tabletmanagerdata.LockTablesResponse + (*UnlockTablesRequest)(nil), // 35: tabletmanagerdata.UnlockTablesRequest + (*UnlockTablesResponse)(nil), // 36: tabletmanagerdata.UnlockTablesResponse + (*ExecuteQueryRequest)(nil), // 37: tabletmanagerdata.ExecuteQueryRequest + (*ExecuteQueryResponse)(nil), // 38: tabletmanagerdata.ExecuteQueryResponse + (*ExecuteFetchAsDbaRequest)(nil), // 39: tabletmanagerdata.ExecuteFetchAsDbaRequest + (*ExecuteFetchAsDbaResponse)(nil), // 40: tabletmanagerdata.ExecuteFetchAsDbaResponse + (*ExecuteFetchAsAllPrivsRequest)(nil), // 41: tabletmanagerdata.ExecuteFetchAsAllPrivsRequest + (*ExecuteFetchAsAllPrivsResponse)(nil), // 42: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse + (*ExecuteFetchAsAppRequest)(nil), // 43: tabletmanagerdata.ExecuteFetchAsAppRequest + (*ExecuteFetchAsAppResponse)(nil), // 44: tabletmanagerdata.ExecuteFetchAsAppResponse + (*ReplicationStatusRequest)(nil), // 45: tabletmanagerdata.ReplicationStatusRequest + (*ReplicationStatusResponse)(nil), // 46: tabletmanagerdata.ReplicationStatusResponse + (*PrimaryStatusRequest)(nil), // 47: tabletmanagerdata.PrimaryStatusRequest + (*PrimaryStatusResponse)(nil), // 48: tabletmanagerdata.PrimaryStatusResponse + (*PrimaryPositionRequest)(nil), // 49: tabletmanagerdata.PrimaryPositionRequest + (*PrimaryPositionResponse)(nil), // 50: tabletmanagerdata.PrimaryPositionResponse + (*WaitForPositionRequest)(nil), // 51: tabletmanagerdata.WaitForPositionRequest + (*WaitForPositionResponse)(nil), // 52: tabletmanagerdata.WaitForPositionResponse + (*StopReplicationRequest)(nil), // 53: tabletmanagerdata.StopReplicationRequest + (*StopReplicationResponse)(nil), // 54: tabletmanagerdata.StopReplicationResponse + (*StopReplicationMinimumRequest)(nil), // 55: tabletmanagerdata.StopReplicationMinimumRequest + (*StopReplicationMinimumResponse)(nil), // 56: tabletmanagerdata.StopReplicationMinimumResponse + (*StartReplicationRequest)(nil), // 57: tabletmanagerdata.StartReplicationRequest + (*StartReplicationResponse)(nil), // 58: tabletmanagerdata.StartReplicationResponse + (*StartReplicationUntilAfterRequest)(nil), // 59: tabletmanagerdata.StartReplicationUntilAfterRequest + (*StartReplicationUntilAfterResponse)(nil), // 60: tabletmanagerdata.StartReplicationUntilAfterResponse + (*GetReplicasRequest)(nil), // 61: tabletmanagerdata.GetReplicasRequest + (*GetReplicasResponse)(nil), // 62: tabletmanagerdata.GetReplicasResponse + (*ResetReplicationRequest)(nil), // 63: tabletmanagerdata.ResetReplicationRequest + (*ResetReplicationResponse)(nil), // 64: tabletmanagerdata.ResetReplicationResponse + (*VReplicationExecRequest)(nil), // 65: tabletmanagerdata.VReplicationExecRequest + (*VReplicationExecResponse)(nil), // 66: tabletmanagerdata.VReplicationExecResponse + (*VReplicationWaitForPosRequest)(nil), // 67: tabletmanagerdata.VReplicationWaitForPosRequest + (*VReplicationWaitForPosResponse)(nil), // 68: tabletmanagerdata.VReplicationWaitForPosResponse + (*InitPrimaryRequest)(nil), // 69: tabletmanagerdata.InitPrimaryRequest + (*InitPrimaryResponse)(nil), // 70: tabletmanagerdata.InitPrimaryResponse + (*PopulateReparentJournalRequest)(nil), // 71: tabletmanagerdata.PopulateReparentJournalRequest + (*PopulateReparentJournalResponse)(nil), // 72: tabletmanagerdata.PopulateReparentJournalResponse + (*InitReplicaRequest)(nil), // 73: tabletmanagerdata.InitReplicaRequest + (*InitReplicaResponse)(nil), // 74: tabletmanagerdata.InitReplicaResponse + (*DemotePrimaryRequest)(nil), // 75: tabletmanagerdata.DemotePrimaryRequest + (*DemotePrimaryResponse)(nil), // 76: tabletmanagerdata.DemotePrimaryResponse + (*UndoDemotePrimaryRequest)(nil), // 77: tabletmanagerdata.UndoDemotePrimaryRequest + (*UndoDemotePrimaryResponse)(nil), // 78: tabletmanagerdata.UndoDemotePrimaryResponse + (*ReplicaWasPromotedRequest)(nil), // 79: tabletmanagerdata.ReplicaWasPromotedRequest + (*ReplicaWasPromotedResponse)(nil), // 80: tabletmanagerdata.ReplicaWasPromotedResponse + (*ResetReplicationParametersRequest)(nil), // 81: tabletmanagerdata.ResetReplicationParametersRequest + (*ResetReplicationParametersResponse)(nil), // 82: tabletmanagerdata.ResetReplicationParametersResponse + (*FullStatusRequest)(nil), // 83: tabletmanagerdata.FullStatusRequest + (*FullStatusResponse)(nil), // 84: tabletmanagerdata.FullStatusResponse + (*SetReplicationSourceRequest)(nil), // 85: tabletmanagerdata.SetReplicationSourceRequest + (*SetReplicationSourceResponse)(nil), // 86: tabletmanagerdata.SetReplicationSourceResponse + (*ReplicaWasRestartedRequest)(nil), // 87: tabletmanagerdata.ReplicaWasRestartedRequest + (*ReplicaWasRestartedResponse)(nil), // 88: tabletmanagerdata.ReplicaWasRestartedResponse + (*StopReplicationAndGetStatusRequest)(nil), // 89: tabletmanagerdata.StopReplicationAndGetStatusRequest + (*StopReplicationAndGetStatusResponse)(nil), // 90: tabletmanagerdata.StopReplicationAndGetStatusResponse + (*PromoteReplicaRequest)(nil), // 91: tabletmanagerdata.PromoteReplicaRequest + (*PromoteReplicaResponse)(nil), // 92: tabletmanagerdata.PromoteReplicaResponse + (*BackupRequest)(nil), // 93: tabletmanagerdata.BackupRequest + (*BackupResponse)(nil), // 94: tabletmanagerdata.BackupResponse + (*RestoreFromBackupRequest)(nil), // 95: tabletmanagerdata.RestoreFromBackupRequest + (*RestoreFromBackupResponse)(nil), // 96: tabletmanagerdata.RestoreFromBackupResponse + (*CreateVReplicationWorkflowRequest)(nil), // 97: tabletmanagerdata.CreateVReplicationWorkflowRequest + (*CreateVReplicationWorkflowResponse)(nil), // 98: tabletmanagerdata.CreateVReplicationWorkflowResponse + (*DeleteVReplicationWorkflowRequest)(nil), // 99: tabletmanagerdata.DeleteVReplicationWorkflowRequest + (*DeleteVReplicationWorkflowResponse)(nil), // 100: tabletmanagerdata.DeleteVReplicationWorkflowResponse + (*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{ 125, // 0: tabletmanagerdata.TableDefinition.fields:type_name -> query.Field @@ -7603,8 +7603,8 @@ var file_tabletmanagerdata_proto_depIdxs = []int32{ 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.UpdateVReplicationWorkflowsStateRequest.state:type_name -> binlogdata.VReplicationWorkflowState - 128, // 63: tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse.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 @@ -8993,7 +8993,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[114].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateVReplicationWorkflowsStateRequest); i { + switch v := v.(*UpdateVReplicationWorkflowsRequest); i { case 0: return &v.state case 1: @@ -9005,7 +9005,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[115].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateVReplicationWorkflowsStateResponse); i { + switch v := v.(*UpdateVReplicationWorkflowsResponse); i { case 0: return &v.state case 1: diff --git a/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go b/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go index 24af138b390..25483660fe2 100644 --- a/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go +++ b/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go @@ -2296,11 +2296,11 @@ func (m *UpdateVReplicationWorkflowResponse) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *UpdateVReplicationWorkflowsStateRequest) CloneVT() *UpdateVReplicationWorkflowsStateRequest { +func (m *UpdateVReplicationWorkflowsRequest) CloneVT() *UpdateVReplicationWorkflowsRequest { if m == nil { - return (*UpdateVReplicationWorkflowsStateRequest)(nil) + return (*UpdateVReplicationWorkflowsRequest)(nil) } - r := &UpdateVReplicationWorkflowsStateRequest{ + r := &UpdateVReplicationWorkflowsRequest{ AllWorkflows: m.AllWorkflows, State: m.State, Message: m.Message, @@ -2323,15 +2323,15 @@ func (m *UpdateVReplicationWorkflowsStateRequest) CloneVT() *UpdateVReplicationW return r } -func (m *UpdateVReplicationWorkflowsStateRequest) CloneMessageVT() proto.Message { +func (m *UpdateVReplicationWorkflowsRequest) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *UpdateVReplicationWorkflowsStateResponse) CloneVT() *UpdateVReplicationWorkflowsStateResponse { +func (m *UpdateVReplicationWorkflowsResponse) CloneVT() *UpdateVReplicationWorkflowsResponse { if m == nil { - return (*UpdateVReplicationWorkflowsStateResponse)(nil) + return (*UpdateVReplicationWorkflowsResponse)(nil) } - r := &UpdateVReplicationWorkflowsStateResponse{ + r := &UpdateVReplicationWorkflowsResponse{ Result: m.Result.CloneVT(), } if len(m.unknownFields) > 0 { @@ -2341,7 +2341,7 @@ func (m *UpdateVReplicationWorkflowsStateResponse) CloneVT() *UpdateVReplication return r } -func (m *UpdateVReplicationWorkflowsStateResponse) CloneMessageVT() proto.Message { +func (m *UpdateVReplicationWorkflowsResponse) CloneMessageVT() proto.Message { return m.CloneVT() } @@ -7953,7 +7953,7 @@ func (m *UpdateVReplicationWorkflowResponse) MarshalToSizedBufferVT(dAtA []byte) return len(dAtA) - i, nil } -func (m *UpdateVReplicationWorkflowsStateRequest) MarshalVT() (dAtA []byte, err error) { +func (m *UpdateVReplicationWorkflowsRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -7966,12 +7966,12 @@ func (m *UpdateVReplicationWorkflowsStateRequest) MarshalVT() (dAtA []byte, err return dAtA[:n], nil } -func (m *UpdateVReplicationWorkflowsStateRequest) MarshalToVT(dAtA []byte) (int, error) { +func (m *UpdateVReplicationWorkflowsRequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *UpdateVReplicationWorkflowsStateRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *UpdateVReplicationWorkflowsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -8033,7 +8033,7 @@ func (m *UpdateVReplicationWorkflowsStateRequest) MarshalToSizedBufferVT(dAtA [] return len(dAtA) - i, nil } -func (m *UpdateVReplicationWorkflowsStateResponse) MarshalVT() (dAtA []byte, err error) { +func (m *UpdateVReplicationWorkflowsResponse) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -8046,12 +8046,12 @@ func (m *UpdateVReplicationWorkflowsStateResponse) MarshalVT() (dAtA []byte, err return dAtA[:n], nil } -func (m *UpdateVReplicationWorkflowsStateResponse) MarshalToVT(dAtA []byte) (int, error) { +func (m *UpdateVReplicationWorkflowsResponse) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *UpdateVReplicationWorkflowsStateResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *UpdateVReplicationWorkflowsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -10238,7 +10238,7 @@ func (m *UpdateVReplicationWorkflowResponse) SizeVT() (n int) { return n } -func (m *UpdateVReplicationWorkflowsStateRequest) SizeVT() (n int) { +func (m *UpdateVReplicationWorkflowsRequest) SizeVT() (n int) { if m == nil { return 0 } @@ -10274,7 +10274,7 @@ func (m *UpdateVReplicationWorkflowsStateRequest) SizeVT() (n int) { return n } -func (m *UpdateVReplicationWorkflowsStateResponse) SizeVT() (n int) { +func (m *UpdateVReplicationWorkflowsResponse) SizeVT() (n int) { if m == nil { return 0 } @@ -22543,7 +22543,7 @@ func (m *UpdateVReplicationWorkflowResponse) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *UpdateVReplicationWorkflowsStateRequest) UnmarshalVT(dAtA []byte) error { +func (m *UpdateVReplicationWorkflowsRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -22566,10 +22566,10 @@ func (m *UpdateVReplicationWorkflowsStateRequest) UnmarshalVT(dAtA []byte) error fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: UpdateVReplicationWorkflowsStateRequest: wiretype end group for non-group") + return fmt.Errorf("proto: UpdateVReplicationWorkflowsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateVReplicationWorkflowsStateRequest: 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: @@ -22761,7 +22761,7 @@ func (m *UpdateVReplicationWorkflowsStateRequest) UnmarshalVT(dAtA []byte) error } return nil } -func (m *UpdateVReplicationWorkflowsStateResponse) UnmarshalVT(dAtA []byte) error { +func (m *UpdateVReplicationWorkflowsResponse) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -22784,10 +22784,10 @@ func (m *UpdateVReplicationWorkflowsStateResponse) UnmarshalVT(dAtA []byte) erro fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: UpdateVReplicationWorkflowsStateResponse: wiretype end group for non-group") + return fmt.Errorf("proto: UpdateVReplicationWorkflowsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateVReplicationWorkflowsStateResponse: 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 96680d69daa..eb4e76c551a 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, 0xfd, 0x2f, 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, @@ -302,251 +302,250 @@ var file_tabletmanagerservice_proto_rawDesc = []byte{ 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, 0x9d, 0x01, 0x0a, 0x20, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, + 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, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3a, 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, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3b, 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, 0x53, 0x74, 0x61, 0x74, 0x65, 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, + 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, + 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, 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, 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, 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, + 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, 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, 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, + 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, 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, 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, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 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, 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, 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, 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, + 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, + 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{}{ - (*tabletmanagerdata.PingRequest)(nil), // 0: tabletmanagerdata.PingRequest - (*tabletmanagerdata.SleepRequest)(nil), // 1: tabletmanagerdata.SleepRequest - (*tabletmanagerdata.ExecuteHookRequest)(nil), // 2: tabletmanagerdata.ExecuteHookRequest - (*tabletmanagerdata.GetSchemaRequest)(nil), // 3: tabletmanagerdata.GetSchemaRequest - (*tabletmanagerdata.GetPermissionsRequest)(nil), // 4: tabletmanagerdata.GetPermissionsRequest - (*tabletmanagerdata.SetReadOnlyRequest)(nil), // 5: tabletmanagerdata.SetReadOnlyRequest - (*tabletmanagerdata.SetReadWriteRequest)(nil), // 6: tabletmanagerdata.SetReadWriteRequest - (*tabletmanagerdata.ChangeTypeRequest)(nil), // 7: tabletmanagerdata.ChangeTypeRequest - (*tabletmanagerdata.RefreshStateRequest)(nil), // 8: tabletmanagerdata.RefreshStateRequest - (*tabletmanagerdata.RunHealthCheckRequest)(nil), // 9: tabletmanagerdata.RunHealthCheckRequest - (*tabletmanagerdata.ReloadSchemaRequest)(nil), // 10: tabletmanagerdata.ReloadSchemaRequest - (*tabletmanagerdata.PreflightSchemaRequest)(nil), // 11: tabletmanagerdata.PreflightSchemaRequest - (*tabletmanagerdata.ApplySchemaRequest)(nil), // 12: tabletmanagerdata.ApplySchemaRequest - (*tabletmanagerdata.ResetSequencesRequest)(nil), // 13: tabletmanagerdata.ResetSequencesRequest - (*tabletmanagerdata.LockTablesRequest)(nil), // 14: tabletmanagerdata.LockTablesRequest - (*tabletmanagerdata.UnlockTablesRequest)(nil), // 15: tabletmanagerdata.UnlockTablesRequest - (*tabletmanagerdata.ExecuteQueryRequest)(nil), // 16: tabletmanagerdata.ExecuteQueryRequest - (*tabletmanagerdata.ExecuteFetchAsDbaRequest)(nil), // 17: tabletmanagerdata.ExecuteFetchAsDbaRequest - (*tabletmanagerdata.ExecuteFetchAsAllPrivsRequest)(nil), // 18: tabletmanagerdata.ExecuteFetchAsAllPrivsRequest - (*tabletmanagerdata.ExecuteFetchAsAppRequest)(nil), // 19: tabletmanagerdata.ExecuteFetchAsAppRequest - (*tabletmanagerdata.ReplicationStatusRequest)(nil), // 20: tabletmanagerdata.ReplicationStatusRequest - (*tabletmanagerdata.PrimaryStatusRequest)(nil), // 21: tabletmanagerdata.PrimaryStatusRequest - (*tabletmanagerdata.PrimaryPositionRequest)(nil), // 22: tabletmanagerdata.PrimaryPositionRequest - (*tabletmanagerdata.WaitForPositionRequest)(nil), // 23: tabletmanagerdata.WaitForPositionRequest - (*tabletmanagerdata.StopReplicationRequest)(nil), // 24: tabletmanagerdata.StopReplicationRequest - (*tabletmanagerdata.StopReplicationMinimumRequest)(nil), // 25: tabletmanagerdata.StopReplicationMinimumRequest - (*tabletmanagerdata.StartReplicationRequest)(nil), // 26: tabletmanagerdata.StartReplicationRequest - (*tabletmanagerdata.StartReplicationUntilAfterRequest)(nil), // 27: tabletmanagerdata.StartReplicationUntilAfterRequest - (*tabletmanagerdata.GetReplicasRequest)(nil), // 28: tabletmanagerdata.GetReplicasRequest - (*tabletmanagerdata.CreateVReplicationWorkflowRequest)(nil), // 29: tabletmanagerdata.CreateVReplicationWorkflowRequest - (*tabletmanagerdata.DeleteVReplicationWorkflowRequest)(nil), // 30: tabletmanagerdata.DeleteVReplicationWorkflowRequest - (*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.UpdateVReplicationWorkflowsStateRequest)(nil), // 37: tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest - (*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.UpdateVReplicationWorkflowsStateResponse)(nil), // 92: tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse - (*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 + (*tabletmanagerdata.PingRequest)(nil), // 0: tabletmanagerdata.PingRequest + (*tabletmanagerdata.SleepRequest)(nil), // 1: tabletmanagerdata.SleepRequest + (*tabletmanagerdata.ExecuteHookRequest)(nil), // 2: tabletmanagerdata.ExecuteHookRequest + (*tabletmanagerdata.GetSchemaRequest)(nil), // 3: tabletmanagerdata.GetSchemaRequest + (*tabletmanagerdata.GetPermissionsRequest)(nil), // 4: tabletmanagerdata.GetPermissionsRequest + (*tabletmanagerdata.SetReadOnlyRequest)(nil), // 5: tabletmanagerdata.SetReadOnlyRequest + (*tabletmanagerdata.SetReadWriteRequest)(nil), // 6: tabletmanagerdata.SetReadWriteRequest + (*tabletmanagerdata.ChangeTypeRequest)(nil), // 7: tabletmanagerdata.ChangeTypeRequest + (*tabletmanagerdata.RefreshStateRequest)(nil), // 8: tabletmanagerdata.RefreshStateRequest + (*tabletmanagerdata.RunHealthCheckRequest)(nil), // 9: tabletmanagerdata.RunHealthCheckRequest + (*tabletmanagerdata.ReloadSchemaRequest)(nil), // 10: tabletmanagerdata.ReloadSchemaRequest + (*tabletmanagerdata.PreflightSchemaRequest)(nil), // 11: tabletmanagerdata.PreflightSchemaRequest + (*tabletmanagerdata.ApplySchemaRequest)(nil), // 12: tabletmanagerdata.ApplySchemaRequest + (*tabletmanagerdata.ResetSequencesRequest)(nil), // 13: tabletmanagerdata.ResetSequencesRequest + (*tabletmanagerdata.LockTablesRequest)(nil), // 14: tabletmanagerdata.LockTablesRequest + (*tabletmanagerdata.UnlockTablesRequest)(nil), // 15: tabletmanagerdata.UnlockTablesRequest + (*tabletmanagerdata.ExecuteQueryRequest)(nil), // 16: tabletmanagerdata.ExecuteQueryRequest + (*tabletmanagerdata.ExecuteFetchAsDbaRequest)(nil), // 17: tabletmanagerdata.ExecuteFetchAsDbaRequest + (*tabletmanagerdata.ExecuteFetchAsAllPrivsRequest)(nil), // 18: tabletmanagerdata.ExecuteFetchAsAllPrivsRequest + (*tabletmanagerdata.ExecuteFetchAsAppRequest)(nil), // 19: tabletmanagerdata.ExecuteFetchAsAppRequest + (*tabletmanagerdata.ReplicationStatusRequest)(nil), // 20: tabletmanagerdata.ReplicationStatusRequest + (*tabletmanagerdata.PrimaryStatusRequest)(nil), // 21: tabletmanagerdata.PrimaryStatusRequest + (*tabletmanagerdata.PrimaryPositionRequest)(nil), // 22: tabletmanagerdata.PrimaryPositionRequest + (*tabletmanagerdata.WaitForPositionRequest)(nil), // 23: tabletmanagerdata.WaitForPositionRequest + (*tabletmanagerdata.StopReplicationRequest)(nil), // 24: tabletmanagerdata.StopReplicationRequest + (*tabletmanagerdata.StopReplicationMinimumRequest)(nil), // 25: tabletmanagerdata.StopReplicationMinimumRequest + (*tabletmanagerdata.StartReplicationRequest)(nil), // 26: tabletmanagerdata.StartReplicationRequest + (*tabletmanagerdata.StartReplicationUntilAfterRequest)(nil), // 27: tabletmanagerdata.StartReplicationUntilAfterRequest + (*tabletmanagerdata.GetReplicasRequest)(nil), // 28: tabletmanagerdata.GetReplicasRequest + (*tabletmanagerdata.CreateVReplicationWorkflowRequest)(nil), // 29: tabletmanagerdata.CreateVReplicationWorkflowRequest + (*tabletmanagerdata.DeleteVReplicationWorkflowRequest)(nil), // 30: tabletmanagerdata.DeleteVReplicationWorkflowRequest + (*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 @@ -586,7 +585,7 @@ var file_tabletmanagerservice_proto_depIdxs = []int32{ 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.UpdateVReplicationWorkflowsState:input_type -> tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + 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 @@ -641,7 +640,7 @@ var file_tabletmanagerservice_proto_depIdxs = []int32{ 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.UpdateVReplicationWorkflowsState:output_type -> tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + 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 diff --git a/go/vt/proto/tabletmanagerservice/tabletmanagerservice_grpc.pb.go b/go/vt/proto/tabletmanagerservice/tabletmanagerservice_grpc.pb.go index 6db6ac90edb..8319eec908a 100644 --- a/go/vt/proto/tabletmanagerservice/tabletmanagerservice_grpc.pb.go +++ b/go/vt/proto/tabletmanagerservice/tabletmanagerservice_grpc.pb.go @@ -78,7 +78,7 @@ type TabletManagerClient interface { 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) - UpdateVReplicationWorkflowsState(ctx context.Context, in *tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest, opts ...grpc.CallOption) (*tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse, 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 @@ -457,9 +457,9 @@ func (c *tabletManagerClient) UpdateVReplicationWorkflow(ctx context.Context, in return out, nil } -func (c *tabletManagerClient) UpdateVReplicationWorkflowsState(ctx context.Context, in *tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest, opts ...grpc.CallOption) (*tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse, error) { - out := new(tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse) - err := c.cc.Invoke(ctx, "/tabletmanagerservice.TabletManager/UpdateVReplicationWorkflowsState", in, out, opts...) +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 } @@ -724,7 +724,7 @@ type TabletManagerServer interface { VReplicationExec(context.Context, *tabletmanagerdata.VReplicationExecRequest) (*tabletmanagerdata.VReplicationExecResponse, error) VReplicationWaitForPos(context.Context, *tabletmanagerdata.VReplicationWaitForPosRequest) (*tabletmanagerdata.VReplicationWaitForPosResponse, error) UpdateVReplicationWorkflow(context.Context, *tabletmanagerdata.UpdateVReplicationWorkflowRequest) (*tabletmanagerdata.UpdateVReplicationWorkflowResponse, error) - UpdateVReplicationWorkflowsState(context.Context, *tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest) (*tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse, 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 @@ -878,8 +878,8 @@ 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) UpdateVReplicationWorkflowsState(context.Context, *tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest) (*tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateVReplicationWorkflowsState 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") @@ -1611,20 +1611,20 @@ func _TabletManager_UpdateVReplicationWorkflow_Handler(srv interface{}, ctx cont return interceptor(ctx, in, info, handler) } -func _TabletManager_UpdateVReplicationWorkflowsState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest) +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).UpdateVReplicationWorkflowsState(ctx, in) + return srv.(TabletManagerServer).UpdateVReplicationWorkflows(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/tabletmanagerservice.TabletManager/UpdateVReplicationWorkflowsState", + FullMethod: "/tabletmanagerservice.TabletManager/UpdateVReplicationWorkflows", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TabletManagerServer).UpdateVReplicationWorkflowsState(ctx, req.(*tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest)) + return srv.(TabletManagerServer).UpdateVReplicationWorkflows(ctx, req.(*tabletmanagerdata.UpdateVReplicationWorkflowsRequest)) } return interceptor(ctx, in, info, handler) } @@ -2097,8 +2097,8 @@ var TabletManager_ServiceDesc = grpc.ServiceDesc{ Handler: _TabletManager_UpdateVReplicationWorkflow_Handler, }, { - MethodName: "UpdateVReplicationWorkflowsState", - Handler: _TabletManager_UpdateVReplicationWorkflowsState_Handler, + MethodName: "UpdateVReplicationWorkflows", + Handler: _TabletManager_UpdateVReplicationWorkflows_Handler, }, { MethodName: "VDiff", diff --git a/go/vt/vtcombo/tablet_map.go b/go/vt/vtcombo/tablet_map.go index fb598123425..a510c5889a4 100644 --- a/go/vt/vtcombo/tablet_map.go +++ b/go/vt/vtcombo/tablet_map.go @@ -897,7 +897,7 @@ func (itmc *internalTabletManagerClient) UpdateVReplicationWorkflow(context.Cont return nil, fmt.Errorf("not implemented in vtcombo") } -func (itmc *internalTabletManagerClient) UpdateVReplicationWorkflowsState(context.Context, *topodatapb.Tablet, *tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsStateResponse, error) { +func (itmc *internalTabletManagerClient) UpdateVReplicationWorkflows(context.Context, *topodatapb.Tablet, *tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsResponse, error) { return nil, fmt.Errorf("not implemented in vtcombo") } diff --git a/go/vt/vtctl/workflow/resharder.go b/go/vt/vtctl/workflow/resharder.go index 5919aeb4789..2ccff028377 100644 --- a/go/vt/vtctl/workflow/resharder.go +++ b/go/vt/vtctl/workflow/resharder.go @@ -327,15 +327,15 @@ 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. - req := &tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest{ + 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.UpdateVReplicationWorkflowsState(ctx, targetPrimary.Tablet, req); err != nil { - return vterrors.Wrapf(err, "UpdateVReplicationWorkflowsState(%v, 'state='%s')", + 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/vttablet/faketmclient/fake_client.go b/go/vt/vttablet/faketmclient/fake_client.go index e8d1954d259..e595a4edeea 100644 --- a/go/vt/vttablet/faketmclient/fake_client.go +++ b/go/vt/vttablet/faketmclient/fake_client.go @@ -90,7 +90,7 @@ func (client *FakeTabletManagerClient) UpdateVReplicationWorkflow(ctx context.Co return nil, nil } -func (client *FakeTabletManagerClient) UpdateVReplicationWorkflowsState(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsStateResponse, error) { +func (client *FakeTabletManagerClient) UpdateVReplicationWorkflows(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsResponse, error) { return nil, nil } diff --git a/go/vt/vttablet/grpctmclient/client.go b/go/vt/vttablet/grpctmclient/client.go index 57d046d53ac..efd6ebdcc61 100644 --- a/go/vt/vttablet/grpctmclient/client.go +++ b/go/vt/vttablet/grpctmclient/client.go @@ -816,13 +816,13 @@ func (client *Client) UpdateVReplicationWorkflow(ctx context.Context, tablet *to return response, nil } -func (client *Client) UpdateVReplicationWorkflowsState(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsStateResponse, error) { +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.UpdateVReplicationWorkflowsState(ctx, request) + response, err := c.UpdateVReplicationWorkflows(ctx, request) if err != nil { return nil, err } diff --git a/go/vt/vttablet/grpctmserver/server.go b/go/vt/vttablet/grpctmserver/server.go index 89ed3032183..c521d00d683 100644 --- a/go/vt/vttablet/grpctmserver/server.go +++ b/go/vt/vttablet/grpctmserver/server.go @@ -410,11 +410,11 @@ func (s *server) UpdateVReplicationWorkflow(ctx context.Context, request *tablet return s.tm.UpdateVReplicationWorkflow(ctx, request) } -func (s *server) UpdateVReplicationWorkflowsState(ctx context.Context, request *tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest) (response *tabletmanagerdatapb.UpdateVReplicationWorkflowsStateResponse, err error) { - defer s.tm.HandleRPCPanic(ctx, "UpdateVReplicationWorkflowsState", request, response, true /*verbose*/, &err) +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.UpdateVReplicationWorkflowsStateResponse{} - return s.tm.UpdateVReplicationWorkflowsState(ctx, request) + response = &tabletmanagerdatapb.UpdateVReplicationWorkflowsResponse{} + return s.tm.UpdateVReplicationWorkflows(ctx, request) } func (s *server) VDiff(ctx context.Context, request *tabletmanagerdatapb.VDiffRequest) (response *tabletmanagerdatapb.VDiffResponse, err error) { diff --git a/go/vt/vttablet/tabletmanager/rpc_agent.go b/go/vt/vttablet/tabletmanager/rpc_agent.go index 4e951da60f0..b49dddf026b 100644 --- a/go/vt/vttablet/tabletmanager/rpc_agent.go +++ b/go/vt/vttablet/tabletmanager/rpc_agent.go @@ -107,7 +107,7 @@ type RPCTM interface { 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) - UpdateVReplicationWorkflowsState(ctx context.Context, req *tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsStateResponse, 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 72fba028368..4e83e2cea63 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -56,9 +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 state values for multiple workflows. The final format specifier is - // used to optionally add any additional predicates to the query. - sqlUpdateVReplicationWorkflowsState = "update /*vt+ ALLOW_UNSAFE_VREPLICATION_WRITE */ %s.vreplication set%s where db_name = '%s'%s" + // Update metadata/flowcontrol 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) { @@ -538,17 +543,57 @@ func (tm *TabletManager) UpdateVReplicationWorkflow(ctx context.Context, req *ta }, nil } -// UpdateVReplicationWorkflowsState operates in much the same way that -// UpdateVReplicationWorkflow does, but it allows you to update the state -// related fields -- state, message, stop_pos -- for multiple workflows. +// 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) UpdateVReplicationWorkflowsState(ctx context.Context, req *tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsStateResponse, error) { +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. + uq, err := tm.Env.Parser().ReplaceTableQualifiers(query, sidecar.DefaultName, sidecar.GetName()) + if err != nil { + return nil, err + } + qr, err := tm.VREngine.ExecWithDBA(uq) + if err != nil { + return nil, err + } + return sqltypes.ResultToProto3(qr), nil +} + +// VReplicationWaitForPos waits for the specified position. +func (tm *TabletManager) VReplicationWaitForPos(ctx context.Context, id int32, pos string) error { + return tm.VREngine.WaitForPos(ctx, id, pos) +} + +// 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 nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "cannot specify all workflows along with either of include or exclude workflows") + return "", errAllWithIncludeExcludeWorkflows } if textutil.ValueIsSimulatedNull(req.GetState()) && textutil.ValueIsSimulatedNull(req.GetMessage()) && textutil.ValueIsSimulatedNull(req.GetStopPosition()) { - return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "no state fields values to update") + return "", errNoFieldsToUpdate } sets := strings.Builder{} predicates := strings.Builder{} @@ -557,7 +602,7 @@ func (tm *TabletManager) UpdateVReplicationWorkflowsState(ctx context.Context, r if !textutil.ValueIsSimulatedNull(req.GetState()) { state, ok := binlogdatapb.VReplicationWorkflowState_name[int32(req.GetState())] if !ok { - return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "invalid state value: %v", req.GetState()) + return "", vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "invalid state value: %v", req.GetState()) } sets.WriteString(" state = ") sets.WriteString(sqltypes.EncodeStringSQL(state)) @@ -598,35 +643,6 @@ func (tm *TabletManager) UpdateVReplicationWorkflowsState(ctx context.Context, r } predicates.WriteByte(')') } - - query := sqlparser.BuildParsedQuery(sqlUpdateVReplicationWorkflowsState, sidecar.GetIdentifier(), sets.String(), tm.DBConfigs.DBName, predicates.String()).Query - res, err := tm.VREngine.Exec(query) - if err != nil { - return nil, err - } - - return &tabletmanagerdatapb.UpdateVReplicationWorkflowsStateResponse{ - 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. - uq, err := tm.Env.Parser().ReplaceTableQualifiers(query, sidecar.DefaultName, sidecar.GetName()) - if err != nil { - return nil, err - } - qr, err := tm.VREngine.ExecWithDBA(uq) - if err != nil { - return nil, err - } - return sqltypes.ResultToProto3(qr), nil -} - -// VReplicationWaitForPos waits for the specified position. -func (tm *TabletManager) VReplicationWaitForPos(ctx context.Context, id int32, pos string) error { - return tm.VREngine.WaitForPos(ctx, id, pos) + query := sqlparser.BuildParsedQuery(sqlUpdateVReplicationWorkflows, sidecar.GetIdentifier(), sets.String(), tm.DBConfigs.DBName, predicates.String()).Query + return query, nil } diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go index 43083183164..d32e50dc039 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go @@ -34,6 +34,7 @@ import ( "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" @@ -697,7 +698,7 @@ func TestUpdateVReplicationWorkflow(t *testing.T) { } } -func TestUpdateVReplicationWorkflowsState(t *testing.T) { +func TestUpdateVReplicationWorkflows(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() keyspace := "testks" @@ -713,12 +714,12 @@ func TestUpdateVReplicationWorkflowsState(t *testing.T) { tests := []struct { name string - request *tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest + request *tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest query string }{ { name: "update only state=running for all workflows", - request: &tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest{ + request: &tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest{ AllWorkflows: true, State: binlogdatapb.VReplicationWorkflowState_Running, Message: textutil.SimulatedNullString, @@ -728,7 +729,7 @@ func TestUpdateVReplicationWorkflowsState(t *testing.T) { }, { name: "update only state=running for all but reverse workflows", - request: &tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest{ + request: &tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest{ ExcludeWorkflows: []string{workflow.ReverseWorkflowName("testwf")}, State: binlogdatapb.VReplicationWorkflowState_Running, Message: textutil.SimulatedNullString, @@ -738,7 +739,7 @@ func TestUpdateVReplicationWorkflowsState(t *testing.T) { }, { name: "update all vals for all workflows", - request: &tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest{ + request: &tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest{ AllWorkflows: true, State: binlogdatapb.VReplicationWorkflowState_Running, Message: "hi", @@ -748,7 +749,7 @@ func TestUpdateVReplicationWorkflowsState(t *testing.T) { }, { name: "update state=stopped, messege=for vdiff for two workflows", - request: &tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest{ + request: &tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest{ IncludeWorkflows: []string{"testwf", "testwf2"}, State: binlogdatapb.VReplicationWorkflowState_Running, Message: textutil.SimulatedNullString, @@ -793,7 +794,7 @@ func TestUpdateVReplicationWorkflowsState(t *testing.T) { // 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.UpdateVReplicationWorkflowsState(ctx, tt.request) + _, err := tenv.tmc.tablets[tabletUID].tm.UpdateVReplicationWorkflows(ctx, tt.request) tenv.tmc.tablets[tabletUID].vrdbClient.Wait() require.ErrorIs(t, err, errShortCircuit) }) @@ -3163,3 +3164,88 @@ func TestMaterializerNoVindexInExpression(t *testing.T) { err = ws.Materialize(ctx, ms) require.EqualError(t, err, strings.Join(errs, "\n")) } + +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 54bc6d90975..24e5286a994 100644 --- a/go/vt/vttablet/tmclient/rpc_client_api.go +++ b/go/vt/vttablet/tmclient/rpc_client_api.go @@ -181,7 +181,7 @@ type TabletManagerClient interface { 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) - UpdateVReplicationWorkflowsState(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsStateResponse, 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 5079f4bc7d2..7e8460ca153 100644 --- a/go/vt/vttablet/tmrpctest/test_tm_rpc.go +++ b/go/vt/vttablet/tmrpctest/test_tm_rpc.go @@ -85,7 +85,7 @@ func (fra *fakeRPCTM) UpdateVReplicationWorkflow(ctx context.Context, req *table panic("implement me") } -func (fra *fakeRPCTM) UpdateVReplicationWorkflowsState(ctx context.Context, req *tabletmanagerdatapb.UpdateVReplicationWorkflowsStateRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsStateResponse, error) { +func (fra *fakeRPCTM) UpdateVReplicationWorkflows(ctx context.Context, req *tabletmanagerdatapb.UpdateVReplicationWorkflowsRequest) (*tabletmanagerdatapb.UpdateVReplicationWorkflowsResponse, error) { //TODO implement me panic("implement me") } diff --git a/proto/tabletmanagerdata.proto b/proto/tabletmanagerdata.proto index af17601c72d..8645d261f45 100644 --- a/proto/tabletmanagerdata.proto +++ b/proto/tabletmanagerdata.proto @@ -667,7 +667,7 @@ message UpdateVReplicationWorkflowResponse { query.QueryResult result = 1; } -message UpdateVReplicationWorkflowsStateRequest { +message UpdateVReplicationWorkflowsRequest { bool all_workflows = 1; repeated string include_workflows = 2; repeated string exclude_workflows = 3; @@ -676,7 +676,7 @@ message UpdateVReplicationWorkflowsStateRequest { string stop_position = 6; } -message UpdateVReplicationWorkflowsStateResponse { +message UpdateVReplicationWorkflowsResponse { query.QueryResult result = 1; } diff --git a/proto/tabletmanagerservice.proto b/proto/tabletmanagerservice.proto index ccd4d159163..084f37615c0 100644 --- a/proto/tabletmanagerservice.proto +++ b/proto/tabletmanagerservice.proto @@ -122,7 +122,7 @@ service TabletManager { rpc VReplicationExec(tabletmanagerdata.VReplicationExecRequest) returns(tabletmanagerdata.VReplicationExecResponse) {}; rpc VReplicationWaitForPos(tabletmanagerdata.VReplicationWaitForPosRequest) returns(tabletmanagerdata.VReplicationWaitForPosResponse) {}; rpc UpdateVReplicationWorkflow(tabletmanagerdata.UpdateVReplicationWorkflowRequest) returns(tabletmanagerdata.UpdateVReplicationWorkflowResponse) {}; - rpc UpdateVReplicationWorkflowsState(tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest) returns(tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse) {}; + 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 7f65840ab88..285808a5035 100644 --- a/web/vtadmin/src/proto/vtadmin.d.ts +++ b/web/vtadmin/src/proto/vtadmin.d.ts @@ -29561,224 +29561,224 @@ export namespace tabletmanagerdata { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateVReplicationWorkflowsStateRequest. */ - interface IUpdateVReplicationWorkflowsStateRequest { + /** Properties of an UpdateVReplicationWorkflowsRequest. */ + interface IUpdateVReplicationWorkflowsRequest { - /** UpdateVReplicationWorkflowsStateRequest all_workflows */ + /** UpdateVReplicationWorkflowsRequest all_workflows */ all_workflows?: (boolean|null); - /** UpdateVReplicationWorkflowsStateRequest include_workflows */ + /** UpdateVReplicationWorkflowsRequest include_workflows */ include_workflows?: (string[]|null); - /** UpdateVReplicationWorkflowsStateRequest exclude_workflows */ + /** UpdateVReplicationWorkflowsRequest exclude_workflows */ exclude_workflows?: (string[]|null); - /** UpdateVReplicationWorkflowsStateRequest state */ + /** UpdateVReplicationWorkflowsRequest state */ state?: (binlogdata.VReplicationWorkflowState|null); - /** UpdateVReplicationWorkflowsStateRequest message */ + /** UpdateVReplicationWorkflowsRequest message */ message?: (string|null); - /** UpdateVReplicationWorkflowsStateRequest stop_position */ + /** UpdateVReplicationWorkflowsRequest stop_position */ stop_position?: (string|null); } - /** Represents an UpdateVReplicationWorkflowsStateRequest. */ - class UpdateVReplicationWorkflowsStateRequest implements IUpdateVReplicationWorkflowsStateRequest { + /** Represents an UpdateVReplicationWorkflowsRequest. */ + class UpdateVReplicationWorkflowsRequest implements IUpdateVReplicationWorkflowsRequest { /** - * Constructs a new UpdateVReplicationWorkflowsStateRequest. + * Constructs a new UpdateVReplicationWorkflowsRequest. * @param [properties] Properties to set */ - constructor(properties?: tabletmanagerdata.IUpdateVReplicationWorkflowsStateRequest); + constructor(properties?: tabletmanagerdata.IUpdateVReplicationWorkflowsRequest); - /** UpdateVReplicationWorkflowsStateRequest all_workflows. */ + /** UpdateVReplicationWorkflowsRequest all_workflows. */ public all_workflows: boolean; - /** UpdateVReplicationWorkflowsStateRequest include_workflows. */ + /** UpdateVReplicationWorkflowsRequest include_workflows. */ public include_workflows: string[]; - /** UpdateVReplicationWorkflowsStateRequest exclude_workflows. */ + /** UpdateVReplicationWorkflowsRequest exclude_workflows. */ public exclude_workflows: string[]; - /** UpdateVReplicationWorkflowsStateRequest state. */ + /** UpdateVReplicationWorkflowsRequest state. */ public state: binlogdata.VReplicationWorkflowState; - /** UpdateVReplicationWorkflowsStateRequest message. */ + /** UpdateVReplicationWorkflowsRequest message. */ public message: string; - /** UpdateVReplicationWorkflowsStateRequest stop_position. */ + /** UpdateVReplicationWorkflowsRequest stop_position. */ public stop_position: string; /** - * Creates a new UpdateVReplicationWorkflowsStateRequest instance using the specified properties. + * Creates a new UpdateVReplicationWorkflowsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateVReplicationWorkflowsStateRequest instance + * @returns UpdateVReplicationWorkflowsRequest instance */ - public static create(properties?: tabletmanagerdata.IUpdateVReplicationWorkflowsStateRequest): tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest; + public static create(properties?: tabletmanagerdata.IUpdateVReplicationWorkflowsRequest): tabletmanagerdata.UpdateVReplicationWorkflowsRequest; /** - * Encodes the specified UpdateVReplicationWorkflowsStateRequest message. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest.verify|verify} messages. - * @param message UpdateVReplicationWorkflowsStateRequest message or plain object to encode + * 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.IUpdateVReplicationWorkflowsStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: tabletmanagerdata.IUpdateVReplicationWorkflowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateVReplicationWorkflowsStateRequest message, length delimited. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest.verify|verify} messages. - * @param message UpdateVReplicationWorkflowsStateRequest message or plain object to encode + * 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.IUpdateVReplicationWorkflowsStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: tabletmanagerdata.IUpdateVReplicationWorkflowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateVReplicationWorkflowsStateRequest message from the specified reader or buffer. + * 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 UpdateVReplicationWorkflowsStateRequest + * @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.UpdateVReplicationWorkflowsStateRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tabletmanagerdata.UpdateVReplicationWorkflowsRequest; /** - * Decodes an UpdateVReplicationWorkflowsStateRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateVReplicationWorkflowsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateVReplicationWorkflowsStateRequest + * @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.UpdateVReplicationWorkflowsStateRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tabletmanagerdata.UpdateVReplicationWorkflowsRequest; /** - * Verifies an UpdateVReplicationWorkflowsStateRequest message. + * 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 UpdateVReplicationWorkflowsStateRequest 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. * @param object Plain object - * @returns UpdateVReplicationWorkflowsStateRequest + * @returns UpdateVReplicationWorkflowsRequest */ - public static fromObject(object: { [k: string]: any }): tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest; + public static fromObject(object: { [k: string]: any }): tabletmanagerdata.UpdateVReplicationWorkflowsRequest; /** - * Creates a plain object from an UpdateVReplicationWorkflowsStateRequest message. Also converts values to other types if specified. - * @param message UpdateVReplicationWorkflowsStateRequest + * 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.UpdateVReplicationWorkflowsStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: tabletmanagerdata.UpdateVReplicationWorkflowsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateVReplicationWorkflowsStateRequest to JSON. + * Converts this UpdateVReplicationWorkflowsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateVReplicationWorkflowsStateRequest + * 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 UpdateVReplicationWorkflowsStateResponse. */ - interface IUpdateVReplicationWorkflowsStateResponse { + /** Properties of an UpdateVReplicationWorkflowsResponse. */ + interface IUpdateVReplicationWorkflowsResponse { - /** UpdateVReplicationWorkflowsStateResponse result */ + /** UpdateVReplicationWorkflowsResponse result */ result?: (query.IQueryResult|null); } - /** Represents an UpdateVReplicationWorkflowsStateResponse. */ - class UpdateVReplicationWorkflowsStateResponse implements IUpdateVReplicationWorkflowsStateResponse { + /** Represents an UpdateVReplicationWorkflowsResponse. */ + class UpdateVReplicationWorkflowsResponse implements IUpdateVReplicationWorkflowsResponse { /** - * Constructs a new UpdateVReplicationWorkflowsStateResponse. + * Constructs a new UpdateVReplicationWorkflowsResponse. * @param [properties] Properties to set */ - constructor(properties?: tabletmanagerdata.IUpdateVReplicationWorkflowsStateResponse); + constructor(properties?: tabletmanagerdata.IUpdateVReplicationWorkflowsResponse); - /** UpdateVReplicationWorkflowsStateResponse result. */ + /** UpdateVReplicationWorkflowsResponse result. */ public result?: (query.IQueryResult|null); /** - * Creates a new UpdateVReplicationWorkflowsStateResponse instance using the specified properties. + * Creates a new UpdateVReplicationWorkflowsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateVReplicationWorkflowsStateResponse instance + * @returns UpdateVReplicationWorkflowsResponse instance */ - public static create(properties?: tabletmanagerdata.IUpdateVReplicationWorkflowsStateResponse): tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse; + public static create(properties?: tabletmanagerdata.IUpdateVReplicationWorkflowsResponse): tabletmanagerdata.UpdateVReplicationWorkflowsResponse; /** - * Encodes the specified UpdateVReplicationWorkflowsStateResponse message. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse.verify|verify} messages. - * @param message UpdateVReplicationWorkflowsStateResponse message or plain object to encode + * 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.IUpdateVReplicationWorkflowsStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: tabletmanagerdata.IUpdateVReplicationWorkflowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateVReplicationWorkflowsStateResponse message, length delimited. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse.verify|verify} messages. - * @param message UpdateVReplicationWorkflowsStateResponse message or plain object to encode + * 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.IUpdateVReplicationWorkflowsStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: tabletmanagerdata.IUpdateVReplicationWorkflowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateVReplicationWorkflowsStateResponse message from the specified reader or buffer. + * 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 UpdateVReplicationWorkflowsStateResponse + * @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.UpdateVReplicationWorkflowsStateResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tabletmanagerdata.UpdateVReplicationWorkflowsResponse; /** - * Decodes an UpdateVReplicationWorkflowsStateResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateVReplicationWorkflowsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateVReplicationWorkflowsStateResponse + * @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.UpdateVReplicationWorkflowsStateResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tabletmanagerdata.UpdateVReplicationWorkflowsResponse; /** - * Verifies an UpdateVReplicationWorkflowsStateResponse message. + * 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 UpdateVReplicationWorkflowsStateResponse 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. * @param object Plain object - * @returns UpdateVReplicationWorkflowsStateResponse + * @returns UpdateVReplicationWorkflowsResponse */ - public static fromObject(object: { [k: string]: any }): tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse; + public static fromObject(object: { [k: string]: any }): tabletmanagerdata.UpdateVReplicationWorkflowsResponse; /** - * Creates a plain object from an UpdateVReplicationWorkflowsStateResponse message. Also converts values to other types if specified. - * @param message UpdateVReplicationWorkflowsStateResponse + * 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.UpdateVReplicationWorkflowsStateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: tabletmanagerdata.UpdateVReplicationWorkflowsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateVReplicationWorkflowsStateResponse to JSON. + * Converts this UpdateVReplicationWorkflowsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateVReplicationWorkflowsStateResponse + * Gets the default type url for UpdateVReplicationWorkflowsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ diff --git a/web/vtadmin/src/proto/vtadmin.js b/web/vtadmin/src/proto/vtadmin.js index 968d6264069..4e0abf83dba 100644 --- a/web/vtadmin/src/proto/vtadmin.js +++ b/web/vtadmin/src/proto/vtadmin.js @@ -68610,29 +68610,29 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { return UpdateVReplicationWorkflowResponse; })(); - tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest = (function() { + tabletmanagerdata.UpdateVReplicationWorkflowsRequest = (function() { /** - * Properties of an UpdateVReplicationWorkflowsStateRequest. + * Properties of an UpdateVReplicationWorkflowsRequest. * @memberof tabletmanagerdata - * @interface IUpdateVReplicationWorkflowsStateRequest - * @property {boolean|null} [all_workflows] UpdateVReplicationWorkflowsStateRequest all_workflows - * @property {Array.|null} [include_workflows] UpdateVReplicationWorkflowsStateRequest include_workflows - * @property {Array.|null} [exclude_workflows] UpdateVReplicationWorkflowsStateRequest exclude_workflows - * @property {binlogdata.VReplicationWorkflowState|null} [state] UpdateVReplicationWorkflowsStateRequest state - * @property {string|null} [message] UpdateVReplicationWorkflowsStateRequest message - * @property {string|null} [stop_position] UpdateVReplicationWorkflowsStateRequest stop_position + * @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 UpdateVReplicationWorkflowsStateRequest. + * Constructs a new UpdateVReplicationWorkflowsRequest. * @memberof tabletmanagerdata - * @classdesc Represents an UpdateVReplicationWorkflowsStateRequest. - * @implements IUpdateVReplicationWorkflowsStateRequest + * @classdesc Represents an UpdateVReplicationWorkflowsRequest. + * @implements IUpdateVReplicationWorkflowsRequest * @constructor - * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsStateRequest=} [properties] Properties to set + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsRequest=} [properties] Properties to set */ - function UpdateVReplicationWorkflowsStateRequest(properties) { + function UpdateVReplicationWorkflowsRequest(properties) { this.include_workflows = []; this.exclude_workflows = []; if (properties) @@ -68642,75 +68642,75 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { } /** - * UpdateVReplicationWorkflowsStateRequest all_workflows. + * UpdateVReplicationWorkflowsRequest all_workflows. * @member {boolean} all_workflows - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @instance */ - UpdateVReplicationWorkflowsStateRequest.prototype.all_workflows = false; + UpdateVReplicationWorkflowsRequest.prototype.all_workflows = false; /** - * UpdateVReplicationWorkflowsStateRequest include_workflows. + * UpdateVReplicationWorkflowsRequest include_workflows. * @member {Array.} include_workflows - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @instance */ - UpdateVReplicationWorkflowsStateRequest.prototype.include_workflows = $util.emptyArray; + UpdateVReplicationWorkflowsRequest.prototype.include_workflows = $util.emptyArray; /** - * UpdateVReplicationWorkflowsStateRequest exclude_workflows. + * UpdateVReplicationWorkflowsRequest exclude_workflows. * @member {Array.} exclude_workflows - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @instance */ - UpdateVReplicationWorkflowsStateRequest.prototype.exclude_workflows = $util.emptyArray; + UpdateVReplicationWorkflowsRequest.prototype.exclude_workflows = $util.emptyArray; /** - * UpdateVReplicationWorkflowsStateRequest state. + * UpdateVReplicationWorkflowsRequest state. * @member {binlogdata.VReplicationWorkflowState} state - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @instance */ - UpdateVReplicationWorkflowsStateRequest.prototype.state = 0; + UpdateVReplicationWorkflowsRequest.prototype.state = 0; /** - * UpdateVReplicationWorkflowsStateRequest message. + * UpdateVReplicationWorkflowsRequest message. * @member {string} message - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @instance */ - UpdateVReplicationWorkflowsStateRequest.prototype.message = ""; + UpdateVReplicationWorkflowsRequest.prototype.message = ""; /** - * UpdateVReplicationWorkflowsStateRequest stop_position. + * UpdateVReplicationWorkflowsRequest stop_position. * @member {string} stop_position - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @instance */ - UpdateVReplicationWorkflowsStateRequest.prototype.stop_position = ""; + UpdateVReplicationWorkflowsRequest.prototype.stop_position = ""; /** - * Creates a new UpdateVReplicationWorkflowsStateRequest instance using the specified properties. + * Creates a new UpdateVReplicationWorkflowsRequest instance using the specified properties. * @function create - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @static - * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsStateRequest=} [properties] Properties to set - * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest} UpdateVReplicationWorkflowsStateRequest instance + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsRequest=} [properties] Properties to set + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsRequest} UpdateVReplicationWorkflowsRequest instance */ - UpdateVReplicationWorkflowsStateRequest.create = function create(properties) { - return new UpdateVReplicationWorkflowsStateRequest(properties); + UpdateVReplicationWorkflowsRequest.create = function create(properties) { + return new UpdateVReplicationWorkflowsRequest(properties); }; /** - * Encodes the specified UpdateVReplicationWorkflowsStateRequest message. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest.verify|verify} messages. + * Encodes the specified UpdateVReplicationWorkflowsRequest message. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsRequest.verify|verify} messages. * @function encode - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @static - * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsStateRequest} message UpdateVReplicationWorkflowsStateRequest 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 */ - UpdateVReplicationWorkflowsStateRequest.encode = function encode(message, writer) { + UpdateVReplicationWorkflowsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.all_workflows != null && Object.hasOwnProperty.call(message, "all_workflows")) @@ -68731,33 +68731,33 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { }; /** - * Encodes the specified UpdateVReplicationWorkflowsStateRequest message, length delimited. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest.verify|verify} messages. + * Encodes the specified UpdateVReplicationWorkflowsRequest message, length delimited. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @static - * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsStateRequest} message UpdateVReplicationWorkflowsStateRequest 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 */ - UpdateVReplicationWorkflowsStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateVReplicationWorkflowsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateVReplicationWorkflowsStateRequest message from the specified reader or buffer. + * Decodes an UpdateVReplicationWorkflowsRequest message from the specified reader or buffer. * @function decode - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @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.UpdateVReplicationWorkflowsStateRequest} UpdateVReplicationWorkflowsStateRequest + * @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 */ - UpdateVReplicationWorkflowsStateRequest.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.UpdateVReplicationWorkflowsStateRequest(); + 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) { @@ -68798,30 +68798,30 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { }; /** - * Decodes an UpdateVReplicationWorkflowsStateRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateVReplicationWorkflowsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest} UpdateVReplicationWorkflowsStateRequest + * @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 */ - UpdateVReplicationWorkflowsStateRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateVReplicationWorkflowsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateVReplicationWorkflowsStateRequest message. + * Verifies an UpdateVReplicationWorkflowsRequest message. * @function verify - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateVReplicationWorkflowsStateRequest.verify = function verify(message) { + UpdateVReplicationWorkflowsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.all_workflows != null && message.hasOwnProperty("all_workflows")) @@ -68864,29 +68864,29 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { }; /** - * Creates an UpdateVReplicationWorkflowsStateRequest 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.UpdateVReplicationWorkflowsStateRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @static * @param {Object.} object Plain object - * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest} UpdateVReplicationWorkflowsStateRequest + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsRequest} UpdateVReplicationWorkflowsRequest */ - UpdateVReplicationWorkflowsStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest) + UpdateVReplicationWorkflowsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.UpdateVReplicationWorkflowsRequest) return object; - let message = new $root.tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest(); + 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.UpdateVReplicationWorkflowsStateRequest.include_workflows: array expected"); + 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]); } if (object.exclude_workflows) { if (!Array.isArray(object.exclude_workflows)) - throw TypeError(".tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest.exclude_workflows: array expected"); + 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]); @@ -68935,15 +68935,15 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { }; /** - * Creates a plain object from an UpdateVReplicationWorkflowsStateRequest 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.UpdateVReplicationWorkflowsStateRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @static - * @param {tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest} message UpdateVReplicationWorkflowsStateRequest + * @param {tabletmanagerdata.UpdateVReplicationWorkflowsRequest} message UpdateVReplicationWorkflowsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateVReplicationWorkflowsStateRequest.toObject = function toObject(message, options) { + UpdateVReplicationWorkflowsRequest.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; @@ -68979,52 +68979,52 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { }; /** - * Converts this UpdateVReplicationWorkflowsStateRequest to JSON. + * Converts this UpdateVReplicationWorkflowsRequest to JSON. * @function toJSON - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @instance * @returns {Object.} JSON object */ - UpdateVReplicationWorkflowsStateRequest.prototype.toJSON = function toJSON() { + UpdateVReplicationWorkflowsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateVReplicationWorkflowsStateRequest + * Gets the default type url for UpdateVReplicationWorkflowsRequest * @function getTypeUrl - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateVReplicationWorkflowsStateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateVReplicationWorkflowsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/tabletmanagerdata.UpdateVReplicationWorkflowsStateRequest"; + return typeUrlPrefix + "/tabletmanagerdata.UpdateVReplicationWorkflowsRequest"; }; - return UpdateVReplicationWorkflowsStateRequest; + return UpdateVReplicationWorkflowsRequest; })(); - tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse = (function() { + tabletmanagerdata.UpdateVReplicationWorkflowsResponse = (function() { /** - * Properties of an UpdateVReplicationWorkflowsStateResponse. + * Properties of an UpdateVReplicationWorkflowsResponse. * @memberof tabletmanagerdata - * @interface IUpdateVReplicationWorkflowsStateResponse - * @property {query.IQueryResult|null} [result] UpdateVReplicationWorkflowsStateResponse result + * @interface IUpdateVReplicationWorkflowsResponse + * @property {query.IQueryResult|null} [result] UpdateVReplicationWorkflowsResponse result */ /** - * Constructs a new UpdateVReplicationWorkflowsStateResponse. + * Constructs a new UpdateVReplicationWorkflowsResponse. * @memberof tabletmanagerdata - * @classdesc Represents an UpdateVReplicationWorkflowsStateResponse. - * @implements IUpdateVReplicationWorkflowsStateResponse + * @classdesc Represents an UpdateVReplicationWorkflowsResponse. + * @implements IUpdateVReplicationWorkflowsResponse * @constructor - * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsStateResponse=} [properties] Properties to set + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsResponse=} [properties] Properties to set */ - function UpdateVReplicationWorkflowsStateResponse(properties) { + function UpdateVReplicationWorkflowsResponse(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -69032,35 +69032,35 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { } /** - * UpdateVReplicationWorkflowsStateResponse result. + * UpdateVReplicationWorkflowsResponse result. * @member {query.IQueryResult|null|undefined} result - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsResponse * @instance */ - UpdateVReplicationWorkflowsStateResponse.prototype.result = null; + UpdateVReplicationWorkflowsResponse.prototype.result = null; /** - * Creates a new UpdateVReplicationWorkflowsStateResponse instance using the specified properties. + * Creates a new UpdateVReplicationWorkflowsResponse instance using the specified properties. * @function create - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsResponse * @static - * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsStateResponse=} [properties] Properties to set - * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse} UpdateVReplicationWorkflowsStateResponse instance + * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsResponse=} [properties] Properties to set + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsResponse} UpdateVReplicationWorkflowsResponse instance */ - UpdateVReplicationWorkflowsStateResponse.create = function create(properties) { - return new UpdateVReplicationWorkflowsStateResponse(properties); + UpdateVReplicationWorkflowsResponse.create = function create(properties) { + return new UpdateVReplicationWorkflowsResponse(properties); }; /** - * Encodes the specified UpdateVReplicationWorkflowsStateResponse message. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse.verify|verify} messages. + * Encodes the specified UpdateVReplicationWorkflowsResponse message. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsResponse.verify|verify} messages. * @function encode - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsResponse * @static - * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsStateResponse} message UpdateVReplicationWorkflowsStateResponse 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 */ - UpdateVReplicationWorkflowsStateResponse.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")) @@ -69069,33 +69069,33 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { }; /** - * Encodes the specified UpdateVReplicationWorkflowsStateResponse message, length delimited. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse.verify|verify} messages. + * Encodes the specified UpdateVReplicationWorkflowsResponse message, length delimited. Does not implicitly {@link tabletmanagerdata.UpdateVReplicationWorkflowsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsResponse * @static - * @param {tabletmanagerdata.IUpdateVReplicationWorkflowsStateResponse} message UpdateVReplicationWorkflowsStateResponse 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 */ - UpdateVReplicationWorkflowsStateResponse.encodeDelimited = function encodeDelimited(message, writer) { + UpdateVReplicationWorkflowsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateVReplicationWorkflowsStateResponse message from the specified reader or buffer. + * Decodes an UpdateVReplicationWorkflowsResponse message from the specified reader or buffer. * @function decode - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + * @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.UpdateVReplicationWorkflowsStateResponse} UpdateVReplicationWorkflowsStateResponse + * @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 */ - UpdateVReplicationWorkflowsStateResponse.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.UpdateVReplicationWorkflowsStateResponse(); + 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) { @@ -69112,30 +69112,30 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { }; /** - * Decodes an UpdateVReplicationWorkflowsStateResponse 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.UpdateVReplicationWorkflowsStateResponse + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse} UpdateVReplicationWorkflowsStateResponse + * @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 */ - UpdateVReplicationWorkflowsStateResponse.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 UpdateVReplicationWorkflowsStateResponse message. + * Verifies an UpdateVReplicationWorkflowsResponse message. * @function verify - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateVReplicationWorkflowsStateResponse.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")) { @@ -69147,35 +69147,35 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { }; /** - * Creates an UpdateVReplicationWorkflowsStateResponse 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.UpdateVReplicationWorkflowsStateResponse + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsResponse * @static * @param {Object.} object Plain object - * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse} UpdateVReplicationWorkflowsStateResponse + * @returns {tabletmanagerdata.UpdateVReplicationWorkflowsResponse} UpdateVReplicationWorkflowsResponse */ - UpdateVReplicationWorkflowsStateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse) + UpdateVReplicationWorkflowsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.UpdateVReplicationWorkflowsResponse) return object; - let message = new $root.tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse(); + let message = new $root.tabletmanagerdata.UpdateVReplicationWorkflowsResponse(); if (object.result != null) { if (typeof object.result !== "object") - throw TypeError(".tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse.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 UpdateVReplicationWorkflowsStateResponse 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.UpdateVReplicationWorkflowsStateResponse + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsResponse * @static - * @param {tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse} message UpdateVReplicationWorkflowsStateResponse + * @param {tabletmanagerdata.UpdateVReplicationWorkflowsResponse} message UpdateVReplicationWorkflowsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateVReplicationWorkflowsStateResponse.toObject = function toObject(message, options) { + UpdateVReplicationWorkflowsResponse.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; @@ -69187,32 +69187,32 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { }; /** - * Converts this UpdateVReplicationWorkflowsStateResponse to JSON. + * Converts this UpdateVReplicationWorkflowsResponse to JSON. * @function toJSON - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsResponse * @instance * @returns {Object.} JSON object */ - UpdateVReplicationWorkflowsStateResponse.prototype.toJSON = function toJSON() { + UpdateVReplicationWorkflowsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateVReplicationWorkflowsStateResponse + * Gets the default type url for UpdateVReplicationWorkflowsResponse * @function getTypeUrl - * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse + * @memberof tabletmanagerdata.UpdateVReplicationWorkflowsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateVReplicationWorkflowsStateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateVReplicationWorkflowsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/tabletmanagerdata.UpdateVReplicationWorkflowsStateResponse"; + return typeUrlPrefix + "/tabletmanagerdata.UpdateVReplicationWorkflowsResponse"; }; - return UpdateVReplicationWorkflowsStateResponse; + return UpdateVReplicationWorkflowsResponse; })(); tabletmanagerdata.ResetSequencesRequest = (function() { From 94d59b3ffd6fdb18aad028c7f9e5982408e031c6 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Sat, 9 Mar 2024 21:32:30 -0500 Subject: [PATCH 31/35] Fixup uncaught merge conflict Signed-off-by: Matt Lord --- go/vt/binlog/binlogplayer/mock_dbclient.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/go/vt/binlog/binlogplayer/mock_dbclient.go b/go/vt/binlog/binlogplayer/mock_dbclient.go index a0dc01e4f59..02e7ea28d7b 100644 --- a/go/vt/binlog/binlogplayer/mock_dbclient.go +++ b/go/vt/binlog/binlogplayer/mock_dbclient.go @@ -99,12 +99,6 @@ func NewMockDbaClient(t *testing.T) *MockDBClient { } } -func (dc *MockDBClient) AddInvariant(query string, result *sqltypes.Result) { - dc.expectMu.Lock() - defer dc.expectMu.Unlock() - dc.invariants[query] = result -} - // ExpectRequest adds an expected result to the mock. // This function should not be called conncurrently with other commands. func (dc *MockDBClient) ExpectRequest(query string, result *sqltypes.Result, err error) { From c910193fc941ce519026eab01e8724a26e59a7b0 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Sat, 9 Mar 2024 21:41:25 -0500 Subject: [PATCH 32/35] Comment nit Signed-off-by: Matt Lord --- go/vt/vttablet/tabletmanager/rpc_vreplication.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication.go b/go/vt/vttablet/tabletmanager/rpc_vreplication.go index 4e83e2cea63..3587b1f60e6 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -56,8 +56,8 @@ 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 metadata/flowcontrol values for multiple workflows. The final format - // specifier is used to optionally add any additional predicates to the query. + // 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" ) From f2d64ea615424d43dd36bb1fc6d1b3e341545a5e Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Sat, 9 Mar 2024 22:00:34 -0500 Subject: [PATCH 33/35] Also split out query building for ReadVReplicationWorkflows Signed-off-by: Matt Lord --- .../tabletmanager/rpc_vreplication.go | 137 ++++++++++-------- .../tabletmanager/rpc_vreplication_test.go | 48 ++++++ 2 files changed, 122 insertions(+), 63 deletions(-) diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication.go b/go/vt/vttablet/tabletmanager/rpc_vreplication.go index 3587b1f60e6..1be69bcf003 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -64,6 +64,7 @@ const ( 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") + errNoDBName = vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "invalid request, no DB name provided") ) func (tm *TabletManager) CreateVReplicationWorkflow(ctx context.Context, req *tabletmanagerdatapb.CreateVReplicationWorkflowRequest) (*tabletmanagerdatapb.CreateVReplicationWorkflowResponse, error) { @@ -140,7 +141,7 @@ func (tm *TabletManager) DeleteVReplicationWorkflow(ctx context.Context, req *ta func (tm *TabletManager) HasVReplicationWorkflows(ctx context.Context, req *tabletmanagerdatapb.HasVReplicationWorkflowsRequest) (*tabletmanagerdatapb.HasVReplicationWorkflowsResponse, error) { if req.GetDbName() == "" { - return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "invalid request, no DB name provided") + return nil, errNoDBName } bindVars := map[string]*querypb.BindVariable{ "db": sqltypes.StringBindVariable(req.GetDbName()), @@ -172,68 +173,7 @@ func (tm *TabletManager) HasVReplicationWorkflows(ctx context.Context, req *tabl } func (tm *TabletManager) ReadVReplicationWorkflows(ctx context.Context, req *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowsResponse, error) { - if req.GetDbName() == "" { - return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "invalid request, no DB name provided") - } - bindVars := map[string]*querypb.BindVariable{ - "db": sqltypes.StringBindVariable(req.GetDbName()), - } - 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()) - stmt, err := parsed.GenerateQuery(bindVars, nil) + stmt, err := buildReadVReplicationWorkflowsQuery(req) if err != nil { return nil, err } @@ -585,6 +525,77 @@ func (tm *TabletManager) VReplicationWaitForPos(ctx context.Context, id int32, p return tm.VREngine.WaitForPos(ctx, id, pos) } +// buildReadVReplicationWorkflowsQuery builds the SQL query used to read N +// vreplication workflows based on the request. +func buildReadVReplicationWorkflowsQuery(req *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest) (string, error) { + if req.GetDbName() == "" { + return "", errNoDBName + } + bindVars := map[string]*querypb.BindVariable{ + "db": sqltypes.StringBindVariable(req.GetDbName()), + } + 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()) + stmt, err := parsed.GenerateQuery(bindVars, nil) + if err != nil { + return "", err + } + return stmt, nil +} + // buildUpdateVReplicationWorkflowsQuery builds the SQL query used to update // the metadata/flow control fields for N vreplication workflows based on the // request. diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go index d32e50dc039..4ff5a0f2f17 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go @@ -3165,6 +3165,54 @@ func TestMaterializerNoVindexInExpression(t *testing.T) { require.EqualError(t, err, strings.Join(errs, "\n")) } +func TestBuildReadVReplicationWorkflowsQuery(t *testing.T) { + dbName := "vt_testks" + tests := []struct { + name string + req *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest + want string + wantErr string + }{ + { + name: "no db name", + req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{}, + wantErr: errNoDBName.Error(), + }, + { + name: "all options", + req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ + DbName: dbName, + 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{ + DbName: dbName, + 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 := 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{ From 35492ed811fca8e05d7ab31bd68ae92ee4dc3a91 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Sat, 9 Mar 2024 23:27:06 -0500 Subject: [PATCH 34/35] Stop needlessly passing db_name from vtctld to vttablet Signed-off-by: Matt Lord --- .../tabletmanagerdata/tabletmanagerdata.pb.go | 547 +++++++++--------- .../tabletmanagerdata_vtproto.pb.go | 111 +--- go/vt/vtctl/workflow/resharder.go | 5 +- go/vt/vtctl/workflow/server.go | 1 - go/vt/vtctl/workflow/stream_migrator.go | 1 - go/vt/vtctl/workflow/utils.go | 4 +- .../tabletmanager/rpc_vreplication.go | 21 +- .../tabletmanager/rpc_vreplication_test.go | 106 ++-- proto/tabletmanagerdata.proto | 14 +- web/vtadmin/src/proto/vtadmin.d.ts | 12 - web/vtadmin/src/proto/vtadmin.js | 82 +-- 11 files changed, 346 insertions(+), 558 deletions(-) diff --git a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go index 33dd0de295f..44dca53e805 100644 --- a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go +++ b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go @@ -5065,8 +5065,6 @@ type HasVReplicationWorkflowsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - DbName string `protobuf:"bytes,1,opt,name=db_name,json=dbName,proto3" json:"db_name,omitempty"` } func (x *HasVReplicationWorkflowsRequest) Reset() { @@ -5101,13 +5099,6 @@ func (*HasVReplicationWorkflowsRequest) Descriptor() ([]byte, []int) { return file_tabletmanagerdata_proto_rawDescGZIP(), []int{100} } -func (x *HasVReplicationWorkflowsRequest) GetDbName() string { - if x != nil { - return x.DbName - } - return "" -} - type HasVReplicationWorkflowsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -5160,13 +5151,12 @@ type ReadVReplicationWorkflowsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - DbName string `protobuf:"bytes,1,opt,name=db_name,json=dbName,proto3" json:"db_name,omitempty"` - IncludeIds []int32 `protobuf:"varint,2,rep,packed,name=include_ids,json=includeIds,proto3" json:"include_ids,omitempty"` - IncludeWorkflows []string `protobuf:"bytes,3,rep,name=include_workflows,json=includeWorkflows,proto3" json:"include_workflows,omitempty"` - IncludeStates []binlogdata.VReplicationWorkflowState `protobuf:"varint,4,rep,packed,name=include_states,json=includeStates,proto3,enum=binlogdata.VReplicationWorkflowState" json:"include_states,omitempty"` - ExcludeWorkflows []string `protobuf:"bytes,5,rep,name=exclude_workflows,json=excludeWorkflows,proto3" json:"exclude_workflows,omitempty"` - ExcludeStates []binlogdata.VReplicationWorkflowState `protobuf:"varint,6,rep,packed,name=exclude_states,json=excludeStates,proto3,enum=binlogdata.VReplicationWorkflowState" json:"exclude_states,omitempty"` - ExcludeFrozen bool `protobuf:"varint,7,opt,name=exclude_frozen,json=excludeFrozen,proto3" json:"exclude_frozen,omitempty"` + 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() { @@ -5201,13 +5191,6 @@ func (*ReadVReplicationWorkflowsRequest) Descriptor() ([]byte, []int) { return file_tabletmanagerdata_proto_rawDescGZIP(), []int{102} } -func (x *ReadVReplicationWorkflowsRequest) GetDbName() string { - if x != nil { - return x.DbName - } - return "" -} - func (x *ReadVReplicationWorkflowsRequest) GetIncludeIds() []int32 { if x != nil { return x.IncludeIds @@ -7108,278 +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, 0x3a, 0x0a, 0x1f, 0x48, 0x61, 0x73, 0x56, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 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, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x62, 0x4e, 0x61, 0x6d, 0x65, 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, 0xf9, 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, 0x17, 0x0a, 0x07, 0x64, 0x62, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x62, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x73, 0x18, - 0x02, 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, 0x03, 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, 0x04, 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, 0x05, 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, 0x06, 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, 0x07, 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, 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, + 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, 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, + 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, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, + 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, 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, + 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, 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, + 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 ( diff --git a/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go b/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go index 25483660fe2..2bc1b46df27 100644 --- a/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go +++ b/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go @@ -1927,9 +1927,7 @@ func (m *HasVReplicationWorkflowsRequest) CloneVT() *HasVReplicationWorkflowsReq if m == nil { return (*HasVReplicationWorkflowsRequest)(nil) } - r := &HasVReplicationWorkflowsRequest{ - DbName: m.DbName, - } + r := &HasVReplicationWorkflowsRequest{} if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -1964,7 +1962,6 @@ func (m *ReadVReplicationWorkflowsRequest) CloneVT() *ReadVReplicationWorkflowsR return (*ReadVReplicationWorkflowsRequest)(nil) } r := &ReadVReplicationWorkflowsRequest{ - DbName: m.DbName, ExcludeFrozen: m.ExcludeFrozen, } if rhs := m.IncludeIds; rhs != nil { @@ -6882,13 +6879,6 @@ func (m *HasVReplicationWorkflowsRequest) MarshalToSizedBufferVT(dAtA []byte) (i i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - 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] = 0xa - } return len(dAtA) - i, nil } @@ -6973,7 +6963,7 @@ func (m *ReadVReplicationWorkflowsRequest) MarshalToSizedBufferVT(dAtA []byte) ( dAtA[i] = 0 } i-- - dAtA[i] = 0x38 + dAtA[i] = 0x30 } if len(m.ExcludeStates) > 0 { var pksize2 int @@ -6994,7 +6984,7 @@ func (m *ReadVReplicationWorkflowsRequest) MarshalToSizedBufferVT(dAtA []byte) ( } i = encodeVarint(dAtA, i, uint64(pksize2)) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x2a } if len(m.ExcludeWorkflows) > 0 { for iNdEx := len(m.ExcludeWorkflows) - 1; iNdEx >= 0; iNdEx-- { @@ -7002,7 +6992,7 @@ func (m *ReadVReplicationWorkflowsRequest) MarshalToSizedBufferVT(dAtA []byte) ( copy(dAtA[i:], m.ExcludeWorkflows[iNdEx]) i = encodeVarint(dAtA, i, uint64(len(m.ExcludeWorkflows[iNdEx]))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x22 } } if len(m.IncludeStates) > 0 { @@ -7024,7 +7014,7 @@ func (m *ReadVReplicationWorkflowsRequest) MarshalToSizedBufferVT(dAtA []byte) ( } i = encodeVarint(dAtA, i, uint64(pksize4)) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x1a } if len(m.IncludeWorkflows) > 0 { for iNdEx := len(m.IncludeWorkflows) - 1; iNdEx >= 0; iNdEx-- { @@ -7032,7 +7022,7 @@ func (m *ReadVReplicationWorkflowsRequest) MarshalToSizedBufferVT(dAtA []byte) ( copy(dAtA[i:], m.IncludeWorkflows[iNdEx]) i = encodeVarint(dAtA, i, uint64(len(m.IncludeWorkflows[iNdEx]))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x12 } } if len(m.IncludeIds) > 0 { @@ -7054,13 +7044,6 @@ func (m *ReadVReplicationWorkflowsRequest) MarshalToSizedBufferVT(dAtA []byte) ( } i = encodeVarint(dAtA, i, uint64(pksize6)) i-- - dAtA[i] = 0x12 - } - 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] = 0xa } return len(dAtA) - i, nil @@ -9809,10 +9792,6 @@ func (m *HasVReplicationWorkflowsRequest) SizeVT() (n int) { } var l int _ = l - l = len(m.DbName) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } n += len(m.unknownFields) return n } @@ -9836,10 +9815,6 @@ func (m *ReadVReplicationWorkflowsRequest) SizeVT() (n int) { } var l int _ = l - l = len(m.DbName) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } if len(m.IncludeIds) > 0 { l = 0 for _, e := range m.IncludeIds { @@ -19625,38 +19600,6 @@ func (m *HasVReplicationWorkflowsRequest) UnmarshalVT(dAtA []byte) error { return fmt.Errorf("proto: HasVReplicationWorkflowsRequest: 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) - } - 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 default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) @@ -19780,38 +19723,6 @@ func (m *ReadVReplicationWorkflowsRequest) UnmarshalVT(dAtA []byte) error { } switch fieldNum { case 1: - 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 2: if wireType == 0 { var v int32 for shift := uint(0); ; shift += 7 { @@ -19887,7 +19798,7 @@ func (m *ReadVReplicationWorkflowsRequest) UnmarshalVT(dAtA []byte) error { } else { return fmt.Errorf("proto: wrong wireType = %d for field IncludeIds", wireType) } - case 3: + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field IncludeWorkflows", wireType) } @@ -19919,7 +19830,7 @@ func (m *ReadVReplicationWorkflowsRequest) UnmarshalVT(dAtA []byte) error { } m.IncludeWorkflows = append(m.IncludeWorkflows, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 4: + case 3: if wireType == 0 { var v binlogdata.VReplicationWorkflowState for shift := uint(0); ; shift += 7 { @@ -19988,7 +19899,7 @@ func (m *ReadVReplicationWorkflowsRequest) UnmarshalVT(dAtA []byte) error { } else { return fmt.Errorf("proto: wrong wireType = %d for field IncludeStates", wireType) } - case 5: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ExcludeWorkflows", wireType) } @@ -20020,7 +19931,7 @@ func (m *ReadVReplicationWorkflowsRequest) UnmarshalVT(dAtA []byte) error { } m.ExcludeWorkflows = append(m.ExcludeWorkflows, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 6: + case 5: if wireType == 0 { var v binlogdata.VReplicationWorkflowState for shift := uint(0); ; shift += 7 { @@ -20089,7 +20000,7 @@ func (m *ReadVReplicationWorkflowsRequest) UnmarshalVT(dAtA []byte) error { } else { return fmt.Errorf("proto: wrong wireType = %d for field ExcludeStates", wireType) } - case 7: + case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ExcludeFrozen", wireType) } diff --git a/go/vt/vtctl/workflow/resharder.go b/go/vt/vtctl/workflow/resharder.go index 2ccff028377..95fcea3a2a9 100644 --- a/go/vt/vtctl/workflow/resharder.go +++ b/go/vt/vtctl/workflow/resharder.go @@ -134,9 +134,9 @@ 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()] - res, err := rs.s.tmc.HasVReplicationWorkflows(ctx, targetPrimary.Tablet, &tabletmanagerdatapb.HasVReplicationWorkflowsRequest{DbName: targetPrimary.DbName()}) + res, err := rs.s.tmc.HasVReplicationWorkflows(ctx, targetPrimary.Tablet, &tabletmanagerdatapb.HasVReplicationWorkflowsRequest{}) if err != nil { - return vterrors.Wrapf(err, "HasVReplicationWorkflows(%v, %s)", targetPrimary.Tablet, targetPrimary.DbName()) + return vterrors.Wrapf(err, "HasVReplicationWorkflows(%v)", targetPrimary.Tablet) } 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") @@ -152,7 +152,6 @@ func (rs *resharder) readRefStreams(ctx context.Context) error { sourcePrimary := rs.sourcePrimaries[source.ShardName()] req := &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ - DbName: sourcePrimary.DbName(), ExcludeFrozen: true, } res, err := rs.s.tmc.ReadVReplicationWorkflows(ctx, sourcePrimary.Tablet, req) diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index 60d6f79c754..33d2a9869ab 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -417,7 +417,6 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows } // Clone the request so that we can set the correct DB name for tablet. req := readReq.CloneVT() - req.DbName = primary.DbName() wres, err := s.tmc.ReadVReplicationWorkflows(readWorkflowsCtx, primary.Tablet, req) if err != nil { return err diff --git a/go/vt/vtctl/workflow/stream_migrator.go b/go/vt/vtctl/workflow/stream_migrator.go index a6a4bc64a7e..06cee856319 100644 --- a/go/vt/vtctl/workflow/stream_migrator.go +++ b/go/vt/vtctl/workflow/stream_migrator.go @@ -359,7 +359,6 @@ func (sm *StreamMigrator) legacyReadTabletStreams(ctx context.Context, ti *topo. // 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{ - DbName: ti.DbName(), ExcludeWorkflows: []string{sm.ts.ReverseWorkflowName()}, IncludeIds: ids, IncludeStates: states, diff --git a/go/vt/vtctl/workflow/utils.go b/go/vt/vtctl/workflow/utils.go index a015b785acd..aef80d91c18 100644 --- a/go/vt/vtctl/workflow/utils.go +++ b/go/vt/vtctl/workflow/utils.go @@ -106,9 +106,7 @@ func validateNewWorkflow(ctx context.Context, ts *topo.Server, tmc tmclient.Tabl allErrors.RecordError(vterrors.Wrap(err, "validateWorkflowName.GetTablet")) return } - res, err := tmc.ReadVReplicationWorkflows(ctx, primary.Tablet, &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ - DbName: primary.DbName(), - }) + res, err := tmc.ReadVReplicationWorkflows(ctx, primary.Tablet, &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{}) if err != nil { allErrors.RecordError(vterrors.Wrap(err, "validateWorkflowName.ReadVReplicationWorkflows")) return diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication.go b/go/vt/vttablet/tabletmanager/rpc_vreplication.go index 1be69bcf003..c89c6f8cf7f 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -64,7 +64,6 @@ const ( 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") - errNoDBName = vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "invalid request, no DB name provided") ) func (tm *TabletManager) CreateVReplicationWorkflow(ctx context.Context, req *tabletmanagerdatapb.CreateVReplicationWorkflowRequest) (*tabletmanagerdatapb.CreateVReplicationWorkflowResponse, error) { @@ -140,11 +139,8 @@ func (tm *TabletManager) DeleteVReplicationWorkflow(ctx context.Context, req *ta } func (tm *TabletManager) HasVReplicationWorkflows(ctx context.Context, req *tabletmanagerdatapb.HasVReplicationWorkflowsRequest) (*tabletmanagerdatapb.HasVReplicationWorkflowsResponse, error) { - if req.GetDbName() == "" { - return nil, errNoDBName - } bindVars := map[string]*querypb.BindVariable{ - "db": sqltypes.StringBindVariable(req.GetDbName()), + "db": sqltypes.StringBindVariable(tm.DBConfigs.DBName), } parsed := sqlparser.BuildParsedQuery(sqlHasVReplicationWorkflows, sidecar.GetIdentifier(), ":db") stmt, err := parsed.GenerateQuery(bindVars, nil) @@ -173,11 +169,11 @@ func (tm *TabletManager) HasVReplicationWorkflows(ctx context.Context, req *tabl } func (tm *TabletManager) ReadVReplicationWorkflows(ctx context.Context, req *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest) (*tabletmanagerdatapb.ReadVReplicationWorkflowsResponse, error) { - stmt, err := buildReadVReplicationWorkflowsQuery(req) + query, err := tm.buildReadVReplicationWorkflowsQuery(req) if err != nil { return nil, err } - res, err := tm.VREngine.Exec(stmt) + res, err := tm.VREngine.Exec(query) if err != nil { return nil, err } @@ -527,12 +523,9 @@ func (tm *TabletManager) VReplicationWaitForPos(ctx context.Context, id int32, p // buildReadVReplicationWorkflowsQuery builds the SQL query used to read N // vreplication workflows based on the request. -func buildReadVReplicationWorkflowsQuery(req *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest) (string, error) { - if req.GetDbName() == "" { - return "", errNoDBName - } +func (tm *TabletManager) buildReadVReplicationWorkflowsQuery(req *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest) (string, error) { bindVars := map[string]*querypb.BindVariable{ - "db": sqltypes.StringBindVariable(req.GetDbName()), + "db": sqltypes.StringBindVariable(tm.DBConfigs.DBName), } additionalPredicates := strings.Builder{} if req.GetExcludeFrozen() { @@ -589,11 +582,11 @@ func buildReadVReplicationWorkflowsQuery(req *tabletmanagerdatapb.ReadVReplicati additionalPredicates.WriteByte(')') } parsed := sqlparser.BuildParsedQuery(sqlReadVReplicationWorkflows, sidecar.GetIdentifier(), ":db", additionalPredicates.String()) - stmt, err := parsed.GenerateQuery(bindVars, nil) + query, err := parsed.GenerateQuery(bindVars, nil) if err != nil { return "", err } - return stmt, nil + return query, nil } // buildUpdateVReplicationWorkflowsQuery builds the SQL query used to update diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go index 4ff5a0f2f17..2190534247e 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go @@ -54,12 +54,7 @@ import ( ) const ( - dbNamePrefix = "vt_" 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=" 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" @@ -78,9 +73,9 @@ const ( 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=%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 = 'vt_%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 = 'vt_%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 = 'vt_%s' and workflow in ('%s') group by workflow, id order by workflow, id" + 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)" @@ -284,7 +279,7 @@ func TestCreateVReplicationWorkflow(t *testing.T) { // the test with an error as at this point we've tested what // we wanted to test. targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) - targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, targetKs, ""), &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) @@ -397,7 +392,7 @@ func TestMoveTables(t *testing.T) { addInvariants(ftc.vrdbClient, vreplID, sourceTabletUID, position, wf, tenv.cells[0]) tenv.tmc.setVReplicationExecResults(ftc.tablet, getCopyState, &sqltypes.Result{}) - ftc.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, targetKs, ""), &sqltypes.Result{}, nil) + 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) @@ -441,7 +436,7 @@ func TestMoveTables(t *testing.T) { ), 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(readWorkflowsLimited, targetKs, wf), sqltypes.MakeTestResult( + 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", @@ -477,7 +472,7 @@ func TestMoveTables(t *testing.T) { require.NoError(t, err) for _, ftc := range targetShards { - ftc.vrdbClient.ExpectRequest(fmt.Sprintf(readWorkflowsLimited, targetKs, wf), sqltypes.MakeTestResult( + 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", @@ -521,7 +516,7 @@ func TestMoveTables(t *testing.T) { ), 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, sourceKs, workflow.ReverseWorkflowName(wf)), sqltypes.MakeTestResult( + 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", @@ -987,7 +982,7 @@ func TestSourceShardSelection(t *testing.T) { 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, targetKs, ""), &sqltypes.Result{}, nil) + tt.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) for i, sourceShard := range streams { var err error if i == len(streams)-1 { @@ -1078,7 +1073,7 @@ func TestFailedMoveTablesCreateCleanup(t *testing.T) { addInvariants(targetTablet.vrdbClient, vreplID, sourceTabletUID, position, wf, tenv.cells[0]) - tenv.tmc.tablets[targetTabletUID].vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, targetKs, ""), &sqltypes.Result{}, nil) + tenv.tmc.tablets[targetTabletUID].vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) targetTablet.vrdbClient.ExpectRequest( fmt.Sprintf("%s %s", insertVReplicationPrefix, @@ -1241,12 +1236,10 @@ func TestHasVReplicationWorkflows(t *testing.T) { require.NotNil(t, tt.tablet, "No tablet provided") - req := &tabletmanagerdatapb.HasVReplicationWorkflowsRequest{ - DbName: dbNamePrefix + tt.tablet.tablet.Keyspace, - } + req := &tabletmanagerdatapb.HasVReplicationWorkflowsRequest{} tt.tablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) - tt.tablet.vrdbClient.ExpectRequest(fmt.Sprintf(hasWorkflows, tt.tablet.tablet.Keyspace), tt.queryRes, 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 { @@ -1281,21 +1274,13 @@ func TestReadVReplicationWorkflows(t *testing.T) { wantErr bool }{ { - name: "no db name", - req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{}, - wantErr: true, - }, - { - name: "only db name", - req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ - DbName: dbNamePrefix + ks, - }, + name: "nothing", + req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{}, // No additional query predicates. }, { name: "all except frozen", req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ - DbName: dbNamePrefix + ks, ExcludeFrozen: true, }, wantPreds: " and message != 'FROZEN'", @@ -1303,7 +1288,6 @@ func TestReadVReplicationWorkflows(t *testing.T) { { name: "1-3 unless frozen", req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ - DbName: dbNamePrefix + ks, IncludeIds: []int32{1, 2, 3}, ExcludeFrozen: true, }, @@ -1312,7 +1296,6 @@ func TestReadVReplicationWorkflows(t *testing.T) { { name: "all but wf1 and wf2", req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ - DbName: dbNamePrefix + ks, ExcludeWorkflows: []string{"wf1", "wf2"}, }, wantPreds: " and workflow not in ('wf1','wf2')", @@ -1320,7 +1303,6 @@ func TestReadVReplicationWorkflows(t *testing.T) { { name: "all but wf1 and wf2", req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ - DbName: dbNamePrefix + ks, ExcludeWorkflows: []string{"wf1", "wf2"}, }, wantPreds: " and workflow not in ('wf1','wf2')", @@ -1328,7 +1310,6 @@ func TestReadVReplicationWorkflows(t *testing.T) { { name: "only wf1 and wf2", req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ - DbName: dbNamePrefix + ks, IncludeWorkflows: []string{"wf1", "wf2"}, ExcludeStates: []binlogdatapb.VReplicationWorkflowState{ binlogdatapb.VReplicationWorkflowState_Stopped, @@ -1339,7 +1320,6 @@ func TestReadVReplicationWorkflows(t *testing.T) { { name: "only copying or running", req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ - DbName: dbNamePrefix + ks, IncludeStates: []binlogdatapb.VReplicationWorkflowState{ binlogdatapb.VReplicationWorkflowState_Copying, binlogdatapb.VReplicationWorkflowState_Running, @@ -1350,7 +1330,6 @@ func TestReadVReplicationWorkflows(t *testing.T) { { name: "mess of predicates", req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ - DbName: dbNamePrefix + ks, IncludeIds: []int32{1, 3}, IncludeWorkflows: []string{"wf1"}, ExcludeWorkflows: []string{"wf2"}, @@ -1376,7 +1355,7 @@ func TestReadVReplicationWorkflows(t *testing.T) { 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, tablet.tablet.Keyspace, tt.wantPreds), &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) @@ -1767,7 +1746,7 @@ func TestMaterializerOneToOne(t *testing.T) { addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) - targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, targetKs, ""), &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 @@ -1829,7 +1808,7 @@ func TestMaterializerManyToOne(t *testing.T) { 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, targetKs, ""), &sqltypes.Result{}, nil) + 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 @@ -1930,7 +1909,7 @@ func TestMaterializerOneToMany(t *testing.T) { 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, targetKs, ""), &sqltypes.Result{}, nil) + 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) @@ -2028,7 +2007,7 @@ func TestMaterializerManyToMany(t *testing.T) { 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, targetKs, ""), &sqltypes.Result{}, nil) + 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]) @@ -2131,7 +2110,7 @@ func TestMaterializerMulticolumnVindex(t *testing.T) { 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, targetKs, ""), &sqltypes.Result{}, nil) + 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) @@ -2212,7 +2191,7 @@ func TestMaterializerDeploySchema(t *testing.T) { } tenv.tmc.tabletSchemas[targetTabletUID] = schema targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) - targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, targetKs, ""), &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 @@ -2283,7 +2262,7 @@ func TestMaterializerCopySchema(t *testing.T) { } tenv.tmc.tabletSchemas[targetTabletUID] = schema targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) - targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, targetKs, ""), &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 @@ -2371,7 +2350,7 @@ func TestMaterializerExplicitColumns(t *testing.T) { 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, targetKs, ""), &sqltypes.Result{}, nil) + 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) @@ -2471,7 +2450,7 @@ func TestMaterializerRenamedColumns(t *testing.T) { 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, targetKs, ""), &sqltypes.Result{}, nil) + 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) @@ -2544,7 +2523,7 @@ func TestMaterializerStopAfterCopy(t *testing.T) { addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) - targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, targetKs, ""), &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 @@ -2603,7 +2582,7 @@ func TestMaterializerNoTargetVSchema(t *testing.T) { addMaterializeSettingsTablesToSchema(ms, tenv, vtenv) targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf("use %s", sidecar.GetIdentifier()), &sqltypes.Result{}, nil) - targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, targetKs, ""), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) err = ws.Materialize(ctx, ms) targetTablet.vrdbClient.Wait() @@ -2648,7 +2627,7 @@ func TestMaterializerNoDDL(t *testing.T) { // 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, targetKs, ""), &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") @@ -2745,7 +2724,7 @@ func TestMaterializerTableMismatchNonCopy(t *testing.T) { // 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, targetKs, ""), &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") @@ -2791,7 +2770,7 @@ func TestMaterializerTableMismatchCopy(t *testing.T) { // 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, targetKs, ""), &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") @@ -2833,7 +2812,7 @@ func TestMaterializerNoSourceTable(t *testing.T) { 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, targetKs, ""), &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") @@ -2881,7 +2860,7 @@ func TestMaterializerSyntaxError(t *testing.T) { 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, targetKs, ""), &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'") @@ -2929,7 +2908,7 @@ func TestMaterializerNotASelect(t *testing.T) { 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, targetKs, ""), &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") @@ -3007,7 +2986,7 @@ func TestMaterializerNoGoodVindex(t *testing.T) { 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, targetKs, ""), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) errs = append(errs, errNoVindex) } @@ -3082,7 +3061,7 @@ func TestMaterializerComplexVindexExpression(t *testing.T) { 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, targetKs, ""), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) errs = append(errs, errNoVindex) } @@ -3157,7 +3136,7 @@ func TestMaterializerNoVindexInExpression(t *testing.T) { 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, targetKs, ""), &sqltypes.Result{}, nil) + targetTablet.vrdbClient.ExpectRequest(fmt.Sprintf(readAllWorkflows, tenv.dbName, ""), &sqltypes.Result{}, nil) errs = append(errs, errNoVindex) } @@ -3166,22 +3145,20 @@ func TestMaterializerNoVindexInExpression(t *testing.T) { } func TestBuildReadVReplicationWorkflowsQuery(t *testing.T) { - dbName := "vt_testks" + tm := &TabletManager{ + DBConfigs: &dbconfigs.DBConfigs{ + DBName: "vt_testks", + }, + } tests := []struct { name string req *tabletmanagerdatapb.ReadVReplicationWorkflowsRequest want string wantErr string }{ - { - name: "no db name", - req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{}, - wantErr: errNoDBName.Error(), - }, { name: "all options", req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ - DbName: dbName, IncludeIds: []int32{1, 2, 3}, IncludeWorkflows: []string{"wf1", "wf2"}, ExcludeWorkflows: []string{"1wf"}, @@ -3193,7 +3170,6 @@ func TestBuildReadVReplicationWorkflowsQuery(t *testing.T) { { name: "2 workflows if running", req: &tabletmanagerdatapb.ReadVReplicationWorkflowsRequest{ - DbName: dbName, IncludeWorkflows: []string{"wf1", "wf2"}, IncludeStates: []binlogdatapb.VReplicationWorkflowState{binlogdatapb.VReplicationWorkflowState_Running}, }, @@ -3202,7 +3178,7 @@ func TestBuildReadVReplicationWorkflowsQuery(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := buildReadVReplicationWorkflowsQuery(tt.req) + got, err := tm.buildReadVReplicationWorkflowsQuery(tt.req) if tt.wantErr != "" { require.EqualError(t, err, tt.wantErr) } else { diff --git a/proto/tabletmanagerdata.proto b/proto/tabletmanagerdata.proto index 8645d261f45..113dc257902 100644 --- a/proto/tabletmanagerdata.proto +++ b/proto/tabletmanagerdata.proto @@ -551,7 +551,6 @@ message DeleteVReplicationWorkflowResponse { } message HasVReplicationWorkflowsRequest { - string db_name = 1; } message HasVReplicationWorkflowsResponse { @@ -559,13 +558,12 @@ message HasVReplicationWorkflowsResponse { } message ReadVReplicationWorkflowsRequest { - string db_name = 1; - repeated int32 include_ids = 2; - repeated string include_workflows = 3; - repeated binlogdata.VReplicationWorkflowState include_states = 4; - repeated string exclude_workflows = 5; - repeated binlogdata.VReplicationWorkflowState exclude_states = 6; - bool exclude_frozen = 7; + 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 { diff --git a/web/vtadmin/src/proto/vtadmin.d.ts b/web/vtadmin/src/proto/vtadmin.d.ts index 285808a5035..d9e8308d9bb 100644 --- a/web/vtadmin/src/proto/vtadmin.d.ts +++ b/web/vtadmin/src/proto/vtadmin.d.ts @@ -27769,9 +27769,6 @@ export namespace tabletmanagerdata { /** Properties of a HasVReplicationWorkflowsRequest. */ interface IHasVReplicationWorkflowsRequest { - - /** HasVReplicationWorkflowsRequest db_name */ - db_name?: (string|null); } /** Represents a HasVReplicationWorkflowsRequest. */ @@ -27783,9 +27780,6 @@ export namespace tabletmanagerdata { */ constructor(properties?: tabletmanagerdata.IHasVReplicationWorkflowsRequest); - /** HasVReplicationWorkflowsRequest db_name. */ - public db_name: string; - /** * Creates a new HasVReplicationWorkflowsRequest instance using the specified properties. * @param [properties] Properties to set @@ -27964,9 +27958,6 @@ export namespace tabletmanagerdata { /** Properties of a ReadVReplicationWorkflowsRequest. */ interface IReadVReplicationWorkflowsRequest { - /** ReadVReplicationWorkflowsRequest db_name */ - db_name?: (string|null); - /** ReadVReplicationWorkflowsRequest include_ids */ include_ids?: (number[]|null); @@ -27995,9 +27986,6 @@ export namespace tabletmanagerdata { */ constructor(properties?: tabletmanagerdata.IReadVReplicationWorkflowsRequest); - /** ReadVReplicationWorkflowsRequest db_name. */ - public db_name: string; - /** ReadVReplicationWorkflowsRequest include_ids. */ public include_ids: number[]; diff --git a/web/vtadmin/src/proto/vtadmin.js b/web/vtadmin/src/proto/vtadmin.js index 4e0abf83dba..bfd74e78997 100644 --- a/web/vtadmin/src/proto/vtadmin.js +++ b/web/vtadmin/src/proto/vtadmin.js @@ -63402,7 +63402,6 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { * Properties of a HasVReplicationWorkflowsRequest. * @memberof tabletmanagerdata * @interface IHasVReplicationWorkflowsRequest - * @property {string|null} [db_name] HasVReplicationWorkflowsRequest db_name */ /** @@ -63420,14 +63419,6 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { this[keys[i]] = properties[keys[i]]; } - /** - * HasVReplicationWorkflowsRequest db_name. - * @member {string} db_name - * @memberof tabletmanagerdata.HasVReplicationWorkflowsRequest - * @instance - */ - HasVReplicationWorkflowsRequest.prototype.db_name = ""; - /** * Creates a new HasVReplicationWorkflowsRequest instance using the specified properties. * @function create @@ -63452,8 +63443,6 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { HasVReplicationWorkflowsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.db_name != null && Object.hasOwnProperty.call(message, "db_name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.db_name); return writer; }; @@ -63488,10 +63477,6 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.db_name = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -63527,9 +63512,6 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { HasVReplicationWorkflowsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.db_name != null && message.hasOwnProperty("db_name")) - if (!$util.isString(message.db_name)) - return "db_name: string expected"; return null; }; @@ -63544,10 +63526,7 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { HasVReplicationWorkflowsRequest.fromObject = function fromObject(object) { if (object instanceof $root.tabletmanagerdata.HasVReplicationWorkflowsRequest) return object; - let message = new $root.tabletmanagerdata.HasVReplicationWorkflowsRequest(); - if (object.db_name != null) - message.db_name = String(object.db_name); - return message; + return new $root.tabletmanagerdata.HasVReplicationWorkflowsRequest(); }; /** @@ -63559,15 +63538,8 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HasVReplicationWorkflowsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.db_name = ""; - if (message.db_name != null && message.hasOwnProperty("db_name")) - object.db_name = message.db_name; - return object; + HasVReplicationWorkflowsRequest.toObject = function toObject() { + return {}; }; /** @@ -63808,7 +63780,6 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { * Properties of a ReadVReplicationWorkflowsRequest. * @memberof tabletmanagerdata * @interface IReadVReplicationWorkflowsRequest - * @property {string|null} [db_name] ReadVReplicationWorkflowsRequest db_name * @property {Array.|null} [include_ids] ReadVReplicationWorkflowsRequest include_ids * @property {Array.|null} [include_workflows] ReadVReplicationWorkflowsRequest include_workflows * @property {Array.|null} [include_states] ReadVReplicationWorkflowsRequest include_states @@ -63837,14 +63808,6 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { this[keys[i]] = properties[keys[i]]; } - /** - * ReadVReplicationWorkflowsRequest db_name. - * @member {string} db_name - * @memberof tabletmanagerdata.ReadVReplicationWorkflowsRequest - * @instance - */ - ReadVReplicationWorkflowsRequest.prototype.db_name = ""; - /** * ReadVReplicationWorkflowsRequest include_ids. * @member {Array.} include_ids @@ -63917,34 +63880,32 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { ReadVReplicationWorkflowsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.db_name != null && Object.hasOwnProperty.call(message, "db_name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.db_name); if (message.include_ids != null && message.include_ids.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); + 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 3, wireType 2 =*/26).string(message.include_workflows[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 4, wireType 2 =*/34).fork(); + 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 5, wireType 2 =*/42).string(message.exclude_workflows[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 6, wireType 2 =*/50).fork(); + 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 7, wireType 0 =*/56).bool(message.exclude_frozen); + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.exclude_frozen); return writer; }; @@ -63980,10 +63941,6 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.db_name = reader.string(); - break; - } - case 2: { if (!(message.include_ids && message.include_ids.length)) message.include_ids = []; if ((tag & 7) === 2) { @@ -63994,13 +63951,13 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { message.include_ids.push(reader.int32()); break; } - case 3: { + case 2: { if (!(message.include_workflows && message.include_workflows.length)) message.include_workflows = []; message.include_workflows.push(reader.string()); break; } - case 4: { + case 3: { if (!(message.include_states && message.include_states.length)) message.include_states = []; if ((tag & 7) === 2) { @@ -64011,13 +63968,13 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { message.include_states.push(reader.int32()); break; } - case 5: { + case 4: { if (!(message.exclude_workflows && message.exclude_workflows.length)) message.exclude_workflows = []; message.exclude_workflows.push(reader.string()); break; } - case 6: { + case 5: { if (!(message.exclude_states && message.exclude_states.length)) message.exclude_states = []; if ((tag & 7) === 2) { @@ -64028,7 +63985,7 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { message.exclude_states.push(reader.int32()); break; } - case 7: { + case 6: { message.exclude_frozen = reader.bool(); break; } @@ -64067,9 +64024,6 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { ReadVReplicationWorkflowsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.db_name != null && message.hasOwnProperty("db_name")) - if (!$util.isString(message.db_name)) - return "db_name: string expected"; if (message.include_ids != null && message.hasOwnProperty("include_ids")) { if (!Array.isArray(message.include_ids)) return "include_ids: array expected"; @@ -64143,8 +64097,6 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { if (object instanceof $root.tabletmanagerdata.ReadVReplicationWorkflowsRequest) return object; let message = new $root.tabletmanagerdata.ReadVReplicationWorkflowsRequest(); - if (object.db_name != null) - message.db_name = String(object.db_name); if (object.include_ids) { if (!Array.isArray(object.include_ids)) throw TypeError(".tabletmanagerdata.ReadVReplicationWorkflowsRequest.include_ids: array expected"); @@ -64273,12 +64225,8 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { object.exclude_workflows = []; object.exclude_states = []; } - if (options.defaults) { - object.db_name = ""; + if (options.defaults) object.exclude_frozen = false; - } - if (message.db_name != null && message.hasOwnProperty("db_name")) - object.db_name = message.db_name; if (message.include_ids && message.include_ids.length) { object.include_ids = []; for (let j = 0; j < message.include_ids.length; ++j) From 60f7d055fc5ed3e535ba111b389f4c36de7d4c54 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Sun, 10 Mar 2024 00:22:32 -0500 Subject: [PATCH 35/35] Minor changes after self review of new code Signed-off-by: Matt Lord --- go/vt/vttablet/tabletmanager/rpc_vreplication.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication.go b/go/vt/vttablet/tabletmanager/rpc_vreplication.go index c89c6f8cf7f..1489d6eccb7 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -527,6 +527,7 @@ func (tm *TabletManager) buildReadVReplicationWorkflowsQuery(req *tabletmanagerd 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)) @@ -581,12 +582,9 @@ func (tm *TabletManager) buildReadVReplicationWorkflowsQuery(req *tabletmanagerd } additionalPredicates.WriteByte(')') } + parsed := sqlparser.BuildParsedQuery(sqlReadVReplicationWorkflows, sidecar.GetIdentifier(), ":db", additionalPredicates.String()) - query, err := parsed.GenerateQuery(bindVars, nil) - if err != nil { - return "", err - } - return query, nil + return parsed.GenerateQuery(bindVars, nil) } // buildUpdateVReplicationWorkflowsQuery builds the SQL query used to update @@ -647,6 +645,6 @@ func (tm *TabletManager) buildUpdateVReplicationWorkflowsQuery(req *tabletmanage } predicates.WriteByte(')') } - query := sqlparser.BuildParsedQuery(sqlUpdateVReplicationWorkflows, sidecar.GetIdentifier(), sets.String(), tm.DBConfigs.DBName, predicates.String()).Query - return query, nil + + return sqlparser.BuildParsedQuery(sqlUpdateVReplicationWorkflows, sidecar.GetIdentifier(), sets.String(), tm.DBConfigs.DBName, predicates.String()).Query, nil }