zentol commented on a change in pull request #7928: [FLINK-11850][zk] Tolerate
concurrent child deletions when deleting owned zNode
URL: https://github.com/apache/flink/pull/7928#discussion_r263450942
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/highavailability/zookeeper/ZooKeeperHaServices.java
##########
@@ -251,7 +251,20 @@ private void cleanupZooKeeperPaths() throws Exception {
private void deleteOwnedZNode() throws Exception {
// delete the HA_CLUSTER_ID znode which is owned by this cluster
- client.delete().deletingChildrenIfNeeded().forPath("/");
+
+ // Since we are using Curator version 2.12 there is a bug in
deleting the children
+ // if there is a concurrent delete operation. Therefore we need
to add this retry
+ // logic. See https://issues.apache.org/jira/browse/CURATOR-430
for more information.
+ // The retry logic can be removed once we upgrade to Curator
version >= 4.0.1.
+ boolean zNodeDeleted = false;
+ while (!zNodeDeleted) {
+ try {
+
client.delete().deletingChildrenIfNeeded().forPath("/");
+ zNodeDeleted = true;
+ } catch (KeeperException.NoNodeException ignored) {
+ // concurrent delete operation. Try again.
Review comment:
we could log this on debug just in case.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services