You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/12/18 02:02:37 UTC
[GitHub] [pulsar] murong00 commented on a change in pull request #5879: Fix
#5825: make PulsarClusterMetadataSetup idempotent
murong00 commented on a change in pull request #5879: Fix #5825: make PulsarClusterMetadataSetup idempotent
URL: https://github.com/apache/pulsar/pull/5879#discussion_r359120106
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/PulsarClusterMetadataSetup.java
##########
@@ -113,6 +114,20 @@
private boolean help = false;
}
+ /**
+ * a wrapper for ZkUtils.createFullPathOptimistic but ignore exception of node exists
+ */
+ private static void createZkNode(ZooKeeper zkc, String path,
+ byte[] data, final List<ACL> acl, final CreateMode createMode)
+ throws KeeperException, InterruptedException {
+
+ try {
+ ZkUtils.createFullPathOptimistic(zkc, path, data, acl, createMode);
+ } catch (NodeExistsException e) {
+ // Ignore
+ }
+ }
+
Review comment:
Should we use zookeeper `multi` to ensure certain atomicity as sijie comment in #5825? For example the znode `/namespace` with old data may not be not consistent with the other new created znodes.
----------------------------------------------------------------
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