Skip to content

Commit

Permalink
stable scheduling: fix bug in reporting assigned nodes of tidb members (
Browse files Browse the repository at this point in the history
  • Loading branch information
cofyc authored and weekface committed May 29, 2019
1 parent f12b599 commit 3a06f1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/manager/member/tidb_member_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ func (tmm *tidbMemberManager) syncTidbClusterStatus(tc *v1alpha1.TidbCluster, se
oldTidbMember, exist := tc.Status.TiDB.Members[name]
if exist {
newTidbMember.LastTransitionTime = oldTidbMember.LastTransitionTime
newTidbMember.NodeName = oldTidbMember.NodeName
}
if !exist || oldTidbMember.Health != newTidbMember.Health {
newTidbMember.LastTransitionTime = metav1.Now()
Expand All @@ -398,10 +399,9 @@ func (tmm *tidbMemberManager) syncTidbClusterStatus(tc *v1alpha1.TidbCluster, se
return err
}
if pod != nil && pod.Spec.NodeName != "" {
// Update assiged node
// Update assiged node if pod exists and is scheduled
newTidbMember.NodeName = pod.Spec.NodeName
}
// Ignore if pod does not exist or not scheduled
tidbStatus[name] = newTidbMember
}
tc.Status.TiDB.Members = tidbStatus
Expand Down

0 comments on commit 3a06f1e

Please sign in to comment.