Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Workflow Update Client Command #12622

Merged
merged 47 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
5ecb846
Add update action to Workflow command
mattlord Mar 14, 2023
f5229b4
Merge remote-tracking branch 'origin/main' into workflow_update
mattlord Mar 15, 2023
c204502
Add on-ddl
mattlord Mar 15, 2023
785fff1
Made on-ddl handling 5.7 compatible
mattlord Mar 15, 2023
771a96c
Various fixes and improvements
mattlord Mar 16, 2023
df2b5d7
Correct/unify Workflow usage output
mattlord Mar 16, 2023
571e605
Test fixes
mattlord Mar 16, 2023
f21de0d
Merge remote-tracking branch 'origin/main' into workflow_update
mattlord Mar 17, 2023
28a26cd
Minor changes after self review
mattlord Mar 17, 2023
f900c1c
Move Workflow Update to RPC
mattlord Mar 21, 2023
68217b6
Modify unit test
mattlord Mar 21, 2023
203103d
Thread request through and add method to Fake TMC
mattlord Mar 21, 2023
205eeaa
Use RPC request/response type throughout
mattlord Mar 21, 2023
48bf2f8
We don't care about action within callback
mattlord Mar 21, 2023
e833885
Updates after self review
mattlord Mar 21, 2023
f284a05
Various changes and re-arranging
mattlord Mar 22, 2023
7a80ee7
Add tabletmanager unit test
mattlord Mar 22, 2023
f4ba5ab
Build out test and fix bugs found
mattlord Mar 22, 2023
b1f5573
Minor changes after self review
mattlord Mar 22, 2023
c2a7e88
Cleanup in reverse creation order
mattlord Mar 22, 2023
62194d6
Remove now incorrect unit test addition
mattlord Mar 22, 2023
63ffc23
No final results in show/listall/--dry-run update
mattlord Mar 22, 2023
8e1f4a2
Minor unit test improvements
mattlord Mar 22, 2023
0cddbbd
Nitty nitter gonna nit
mattlord Mar 22, 2023
7a99b5f
Address review comments
mattlord Mar 22, 2023
4ee9931
Use more meaningful const var name
mattlord Mar 22, 2023
97dcacf
Add vtctldclient command for Workflow update
mattlord Mar 23, 2023
ba52ffe
Minor changes after quick self review
mattlord Mar 23, 2023
6f15ad5
Minor fixes after local testing
mattlord Mar 23, 2023
3f8ec81
Update vtctldclient --help output
mattlord Mar 23, 2023
0949a03
Address review comments
mattlord Mar 23, 2023
f854db0
Address remaining review comments
mattlord Mar 23, 2023
1ccc601
Being annoyingly pedantic ... halp
mattlord Mar 23, 2023
8de128e
Missed a spot
mattlord Mar 23, 2023
14b2869
Minor improvements after final self review
mattlord Mar 23, 2023
1cbb4c5
One last tiny optimization
mattlord Mar 24, 2023
12eb98c
Since I have to run CI again...
mattlord Mar 24, 2023
5e37c3a
Re-add missing vtctl[client] check for any provided changes
mattlord Mar 24, 2023
b1520ac
Add full/proper support for Reshard worfklows.
mattlord Mar 25, 2023
c8d7238
Add the most basic e2e test
mattlord Mar 25, 2023
165703b
Use require.NotEmpty in new e2e checks
mattlord Mar 25, 2023
bdb5f90
Test updating workflow in same relative point
mattlord Mar 25, 2023
190c70b
Use same ks.wf names
mattlord Mar 25, 2023
4e2d580
Adjust comments and Changed check for shard merges.
mattlord Mar 26, 2023
06a9802
Minor comment/help output changes on final self review.
mattlord Mar 27, 2023
73ff718
Trim whitespace on provided cells and tablet types
mattlord Mar 27, 2023
7a83b56
Use topoproto.ParseTabletType for input validation
mattlord Mar 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions go/cmd/vtctldclient/command/workflows.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package command

import (
"fmt"
"sort"
"strings"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -46,7 +47,7 @@ var (
Use: "workflow",
Short: "Administer VReplication workflows (Reshard, MoveTables, etc) in the given keyspace",
DisableFlagsInUseLine: true,
Aliases: []string{"workflows", "Workflow", "Workflows"},
Aliases: []string{"Workflow"},
Args: cobra.ExactArgs(1),
RunE: commandGetWorkflows,
}
Expand Down Expand Up @@ -157,7 +158,17 @@ func commandWorkflowUpdate(cmd *cobra.Command, args []string) error {
return err
}

fmt.Printf("%s\n", resp.Results)
// Sort the inner TabletInfo slice for deterministic output.
sort.Slice(resp.Details, func(i, j int) bool {
return resp.Details[i].Tablet < resp.Details[j].Tablet
})

data, err := cli.MarshalJSON(resp)
if err != nil {
return err
}

fmt.Printf("%s\n", data)

return nil
}
Expand All @@ -173,6 +184,6 @@ func init() {
WorkflowUpdate.MarkFlagRequired("workflow")
WorkflowUpdate.Flags().StringSliceVarP(&workflowUpdateOptions.Cells, "cells", "c", []string{}, "New Cell(s) or CellAlias(es) (comma-separated) to replicate from")
mattlord marked this conversation as resolved.
Show resolved Hide resolved
mattlord marked this conversation as resolved.
Show resolved Hide resolved
WorkflowUpdate.Flags().StringSliceVarP(&workflowUpdateOptions.TabletTypes, "tablet-types", "t", []string{}, "New source tablet types to replicate from (e.g. PRIMARY, REPLICA, RDONLY)")
WorkflowUpdate.Flags().StringVarP(&workflowUpdateOptions.OnDDL, "on-ddl", "o", "", "New instruction on what to do when DDL is encountered in the VReplication stream. Possible values are IGNORE, STOP, EXEC, and EXEC_IGNORE")
WorkflowUpdate.Flags().StringVar(&workflowUpdateOptions.OnDDL, "on-ddl", "", "New instruction on what to do when DDL is encountered in the VReplication stream. Possible values are IGNORE, STOP, EXEC, and EXEC_IGNORE")
Workflow.AddCommand(WorkflowUpdate)
}
Loading