-
Notifications
You must be signed in to change notification settings - Fork 211
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
Zookeeper pod keeps crashing when scaling down and up #513
Comments
This PR (#526) can fix this issue. |
@anishakj Do you mind to take a look at this?
But in the zookeeper start up script, the script does not update the dynamic configuration file ( zookeeper-operator/docker/bin/zookeeperStart.sh Lines 131 to 137 in 72bea54
zookeeper-operator/docker/bin/zookeeperStart.sh Lines 110 to 114 in 72bea54
This causes problem when the new zookeeper node reuses an old PVC. During bootup, if the myid file and dynamic config file exist, the startup script skips updating the membership list, assuming it is correct. But in reality, this node was removed from the membership list from the dynamic config file during teardown.
|
@hoyhbx Could you please increase the coverage? |
Description
(Describe the feature, bug, question, proposal that you are requesting)
We found that zookeeper pod keeps crashing after a scale-down workload and a scale-up workload.
We found the crash is because the new pods are reusing the undeleted PVC during the scale-down process. However, this problem still persists even when we specify the
reclaimPolicy: Delete
.The root cause of this issue is because there is no guard for scale-up before finishing deleting the PVC. We found that zookeeper-operator checks if the upgrade fails before updating the statefulSet, but this check misses checking for the undeleted OrphanPVCs. When reusing the old PVC, the startup script mistakenly thinks the membership list on the old PVC is the up-to-date one and skips updating it. When ZooKeeper starts, it crashes due to inconsistent membership list.
The orphaned PVCs will never get deleted because the operator always waits for the number of ready replicas to equal to desired replicas, which will never happen since one pod keeps crashing.
Importance
(Indicate the importance of this issue to you (blocker, must-have, should-have, nice-to-have))
Importance: must-have
Location
(Where is the piece of code, package, or document affected by this issue?)
The PVC cleanup code is here:
zookeeper-operator/controllers/zookeepercluster_controller.go
Line 707 in c29d475
The logic to upgrade the statefulSet is here:
zookeeper-operator/controllers/zookeepercluster_controller.go
Line 264 in c29d475
Suggestions for an improvement
And we think that the operator should check if all OrphanPVCs are deleted before proceeding to the next upgrade.
We suggest to add a check to check if there is no Orphaned PVCs before updating the statefulSet
(How do you suggest to fix or proceed with this issue?)
The text was updated successfully, but these errors were encountered: