diff --git a/go/test/endtoend/vreplication/resharding_workflows_v2_test.go b/go/test/endtoend/vreplication/resharding_workflows_v2_test.go index f82fbb2b04f..c1d1c72c315 100644 --- a/go/test/endtoend/vreplication/resharding_workflows_v2_test.go +++ b/go/test/endtoend/vreplication/resharding_workflows_v2_test.go @@ -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 { @@ -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 diff --git a/go/test/endtoend/vreplication/wrappers_test.go b/go/test/endtoend/vreplication/wrappers_test.go index c91eeddcfd0..ab9a8eb9dfb 100644 --- a/go/test/endtoend/vreplication/wrappers_test.go +++ b/go/test/endtoend/vreplication/wrappers_test.go @@ -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) } diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index aea51898bc8..c339dcfbcd9 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -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