Skip to content

Commit

Permalink
Remove resign ddl owner logic for tidb-servers
Browse files Browse the repository at this point in the history
Signed-off-by: Aylei <rayingecho@gmail.com>
  • Loading branch information
aylei committed Nov 26, 2019
1 parent f67ed33 commit 6787a4a
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions pkg/manager/member/tidb_upgrader.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ import (
glog "k8s.io/klog"
)

const (
// MaxResignDDLOwnerCount is the max regign DDL owner count
MaxResignDDLOwnerCount = 3
)

type tidbUpgrader struct {
podLister corelisters.PodLister
tidbControl controller.TiDBControlInterface
Expand Down Expand Up @@ -96,20 +91,6 @@ func (tdu *tidbUpgrader) Upgrade(tc *v1alpha1.TidbCluster, oldSet *apps.Stateful
}

func (tdu *tidbUpgrader) upgradeTiDBPod(tc *v1alpha1.TidbCluster, ordinal int32, newSet *apps.StatefulSet) error {
tcName := tc.GetName()
if tc.Spec.TiDB.Replicas > 1 {
if member, exist := tc.Status.TiDB.Members[tidbPodName(tcName, ordinal)]; exist && member.Health {
hasResign, err := tdu.tidbControl.ResignDDLOwner(tc, ordinal)
if (!hasResign || err != nil) && tc.Status.TiDB.ResignDDLOwnerRetryCount < MaxResignDDLOwnerCount {
glog.Errorf("tidb upgrader: failed to resign ddl owner to %s, %v", member.Name, err)
tc.Status.TiDB.ResignDDLOwnerRetryCount++
return err
}
glog.Infof("tidb upgrader: resign ddl owner to %s successfully", member.Name)
}
}

tc.Status.TiDB.ResignDDLOwnerRetryCount = 0
setUpgradePartition(newSet, ordinal)
return nil
}
Expand Down

0 comments on commit 6787a4a

Please sign in to comment.