From commits-return-13882-archive-asf-public=cust-asf.ponee.io@pulsar.incubator.apache.org Tue Sep 4 23:41:52 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id DFF28180629 for ; Tue, 4 Sep 2018 23:41:51 +0200 (CEST) Received: (qmail 60092 invoked by uid 500); 4 Sep 2018 21:41:51 -0000 Mailing-List: contact commits-help@pulsar.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pulsar.incubator.apache.org Delivered-To: mailing list commits@pulsar.incubator.apache.org Received: (qmail 60083 invoked by uid 99); 4 Sep 2018 21:41:51 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Sep 2018 21:41:51 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 7AD4E81F02; Tue, 4 Sep 2018 21:41:50 +0000 (UTC) Date: Tue, 04 Sep 2018 21:41:50 +0000 To: "commits@pulsar.apache.org" Subject: [incubator-pulsar] branch master updated: Handle /managed-ledgers znode existance on cluster init (#2379) (#2510) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <153609731034.11179.9650610270713932624@gitbox.apache.org> From: mmerli@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-pulsar X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 79ac46a6ae50e48bed4ccb680d1f7945611f0565 X-Git-Newrev: 889b1bfe8c28075d64ee02bd63510de0d01772b9 X-Git-Rev: 889b1bfe8c28075d64ee02bd63510de0d01772b9 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated 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 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 {