Handle /managed-ledgers znode existance on cluster init
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.
@@ -147,7 +147,12 @@ public class PulsarClusterMetadataSetup {
}
}
+ 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 {
