Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stable scheduling: fix bug in reporting assigned nodes of tidb members #531

Merged
merged 1 commit into from
May 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy the old value because we should not clear it in any case (e.g. new pod is in pending status)

}
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