-
Notifications
You must be signed in to change notification settings - Fork 501
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 pv patch continuously problem #2769
Conversation
@@ -60,6 +60,10 @@ func setTidbClusterSpecDefault(tc *v1alpha1.TidbCluster) { | |||
d := false | |||
tc.Spec.EnablePVReclaim = &d | |||
} | |||
recyclePVP := corev1.PersistentVolumeReclaimRecycle |
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.
Suggest using retain as the default policy. WDYT @cofyc
Retain is what we suggested in our docs and only few PVs support recycle.
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.
updated.
l := label.Label(pvc.Labels) | ||
switch kind { | ||
case v1alpha1.TiDBClusterKind: | ||
if !l.IsPD() && !l.IsTiDB() && !l.IsTiKV() && !l.IsTiFlash() { |
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.
Pump also uses PV.
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.
updated.
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.
LGTM
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.
LGTM
/merge |
Your auto merge job has been accepted, waiting for:
|
/run-all-tests |
/run-all-tests |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-1.1 in PR #2783 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com> Co-authored-by: Song Gao <disxiaofei@163.com>
What problem does this PR solve?
Currently, pv would be continuously patched which is not we want. I found that there are mainly 2 problems in the current logic:
tidbmonitor
' pvc.PersistentVolumeReclaimPolicy
in the Spec, the comparing here will be not equal forever.What is changed and how does it work?
Make
PersistentVolumeReclaimPolicy
as pointer and fix the selector logic.Does this PR introduce a user-facing change?: