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

Fix pv patch continuously problem (#2769) #2783

Merged
merged 1 commit into from
Jun 19, 2020

Conversation

ti-srebot
Copy link
Contributor

cherry-pick #2769 to release-1.1


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:

  1. the selector for the tidbcluster pvc would select all the pvc including tidbmonitor' pvc.
case v1alpha1.TiDBClusterKind:	
     l, err = label.New().Instance(instanceName).Selector()	
     if err != nil {	
         return err	
     }
  1. If we didn't define the PersistentVolumeReclaimPolicy in the Spec, the comparing here will be not equal forever.
if pv.Spec.PersistentVolumeReclaimPolicy == policy {
    continue
}

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?:

Fix the bug that the `PV` managed by Operator would be patched continuously

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@Yisaer
Copy link
Contributor

Yisaer commented Jun 19, 2020

/merge

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@cofyc cofyc merged commit babba5a into pingcap:release-1.1 Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants