-
Notifications
You must be signed in to change notification settings - Fork 502
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
fix: can't recover after a upgrade failed #120
Changes from 1 commit
a7de64c
2cfbde5
2b78c7b
fc67d9a
19ac0fa
16b03a3
99f3a37
bf8b5a4
5781db6
756691a
645f067
4cf1d11
24524f2
8d149b7
19eddb5
3afa97a
3caece1
bd16aaf
2de52da
f666f20
5938988
7cb3f53
5429058
8ea29e7
7239470
e0b1163
63d333f
8b29919
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,11 +84,16 @@ func (tku *tikvUpgrader) Upgrade(tc *v1alpha1.TidbCluster, oldSet *apps.Stateful | |
return controller.RequeueErrorf("tidbcluster: [%s/%s]'s tikv pod: [%s] have not label: %s", ns, tcName, podName, apps.ControllerRevisionHashLabelKey) | ||
} | ||
|
||
if store == nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move this to after line 76 to avoid retrieving pod when store is nil. |
||
setUpgradePartition(newSet, i) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why set partition to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should return an error if store == nil |
||
continue | ||
} | ||
if revision == tc.Status.TiKV.StatefulSet.UpdateRevision { | ||
|
||
if pod.Status.Phase != corev1.PodRunning { | ||
return controller.RequeueErrorf("tidbcluster: [%s/%s]'s upgraded tikv pods are not all running", ns, tcName) | ||
} | ||
if store == nil || store.State != v1alpha1.TiKVStateUp { | ||
if store.State != v1alpha1.TiKVStateUp { | ||
return controller.RequeueErrorf("tidbcluster: [%s/%s]'s upgraded tikv are not all ready", ns, tcName) | ||
} | ||
err := tku.endEvictLeader(tc, i) | ||
|
@@ -199,11 +204,6 @@ func (tku *tikvUpgrader) getStoreByOrdinal(tc *v1alpha1.TidbCluster, ordinal int | |
return &store | ||
} | ||
} | ||
for _, store := range tc.Status.TiKV.TombstoneStores { | ||
if store.PodName == podName { | ||
return &store | ||
} | ||
} | ||
return nil | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/have not/has no/