Skip to content

Require --keep-data and --keep-routing-rules for move-tables complete and cancel#1260

Merged
maxenglander merged 4 commits into
mainfrom
maxeng-required-movetables-args
Jun 1, 2026
Merged

Require --keep-data and --keep-routing-rules for move-tables complete and cancel#1260
maxenglander merged 4 commits into
mainfrom
maxeng-required-movetables-args

Conversation

@maxenglander
Copy link
Copy Markdown
Contributor

@maxenglander maxenglander commented May 31, 2026

Background

Vitess MoveTables workflow complete and cancel have --keep-data and --keep-routing-rules args, both of which default to false. This means that the default behavior of Vitess is to delete source data and the routing rules created by the workflow upon complete, and to delete target data and routing rules upon cancel.

Whether or not you think these defaults are good or bad, it is hopefully beyond debate that if a user is unaware of the defaults, they are potentially in for a very nasty surprise. PlanetScale's position internally is that --keep-data=true is a safer default, and therefore we've inverted the default behavior of PlanetScale Vitess. As of now, we have not documented this anywhere, and as a result some early users of pscale branch vtctld have been thrown for a loop.

After going back and forth internally about what the best defaults are, we decided that the best option for now is to simply not have defaults, and require users to explicitly specify the behavior they want.

Changes

Make the --keep-data and --keep-routing-rules flags required for both move-tables complete and cancel commands. This ensures users explicitly specify whether to keep or delete data and routing rules.

Users must now provide both flags with explicit values, one of the following:

  • --keep-data (defaults to true if no value given)
  • --keep-data=true (explicit true)
  • --keep-data=false (explicit false)

@maxenglander maxenglander requested a review from a team as a code owner May 31, 2026 18:18
… and cancel

Make the --keep-data and --keep-routing-rules flags required for both
move-tables complete and cancel commands. This ensures users explicitly
specify whether to keep or delete data and routing rules, preventing
accidental data loss.

Users must now provide both flags with explicit values:
- --keep-data (defaults to true if no value given)
- --keep-data=true (explicit true)
- --keep-data=false (explicit false)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Max Englander <max@planetscale.com>
@maxenglander maxenglander force-pushed the maxeng-required-movetables-args branch from e907a90 to 38b7f33 Compare May 31, 2026 18:27
maxenglander and others added 3 commits May 31, 2026 14:49
…movetables-args

Signed-off-by: Max Englander <max@planetscale.com>
…rules flag

The test was failing in CI because it only provided --keep-data but not
--keep-routing-rules, which is now a required flag. Updated the test to:
- Pass --keep-routing-rules=false in the command args
- Verify KeepRoutingRules is set correctly in the request

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Max Englander <max@planetscale.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Max Englander <max@planetscale.com>
@maxenglander maxenglander merged commit ceb85a0 into main Jun 1, 2026
4 checks passed
@maxenglander maxenglander deleted the maxeng-required-movetables-args branch June 1, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants