You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by pe...@apache.org on 2020/10/09 15:34:53 UTC

[pulsar] branch master updated: Change getBacklogQuota exception log level from error to warn (#8199)

This is an automated email from the ASF dual-hosted git repository.

penghui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 41fb70f  Change getBacklogQuota exception log level from error to warn (#8199)
41fb70f is described below

commit 41fb70fd509de707a3d346ff950c18de1919fe03
Author: hangc0276 <ha...@163.com>
AuthorDate: Fri Oct 9 23:34:32 2020 +0800

    Change getBacklogQuota exception log level from error to warn (#8199)
    
    ### Motivation
    In production env, we will monitor Pulsar broker log level and alert when encountered error log. However, when getBacklogQuota failed from topic policy or namespace policy, it will report error level logs and get default backlog quota. We should change the exception log level from error to warn to avoid unnecessary alert.
    
    ### Changes
    1. change getBacklogQuota exception log level from error to warn.
---
 .../java/org/apache/pulsar/broker/service/BacklogQuotaManager.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BacklogQuotaManager.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BacklogQuotaManager.java
index 8eafa5d..4b965fd 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BacklogQuotaManager.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BacklogQuotaManager.java
@@ -70,7 +70,7 @@ public class BacklogQuotaManager {
                     .map(p -> p.backlog_quota_map.getOrDefault(BacklogQuotaType.destination_storage, defaultQuota))
                     .orElse(defaultQuota);
         } catch (Exception e) {
-            log.error("Failed to read policies data, will apply the default backlog quota: namespace={}", namespace, e);
+            log.warn("Failed to read policies data, will apply the default backlog quota: namespace={}", namespace, e);
             return this.defaultQuota;
         }
     }
@@ -87,7 +87,7 @@ public class BacklogQuotaManager {
                     .map(map -> map.get(BacklogQuotaType.destination_storage.name()))
                     .orElseGet(() -> getBacklogQuota(topicName.getNamespace(),policyPath));
         } catch (Exception e) {
-            log.error("Failed to read policies data, will apply the default backlog quota: topicName={}", topicName, e);
+            log.warn("Failed to read topic policies data, will apply the namespace backlog quota: topicName={}", topicName, e);
         }
         return getBacklogQuota(topicName.getNamespace(),policyPath);
     }