You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2018/03/13 01:42:03 UTC

[incubator-pulsar] branch master updated: Allow to set BacklogQuota when RetentionSizeInMB is set to -1 (#1368)

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 b5068bb  Allow to set BacklogQuota when RetentionSizeInMB is set to -1 (#1368)
b5068bb is described below

commit b5068bb9bdf20177905ec007e6ca8913f7b652e5
Author: Daniel Jorge <da...@sticorp.com.br>
AuthorDate: Mon Mar 12 22:42:00 2018 -0300

    Allow to set BacklogQuota when RetentionSizeInMB is set to -1 (#1368)
    
    I think 1.22 introduced a small bug that prevent setting BacklogQuota at all when RetentionSizeInMB is set to -1, always throwing "Backlog Quota exceeds configured retention quota for namespace"
---
 .../main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
index 5ecca24..5f5b758 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
@@ -1074,7 +1074,7 @@ public abstract class NamespacesBase extends AdminResource {
 
     private boolean checkQuotas(Policies policies, RetentionPolicies retention) {
         Map<BacklogQuota.BacklogQuotaType, BacklogQuota> backlog_quota_map = policies.backlog_quota_map;
-        if (backlog_quota_map.isEmpty() || retention.getRetentionSizeInMB() == 0) {
+        if (backlog_quota_map.isEmpty() || retention.getRetentionSizeInMB() == 0 || retention.getRetentionSizeInMB() == -1) {
             return true;
         }
         BacklogQuota quota = backlog_quota_map.get(BacklogQuotaType.destination_storage);

-- 
To stop receiving notification emails like this one, please contact
mmerli@apache.org.