From 381e72241d27767860861bb47973a232ba7996d6 Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Wed, 10 Jul 2024 12:27:00 +0200 Subject: [PATCH] remove currentPrimary Signed-off-by: Tim Vaillancourt --- go/vt/vttablet/tabletmanager/rpc_replication.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/go/vt/vttablet/tabletmanager/rpc_replication.go b/go/vt/vttablet/tabletmanager/rpc_replication.go index 953651f69a8..2adde1a1bed 100644 --- a/go/vt/vttablet/tabletmanager/rpc_replication.go +++ b/go/vt/vttablet/tabletmanager/rpc_replication.go @@ -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) @@ -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 }