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

How to disable Pvc Cleaner? #423

Open
chenmin1992 opened this issue Nov 6, 2019 · 9 comments
Open

How to disable Pvc Cleaner? #423

chenmin1992 opened this issue Nov 6, 2019 · 9 comments

Comments

@chenmin1992
Copy link

https://github.com/presslabs/mysql-operator/pull/140/files#diff-fd332df34b6a8aed6f6e0cb14b640f07R203

I just think that PVC should stay or the data will be lost.
I think there would an option that controls the behavior of how the operator manages PVC for data safe purpose.

@AMecea
Copy link
Contributor

AMecea commented Nov 6, 2019

Hi @chenmin1992, Ther is no method to disable the PVC cleaner but the operator does not delete the data for node 0, in any case, so your data is safe. Indeed there may be some corner cases that require more attention(what I'm thinking about is when you scale the cluster down to 1 replica and node 0 is not up-to-date and you can lose data).

Also, if the cluster is scaled down its essential to remove the PVC because after a while the data from that PVC become obsolete and when the cluster is scaled back up the replication will fail.

Please give me more details of what do you think about how the operator should manage PVCs.

@abh
Copy link
Contributor

abh commented Nov 6, 2019

@AMecea For me the only feature request here would be handling the "node 0 is out of date" case (maybe refuse to scale down to a number that stops the current master?)

@chenmin1992
Copy link
Author

chenmin1992 commented Nov 7, 2019

@AMecea No, in my test case, PVC for node 0 is also deleted when deleting the mysqlcluster customresource haodai1.
WX20191107-101348

@chenmin1992
Copy link
Author

Maybe the OwnerReferences delete the PVC associated with node 0.

@chenmin1992
Copy link
Author

Yes, after deleting OwnerReferences, the PVC-0 won't be deleted.

@chenmin1992
Copy link
Author

length of the parameter of ensureVolumeClaimTemplates is always 0 so far.

@AMecea
Copy link
Contributor

AMecea commented Nov 14, 2019

Hi @chenmin1992, the PVC should be deleted when the cluster is deleted. That's the intended behavior. If you want to preserve the data then scale the cluster down to zero.

@AMecea For me the only feature request here would be handling the "node 0 is out of date" case (maybe refuse to scale down to a number that stops the current master?)

@abh, this is indeed a problem that needs to be addressed and it's more complex. Here is something that I thought about #404 (comment)

@elderapo
Copy link

Hi @chenmin1992, the PVC should be deleted when the cluster is deleted. That's the intended behavior. If you want to preserve the data then scale the cluster down to zero.

I think it would be nice to have an option like persistentVolumeReclaimPolicy to retain PVC's (or at least 1 master one) on cluster deletion.

@1447543654
Copy link

我也觉得应该有一个配置选项去控制pvc是否删除

chapsuk pushed a commit to chapsuk/mysql-operator that referenced this issue Oct 16, 2023
…/github.com/docker/distribution-2.8.2incompatible

build(deps): Bump github.com/docker/distribution from 2.8.1+incompatible to 2.8.2+incompatible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants