Skip to content

Commit

Permalink
Fix logic for checking for route for writes
Browse files Browse the repository at this point in the history
Signed-off-by: Rohit Nayak <[email protected]>
  • Loading branch information
rohit-nayak-ps committed Sep 7, 2024
1 parent e074b44 commit 36b8e0b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions go/vt/vtctl/workflow/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1028,10 +1028,10 @@ func (s *Server) getWorkflowState(ctx context.Context, targetKeyspace, workflowN
return nil, nil, err
}
for _, table := range ts.Tables() {
// If a rule for primary exists for any table and points to the target keyspace,
// If a rule for the primary tablet type exists for any table and points to the target keyspace,
// then writes have been switched.
rr := globalRules[fmt.Sprintf("%s.%s", ts.sourceKeyspace, table)]
if len(rr) > 0 && rr[0] != fmt.Sprintf("%s.%s", ts.sourceKeyspace, table) {
rr := globalRules[fmt.Sprintf("%s.%s", sourceKeyspace, table)]
if len(rr) > 0 && rr[0] != fmt.Sprintf("%s.%s", sourceKeyspace, table) {
state.WritesSwitched = true
break
}
Expand Down

0 comments on commit 36b8e0b

Please sign in to comment.