pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mme...@apache.org
Subject [incubator-pulsar] branch master updated: Handle /managed-ledgers znode existance on cluster init (#2379) (#2510)
Date Tue, 04 Sep 2018 21:41:50 GMT
This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 889b1bf  Handle /managed-ledgers znode existance on cluster init (#2379) (#2510)
889b1bf is described below

commit 889b1bfe8c28075d64ee02bd63510de0d01772b9
Author: Ivan Kelly <ivank@apache.org>
AuthorDate: Tue Sep 4 23:41:47 2018 +0200

    Handle /managed-ledgers znode existance on cluster init (#2379) (#2510)
    
    ManagedLedger clients may create the /managed-ledger znode on boot, so
    if a broker starts before the metadata is initialized, it could
    potentially block initialization.
    
    This patch changes this by making the existance of /managed-ledger a
    non-error condition.
---
 .../main/java/org/apache/pulsar/PulsarClusterMetadataSetup.java    | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarClusterMetadataSetup.java
b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarClusterMetadataSetup.java
index e35daef..9dd065a 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarClusterMetadataSetup.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarClusterMetadataSetup.java
@@ -147,7 +147,12 @@ public class PulsarClusterMetadataSetup {
             }
         }
 
-        localZk.create("/managed-ledgers", new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
+        try {
+            localZk.create("/managed-ledgers", new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE,
CreateMode.PERSISTENT);
+        } catch (NodeExistsException e) {
+            // Ignore
+        }
+
         localZk.create("/namespace", new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
 
         try {


Mime
View raw message