You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/03/07 18:24:01 UTC

[GitHub] [flink] tillrohrmann commented on a change in pull request #7928: [FLINK-11850][zk] Tolerate concurrent child deletions when deleting owned zNode

tillrohrmann 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_r263508836
 
 

 ##########
 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:
   True, will add it.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services