pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] jai1 closed pull request #932: Added more log messages for SLA Namespace acquisition
Date Thu, 01 Jan 1970 00:00:00 GMT
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

Mime
View raw message