Skip to content

Commit

Permalink
Fix regression where the test cluster was not setting the primary cor…
Browse files Browse the repository at this point in the history
…rectly

Signed-off-by: Rohit Nayak <[email protected]>
  • Loading branch information
rohit-nayak-ps committed Nov 17, 2023
1 parent 3403aa5 commit 5f3aed2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions go/test/endtoend/cluster/vttablet_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ type VttabletProcess struct {
DbFlavor string
Charset string
ConsolidationsURL string
IsPrimary bool

// Extra Args to be set before starting the vttablet process
ExtraArgs []string
Expand Down
3 changes: 2 additions & 1 deletion go/test/endtoend/vreplication/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ func (vc *VitessCluster) AddShards(t *testing.T, cells []*Cell, keyspace *Keyspa
tablets = append(tablets, primary)
dbProcesses = append(dbProcesses, proc)
primaryTabletUID = primary.Vttablet.TabletUID
primary.Vttablet.IsPrimary = true
}

for i := 0; i < numReplicas; i++ {
Expand Down Expand Up @@ -795,7 +796,7 @@ func (vc *VitessCluster) getPrimaryTablet(t *testing.T, ksName, shardName string
continue
}
for _, tablet := range shard.Tablets {
if strings.EqualFold(tablet.Vttablet.TabletType, "primary") {
if tablet.Vttablet.IsPrimary {
return tablet.Vttablet
}
}
Expand Down

0 comments on commit 5f3aed2

Please sign in to comment.