Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5B68B200D53 for ; Tue, 5 Dec 2017 19:58:59 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 59F72160C1B; Tue, 5 Dec 2017 18:58:59 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A0068160BF1 for ; Tue, 5 Dec 2017 19:58:58 +0100 (CET) Received: (qmail 64450 invoked by uid 500); 5 Dec 2017 18:58:57 -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 64438 invoked by uid 99); 5 Dec 2017 18:58:57 -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, 05 Dec 2017 18:58:57 +0000 From: GitBox To: commits@pulsar.apache.org Subject: [GitHub] jai1 closed pull request #932: Added more log messages for SLA Namespace acquisition Message-ID: <151250033723.27064.1099695634868862074.gitbox@gitbox.apache.org> archived-at: Tue, 05 Dec 2017 18:58:59 -0000 jai1 closed pull request #932: Added more log messages for SLA Namespace acquisition URL: https://github.com/apache/incubator-pulsar/pull/932 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java index 00033bcda..97f1ddc4e 100644 --- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java +++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java @@ -352,14 +352,17 @@ public synchronized void brokerIsAFollowerNow() { private void acquireSLANamespace() { try { // Namespace not created hence no need to unload it + String nsName = NamespaceService.getSLAMonitorNamespace(getAdvertisedAddress(), config); if (!this.globalZkCache.exists( - AdminResource.path(POLICIES) + "/" + NamespaceService.getSLAMonitorNamespace(getAdvertisedAddress(), config))) { + AdminResource.path(POLICIES) + "/" + nsName)) { + LOG.info("SLA Namespace = {} doesn't exist.", nsName); return; } boolean acquiredSLANamespace; try { acquiredSLANamespace = nsservice.registerSLANamespace(); + LOG.info("Register SLA Namespace = {}, returned - {}.", nsName, acquiredSLANamespace); } catch (PulsarServerException e) { acquiredSLANamespace = false; } diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java index 8e5111262..3ded848c1 100644 --- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java +++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java @@ -236,7 +236,6 @@ private boolean registerNamespace(String namespace, boolean ensureOwned) throws try { NamespaceName nsname = new NamespaceName(namespace); - // [Bug 6504511] Enable writing with JSON format String otherUrl = null; NamespaceBundle nsFullBundle = null; @@ -759,18 +758,19 @@ public void unloadSLANamespace() throws Exception { PulsarAdmin adminClient = null; String namespaceName = getSLAMonitorNamespace(host, config); - if (LOG.isDebugEnabled()) { - LOG.debug("Trying to unload SLA namespace {}", namespaceName); - } + LOG.info("Checking owner for SLA namespace {}", namespaceName); NamespaceBundle nsFullBundle = getFullBundle(new NamespaceName(namespaceName)); if (!getOwner(nsFullBundle).isPresent()) { // No one owns the namespace so no point trying to unload it + // Next lookup will assign the bundle to this broker. return; } + + LOG.info("Trying to unload SLA namespace {}", namespaceName); adminClient = pulsar.getAdminClient(); adminClient.namespaces().unload(namespaceName); - LOG.debug("Namespace {} unloaded successfully", namespaceName); + LOG.info("Namespace {} unloaded successfully", namespaceName); } public static String getHeartbeatNamespace(String host, ServiceConfiguration config) { ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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