Skip to content

Commit

Permalink
remove currentPrimary
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
  • Loading branch information
timvaillancourt committed Jul 10, 2024
1 parent 46a3526 commit 381e722
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions go/vt/vttablet/tabletmanager/rpc_replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -707,11 +707,6 @@ func (tm *TabletManager) setReplicationSourceRepairReplication(ctx context.Conte
return err
}

currentPrimary, err := tm.TopoServer.GetTablet(ctx, parentAlias)
if err != nil {
return vterrors.Wrapf(err, "cannot read primary tablet %v", parentAlias)
}

durabilityName, err := tm.TopoServer.GetKeyspaceDurability(ctx, tm.Tablet().Keyspace)
if err != nil {
return vterrors.Wrapf(err, "cannot read keyspace durability policy %v", tm.Tablet().Keyspace)
Expand All @@ -724,7 +719,7 @@ func (tm *TabletManager) setReplicationSourceRepairReplication(ctx context.Conte

// If using semi-sync, we need to enable it before connecting to primary.
// We should set the correct type, since it is used in replica semi-sync.
semiSyncAction, err := tm.convertBoolToSemiSyncAction(reparentutil.IsReplicaSemiSync(durability, currentPrimary.Tablet, tm.Tablet()))
semiSyncAction, err := tm.convertBoolToSemiSyncAction(reparentutil.IsReplicaSemiSync(durability, parent.Tablet, tm.Tablet()))
if err != nil {
return err
}
Expand Down

0 comments on commit 381e722

Please sign in to comment.