Skip to content

Commit

Permalink
Update TestBasicV2Workflows so that it fails on main
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Oct 15, 2024
1 parent 9dbb24e commit 8f241e8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
10 changes: 7 additions & 3 deletions go/test/endtoend/vreplication/resharding_workflows_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,7 @@ func tstWorkflowExec(t *testing.T, cells, workflow, sourceKs, targetKs, tables,
args = append(args, "--tablet-types", tabletTypes)
}
args = append(args, "--action_timeout=10m") // At this point something is up so fail the test
if debugMode {
t.Logf("Executing workflow command: vtctldclient %v", strings.Join(args, " "))
}
t.Logf("Executing workflow command: vtctldclient %s", strings.Join(args, " "))
output, err := vc.VtctldClient.ExecuteCommandWithOutput(args...)
lastOutput = output
if err != nil {
Expand Down Expand Up @@ -746,6 +744,12 @@ func testPartialSwitches(t *testing.T) {
tstWorkflowSwitchReads(t, "", "")
checkStates(t, nextState, nextState) // idempotency

tstWorkflowReverseReads(t, "replica,rdonly", "")
checkStates(t, wrangler.WorkflowStateReadsSwitched, wrangler.WorkflowStateNotSwitched)

tstWorkflowSwitchReads(t, "", "")
checkStates(t, wrangler.WorkflowStateNotSwitched, wrangler.WorkflowStateReadsSwitched)

tstWorkflowSwitchWrites(t)
currentState = nextState
nextState = wrangler.WorkflowStateAllSwitched
Expand Down
2 changes: 1 addition & 1 deletion go/test/endtoend/vreplication/wrappers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func (v VtctldMoveTables) exec(args ...string) {
args2 := []string{"MoveTables", "--workflow=" + v.workflowName, "--target-keyspace=" + v.targetKeyspace}
args2 = append(args2, args...)
var err error
v.vc.t.Logf("Executing command: vtctldclient %s", strings.Join(args2, " "))
v.vc.t.Logf("Executing workflow command: vtctldclient %s", strings.Join(args2, " "))
v.lastOutput, err = vc.VtctldClient.ExecuteCommandWithOutput(args2...)
require.NoError(v.vc.t, err, "failed MoveTables action, error: %v: output: %s", err, v.lastOutput)
}
Expand Down
7 changes: 4 additions & 3 deletions go/vt/vtctl/workflow/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3199,9 +3199,10 @@ func (s *Server) WorkflowSwitchTraffic(ctx context.Context, req *vtctldatapb.Wor
(direction == DirectionBackward && !startState.WritesSwitched)

if direction == DirectionBackward && !onlySwitchingReads {
// This means that the reverse workflow exists. So we update the starting state
// so that we're using the reverse workflow and we can move forward with a normal
// traffic switch forward operation, from the reverse workflow's perspective.
// This means that the main workflow is FROZEN and the reverse workflow
// exists. So we update the starting state so that we're using the reverse
// workflow and we can move forward with a normal traffic switch forward
// operation, from the reverse workflow's perspective.
ts, startState, err = s.getWorkflowState(ctx, ts.sourceKeyspace, ts.reverseWorkflow)
if err != nil {
return nil, err
Expand Down

0 comments on commit 8f241e8

Please sign in to comment.