Skip to content

Commit

Permalink
Flip logic so vtctlclient continues to work
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Aug 27, 2024
1 parent 7f4abd4 commit 2c24ef7
Show file tree
Hide file tree
Showing 11 changed files with 582 additions and 582 deletions.
6 changes: 3 additions & 3 deletions go/cmd/vtctldclient/command/vreplication/vdiff/vdiff.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ var (
WaitUpdateInterval time.Duration
AutoRetry bool
MaxDiffDuration time.Duration
AutoStart bool
DoNotStart bool
}{}

deleteOptions = struct {
Expand Down Expand Up @@ -297,7 +297,7 @@ func commandCreate(cmd *cobra.Command, args []string) error {
AutoRetry: createOptions.AutoRetry,
MaxReportSampleRows: createOptions.MaxReportSampleRows,
MaxDiffDuration: protoutil.DurationToProto(createOptions.MaxDiffDuration),
AutoStart: createOptions.AutoStart,
DoNotStart: createOptions.DoNotStart,
})

if err != nil {
Expand Down Expand Up @@ -891,7 +891,7 @@ func registerCommands(root *cobra.Command) {
create.Flags().BoolVar(&createOptions.AutoRetry, "auto-retry", true, "Should this vdiff automatically retry and continue in case of recoverable errors.")
create.Flags().BoolVar(&createOptions.UpdateTableStats, "update-table-stats", false, "Update the table statistics, using ANALYZE TABLE, on each table involved in the VDiff during initialization. This will ensure that progress estimates are as accurate as possible -- but it does involve locks and can potentially impact query processing on the target keyspace.")
create.Flags().DurationVar(&createOptions.MaxDiffDuration, "max-diff-duration", 0, "How long should an individual table diff run before being stopped and restarted in order to lessen the impact on tablets due to holding open database snapshots for long periods of time (0 is the default and means no time limit).")
create.Flags().BoolVar(&createOptions.AutoStart, "auto-start", true, "Start the vdiff upon creation. When false, the vdiff will be created but will not run until resumed.")
create.Flags().BoolVar(&createOptions.DoNotStart, "do-not-start", false, "Don't start the vdiff upon creation. When specified, the vdiff will be created but will not run until resumed.")
base.AddCommand(create)

base.AddCommand(delete)
Expand Down
566 changes: 283 additions & 283 deletions go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

482 changes: 241 additions & 241 deletions go/vt/proto/vtctldata/vtctldata.pb.go

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions go/vt/proto/vtctldata/vtctldata_vtproto.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions go/vt/vtctl/workflow/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1785,7 +1785,7 @@ func (s *Server) VDiffCreate(ctx context.Context, req *vtctldatapb.VDiffCreateRe
span.Annotate("tables", req.Tables)
span.Annotate("auto_retry", req.AutoRetry)
span.Annotate("max_diff_duration", req.MaxDiffDuration)
span.Annotate("auto_start", req.AutoRetry)
span.Annotate("do_not_start", req.GetDoNotStart())

tabletTypesStr := discovery.BuildTabletTypesString(req.TabletTypes, req.TabletSelectionPreference)

Expand Down Expand Up @@ -1818,7 +1818,7 @@ func (s *Server) VDiffCreate(ctx context.Context, req *vtctldatapb.VDiffCreateRe
MaxExtraRowsToCompare: req.MaxExtraRowsToCompare,
UpdateTableStats: req.UpdateTableStats,
MaxDiffSeconds: req.MaxDiffDuration.Seconds,
AutoStart: req.GetAutoStart(),
DoNotStart: req.GetDoNotStart(),
},
ReportOptions: &tabletmanagerdatapb.VDiffReportOptions{
OnlyPks: req.OnlyPKs,
Expand Down
2 changes: 1 addition & 1 deletion go/vt/vttablet/tabletmanager/vdiff/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (vde *Engine) handleCreateResumeAction(ctx context.Context, dbClient binlog
return err
}
state := PendingState
if !options.GetCoreOptions().GetAutoStart() {
if options.GetCoreOptions().GetDoNotStart() {
state = StoppedState
}
query, err := sqlparser.ParseAndBind(sqlNewVDiff,
Expand Down
2 changes: 1 addition & 1 deletion proto/tabletmanagerdata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ message VDiffCoreOptions {
int64 max_extra_rows_to_compare = 7;
bool update_table_stats = 8;
int64 max_diff_seconds = 9;
bool auto_start = 10;
bool do_not_start = 10;
}

message VDiffOptions {
Expand Down
2 changes: 1 addition & 1 deletion proto/vtctldata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1862,7 +1862,7 @@ message VDiffCreateRequest {
bool verbose = 18;
int64 max_report_sample_rows = 19;
vttime.Duration max_diff_duration = 20;
bool auto_start = 21;
bool do_not_start = 21;
}

message VDiffCreateResponse {
Expand Down
16 changes: 8 additions & 8 deletions web/vtadmin/src/proto/vtadmin.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 30 additions & 30 deletions web/vtadmin/src/proto/vtadmin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2c24ef7

Please sign in to comment.