Closed mattlord closed 4 months ago
With this small patch the workflow is no longer deleted, but we still have query serving issues:
diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go
index efa9fc8937..3f1db23511 100644
--- a/go/vt/vtctl/workflow/server.go
+++ b/go/vt/vtctl/workflow/server.go
@@ -3168,10 +3168,12 @@ func (s *Server) switchWrites(ctx context.Context, req *vtctldatapb.WorkflowSwit
return handleError("failed to reset the sequences", err)
}
- ts.Logger().Infof("Creating reverse streams")
- if err := sw.createReverseVReplication(ctx); err != nil {
- sw.cancelMigration(ctx, sm)
- return handleError("failed to create the reverse vreplication streams", err)
+ if req.EnableReverseReplication && ts.workflow != ts.reverseWorkflow {
+ ts.Logger().Infof("Creating reverse streams")
+ if err := sw.createReverseVReplication(ctx); err != nil {
+ sw.cancelMigration(ctx, sm)
+ return handleError("failed to create the reverse vreplication streams", err)
+ }
}
} else {
if cancel {
diff --git a/go/vt/vtctl/workflow/traffic_switcher.go b/go/vt/vtctl/workflow/traffic_switcher.go
index d4fe77130a..11168e5a64 100644
--- a/go/vt/vtctl/workflow/traffic_switcher.go
+++ b/go/vt/vtctl/workflow/traffic_switcher.go
@@ -1010,9 +1010,11 @@ func (ts *trafficSwitcher) cancelMigration(ctx context.Context, sm *StreamMigrat
ts.Logger().Errorf("Cancel migration failed: could not restart vreplication: %v", err)
}
- err = ts.deleteReverseVReplication(ctx)
- if err != nil {
- ts.Logger().Errorf("Cancel migration failed: could not delete revers vreplication entries: %v", err)
+ if ts.workflow == ts.reverseWorkflow {
+ err = ts.deleteReverseVReplication(ctx)
+ if err != nil {
+ ts.Logger().Errorf("Cancel migration failed: could not delete reverse vreplication entries: %v", err)
+ }
}
}
Overview of the Issue
If the ReverseTraffic step fails, the cancellation of the associated steps can delete the workflow — leaving it and the keyspace in a broken state.
Reproduction Steps
Here is a repeatable test case on main:
Results being:
Binary Version
Operating System and Environment details
Log Fragments
No response