diff --git a/go/cmd/vtctldclient/command/vreplication/reshard/create.go b/go/cmd/vtctldclient/command/vreplication/reshard/create.go index b8506ae61d0..05700dbb9fe 100644 --- a/go/cmd/vtctldclient/command/vreplication/reshard/create.go +++ b/go/cmd/vtctldclient/command/vreplication/reshard/create.go @@ -60,9 +60,8 @@ func commandReshardCreate(cmd *cobra.Command, args []string) error { cli.FinishedParsing(cmd) req := &vtctldatapb.ReshardCreateRequest{ - Workflow: common.BaseOptions.Workflow, - Keyspace: common.BaseOptions.TargetKeyspace, - + Workflow: common.BaseOptions.Workflow, + Keyspace: common.BaseOptions.TargetKeyspace, TabletTypes: common.CreateOptions.TabletTypes, TabletSelectionPreference: tsp, Cells: common.CreateOptions.Cells, @@ -70,10 +69,9 @@ func commandReshardCreate(cmd *cobra.Command, args []string) error { DeferSecondaryKeys: common.CreateOptions.DeferSecondaryKeys, AutoStart: common.CreateOptions.AutoStart, StopAfterCopy: common.CreateOptions.StopAfterCopy, - - SourceShards: reshardCreateOptions.sourceShards, - TargetShards: reshardCreateOptions.targetShards, - SkipSchemaCopy: reshardCreateOptions.skipSchemaCopy, + SourceShards: reshardCreateOptions.sourceShards, + TargetShards: reshardCreateOptions.targetShards, + SkipSchemaCopy: reshardCreateOptions.skipSchemaCopy, } resp, err := common.GetClient().ReshardCreate(common.GetCommandCtx(), req) if err != nil { diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index bb7158c8e2d..f4e52c14a81 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -1581,7 +1581,11 @@ func (s *Server) ReshardCreate(ctx context.Context, req *vtctldatapb.ReshardCrea log.Errorf("%w", err2) return nil, err } - rs, err := s.buildResharder(ctx, keyspace, req.Workflow, req.SourceShards, req.TargetShards, strings.Join(cells, ","), "") + tabletTypesStr := topoproto.MakeStringTypeCSV(req.TabletTypes) + if req.TabletSelectionPreference == tabletmanagerdatapb.TabletSelectionPreference_INORDER { + tabletTypesStr = discovery.InOrderHint + tabletTypesStr + } + 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") } @@ -1604,7 +1608,10 @@ 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: keyspace, + Workflow: req.Workflow, + }) } // VDiffCreate is part of the vtctlservicepb.VtctldServer interface.