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

[release-18.0] Backport: VReplication SwitchWrites: Properly return errors in SwitchWrites #14800 #14824

Merged
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions go/vt/wrangler/traffic_switcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,11 +487,11 @@ func (wr *Wrangler) SwitchWrites(ctx context.Context, targetKeyspace, workflowNa
ts, ws, err := wr.getWorkflowState(ctx, targetKeyspace, workflowName)
_ = ws
if err != nil {
handleError("failed to get the current workflow state", err)
return handleError("failed to get the current workflow state", err)
}
if ts == nil {
errorMsg := fmt.Sprintf("workflow %s not found in keyspace %s", workflowName, targetKeyspace)
handleError("failed to get the current workflow state", fmt.Errorf(errorMsg))
return handleError("failed to get the current workflow state", fmt.Errorf(errorMsg))
}

var sw iswitcher
Expand All @@ -508,7 +508,7 @@ func (wr *Wrangler) SwitchWrites(ctx context.Context, targetKeyspace, workflowNa

ts.Logger().Infof("Built switching metadata: %+v", ts)
if err := ts.validate(ctx); err != nil {
handleError("workflow validation failed", err)
return handleError("workflow validation failed", err)
}

if reverseReplication {
Expand Down Expand Up @@ -655,7 +655,7 @@ func (wr *Wrangler) SwitchWrites(ctx context.Context, targetKeyspace, workflowNa
return handleError("failed to update the routing rules", err)
}
if err := sw.streamMigraterfinalize(ctx, ts, sourceWorkflows); err != nil {
handleError("failed to finalize the traffic switch", err)
return handleError("failed to finalize the traffic switch", err)
}
if reverseReplication {
if err := sw.startReverseVReplication(ctx); err != nil {
Expand Down
Loading