You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/09/01 09:20:49 UTC

[GitHub] [pulsar] gaoran10 opened a new pull request #11863: [Broker] Refine topic level backlog quota policies warning log

gaoran10 opened a new pull request #11863:
URL: https://github.com/apache/pulsar/pull/11863


   ### Motivation
   
   Currently, if the `TopicPolicies` isn't initialized completely, the topic gets backlog quota will print the error log stack, this is not necessary, because after the TopicPolicies initialized, the topic level backlog quota will come into effect.
   
   ```
   15:24:01.962 [bookkeeper-ml-workers-OrderedExecutor-2-0] WARN  org.apache.pulsar.broker.service.BacklogQuotaManager - Failed to read topic policies data, will apply the namespace backlog quota: topicName=persistent://public/ns3/t1
   org.apache.pulsar.broker.service.BrokerServiceException$TopicPoliciesCacheNotInitException: Topic policies cache have not init.
   	at org.apache.pulsar.broker.service.SystemTopicBasedTopicPoliciesService.getTopicPolicies(SystemTopicBasedTopicPoliciesService.java:148) ~[org.apache.pulsar-pulsar-broker-2.7.3.jar:2.7.3]
   	at org.apache.pulsar.broker.service.BacklogQuotaManager.getBacklogQuota(BacklogQuotaManager.java:85) [org.apache.pulsar-pulsar-broker-2.7.3.jar:2.7.3]
   	at org.apache.pulsar.broker.service.persistent.PersistentTopic.getBacklogQuota(PersistentTopic.java:2172) [org.apache.pulsar-pulsar-broker-2.7.3.jar:2.7.3]
   	at org.apache.pulsar.broker.service.persistent.PersistentTopic.isBacklogQuotaExceeded(PersistentTopic.java:2181) [org.apache.pulsar-pulsar-broker-2.7.3.jar:2.7.3]
   	at org.apache.pulsar.broker.service.ServerCnx.lambda$handleProducer$20(ServerCnx.java:1100) [org.apache.pulsar-pulsar-broker-2.7.3.jar:2.7.3]
   	at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714) [?:?]
   	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) [?:?]
   	at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073) [?:?]
   	at org.apache.pulsar.broker.service.BrokerService$3.lambda$openLedgerComplete$2(BrokerService.java:1125) [org.apache.pulsar-pulsar-broker-2.7.3.jar:2.7.3]
   	at java.util.concurrent.CompletableFuture.uniRunNow(CompletableFuture.java:815) [?:?]
   	at java.util.concurrent.CompletableFuture.uniRunStage(CompletableFuture.java:799) [?:?]
   	at java.util.concurrent.CompletableFuture.thenRun(CompletableFuture.java:2121) [?:?]
   	at org.apache.pulsar.broker.service.BrokerService$3.openLedgerComplete(BrokerService.java:1111) [org.apache.pulsar-pulsar-broker-2.7.3.jar:2.7.3]
   	at org.apache.bookkeeper.mledger.impl.ManagedLedgerFactoryImpl.lambda$asyncOpen$8(ManagedLedgerFactoryImpl.java:425) [org.apache.pulsar-managed-ledger-2.7.3.jar:2.7.3]
   	at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714) [?:?]
   	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) [?:?]
   	at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073) [?:?]
   	at org.apache.bookkeeper.mledger.impl.ManagedLedgerFactoryImpl$2.initializeComplete(ManagedLedgerFactoryImpl.java:397) [org.apache.pulsar-managed-ledger-2.7.3.jar:2.7.3]
   	at org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl$3.operationComplete(ManagedLedgerImpl.java:476) [org.apache.pulsar-managed-ledger-2.7.3.jar:2.7.3]
   	at org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl$3.operationComplete(ManagedLedgerImpl.java:466) [org.apache.pulsar-managed-ledger-2.7.3.jar:2.7.3]
   	at org.apache.bookkeeper.mledger.impl.MetaStoreImpl.lambda$getCursors$8(MetaStoreImpl.java:122) [org.apache.pulsar-managed-ledger-2.7.3.jar:2.7.3]
   	at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714) [?:?]
   	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478) [?:?]
   	at org.apache.bookkeeper.common.util.OrderedExecutor$TimedRunnable.run(OrderedExecutor.java:203) [org.apache.bookkeeper-bookkeeper-common-4.12.0.jar:4.12.0]
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
   	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [io.netty-netty-common-4.1.60.Final.jar:4.1.60.Final]
   	at java.lang.Thread.run(Thread.java:834) [?:?]
   ```
   
   ### Modifications
   
   Remove the error log stack.
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API: (no)
     - The schema: (no)
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - The admin cli options: (no)
     - Anything that affects deployment: (no)
   
   ### Documentation
   
   Check the box below and label this PR (if you have committer privilege).
   
   Need to update docs? 
   
   - [ ] doc-required 
     
     (If you need help on updating docs, create a doc issue)
     
   - [x] no-need-doc 
     
     (Please explain why)
     
   - [ ] doc 
     
     (If this PR contains doc changes)
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] michaeljmarshall commented on a change in pull request #11863: [Broker] Refine topic level backlog quota policies warning log

Posted by GitBox <gi...@apache.org>.
michaeljmarshall commented on a change in pull request #11863:
URL: https://github.com/apache/pulsar/pull/11863#discussion_r699821334



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BacklogQuotaManager.java
##########
@@ -91,9 +91,12 @@ public BacklogQuotaImpl getBacklogQuota(TopicName topicName, BacklogQuotaType ba
                     .map(TopicPolicies::getBackLogQuotaMap)
                     .map(map -> map.get(backlogQuotaType.name()))
                     .orElseGet(() -> getBacklogQuota(topicName.getNamespace(), policyPath, backlogQuotaType));
+        } catch (BrokerServiceException.TopicPoliciesCacheNotInitException e) {
+            log.debug("Topic policies cache have not init, will apply the namespace backlog quota: topicName={}",
+                    topicName);
         } catch (Exception e) {
-            log.warn("Failed to read topic policies data, will apply the namespace backlog quota: topicName={}",
-                    topicName, e);
+            log.error("Failed to read topic policies data,"

Review comment:
       ```suggestion
               log.error("Failed to read topic policies data, "
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] sijie merged pull request #11863: [Broker] Refine topic level backlog quota policies warning log

Posted by GitBox <gi...@apache.org>.
sijie merged pull request #11863:
URL: https://github.com/apache/pulsar/pull/11863


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] michaeljmarshall commented on a change in pull request #11863: [Broker] Refine topic level backlog quota policies warning log

Posted by GitBox <gi...@apache.org>.
michaeljmarshall commented on a change in pull request #11863:
URL: https://github.com/apache/pulsar/pull/11863#discussion_r699821334



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BacklogQuotaManager.java
##########
@@ -91,9 +91,12 @@ public BacklogQuotaImpl getBacklogQuota(TopicName topicName, BacklogQuotaType ba
                     .map(TopicPolicies::getBackLogQuotaMap)
                     .map(map -> map.get(backlogQuotaType.name()))
                     .orElseGet(() -> getBacklogQuota(topicName.getNamespace(), policyPath, backlogQuotaType));
+        } catch (BrokerServiceException.TopicPoliciesCacheNotInitException e) {
+            log.debug("Topic policies cache have not init, will apply the namespace backlog quota: topicName={}",
+                    topicName);
         } catch (Exception e) {
-            log.warn("Failed to read topic policies data, will apply the namespace backlog quota: topicName={}",
-                    topicName, e);
+            log.error("Failed to read topic policies data,"

Review comment:
       ```suggestion
               log.error("Failed to read topic policies data, "
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org