Skip to content

Commit

Permalink
vtctldclient OnlineDDL cancel <keyspace> all
Browse files Browse the repository at this point in the history
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
  • Loading branch information
shlomi-noach committed Jul 2, 2024
1 parent 446c7d7 commit 9ef5a5b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions go/cmd/vtctldclient/command/onlineddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ var (
RunE: commandOnlineDDLCancel,
}
OnlineDDLCleanup = &cobra.Command{
Use: "cleanup <keyspace> <uuid>",
Short: "Mark a given schema migration ready for artifact cleanup.",
Use: "cleanup <keyspace> <uuid|all>",
Short: "Mark a given schema migration, or all complete/failed/cancelled migrations, ready for artifact cleanup.",
Example: "OnlineDDL cleanup test_keyspace 82fa54ac_e83e_11ea_96b7_f875a4d24e90",
DisableFlagsInUseLine: true,
Args: cobra.ExactArgs(2),
Expand Down Expand Up @@ -167,12 +167,10 @@ func commandOnlineDDLCancel(cmd *cobra.Command, args []string) error {
}

func commandOnlineDDLCleanup(cmd *cobra.Command, args []string) error {
keyspace := cmd.Flags().Arg(0)
uuid := cmd.Flags().Arg(1)
if !schema.IsOnlineDDLUUID(uuid) {
return fmt.Errorf("%s is not a valid UUID", uuid)
keyspace, uuid, err := analyzeOnlineDDLCommandWithUuidOrAllArgument(cmd)
if err != nil {
return err
}

cli.FinishedParsing(cmd)

resp, err := client.CleanupSchemaMigration(commandCtx, &vtctldatapb.CleanupSchemaMigrationRequest{
Expand Down

0 comments on commit 9ef5a5b

Please sign in to comment.