From f2ed73a901e27b34021792e98b3ee99e78a99a9a Mon Sep 17 00:00:00 2001 From: Baodi Shi Date: Tue, 19 Jul 2022 11:57:09 +0800 Subject: [PATCH] [fix][flaky-test] Set the receiverQueueSize is 1 to precisely control the maxUnackedMessages. --- .../apache/pulsar/broker/admin/MaxUnackedMessagesTest.java | 2 +- site2/docs/reference-configuration.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/MaxUnackedMessagesTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/MaxUnackedMessagesTest.java index f864204f224ee..f9df1a5512d10 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/MaxUnackedMessagesTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/MaxUnackedMessagesTest.java @@ -258,7 +258,7 @@ public void testMaxUnackedMessagesOnConsumer() throws Exception { final String topicName = testTopic + System.currentTimeMillis(); final String subscriberName = "test-sub" + System.currentTimeMillis(); final int unackMsgAllowed = 100; - final int receiverQueueSize = 10; + final int receiverQueueSize = 1; final int totalProducedMsgs = 300; ConsumerBuilder consumerBuilder = pulsarClient.newConsumer(Schema.STRING).topic(topicName) diff --git a/site2/docs/reference-configuration.md b/site2/docs/reference-configuration.md index f7a7fd5bda8d4..60342aaea795e 100644 --- a/site2/docs/reference-configuration.md +++ b/site2/docs/reference-configuration.md @@ -241,8 +241,8 @@ brokerServiceCompactionThresholdInBytes|If the estimated backlog size is greater |tokenAuthClaim| Specify which of the token's claims will be used as the authentication "principal" or "role". The default "sub" claim will be used if this is left blank || |tokenAudienceClaim| The token audience "claim" name, e.g. "aud", that will be used to get the audience from token. If not set, audience will not be verified. || |tokenAudience| The token audience stands for this broker. The field `tokenAudienceClaim` of a valid token, need contains this. || -|maxUnackedMessagesPerConsumer| Max number of unacknowledged messages allowed to receive messages by a consumer on a shared subscription. Broker will stop sending messages to consumer once, this limit reaches until consumer starts acknowledging messages back. Using a value of 0, is disabling unackeMessage limit check and consumer can receive messages without any restriction |50000| -|maxUnackedMessagesPerSubscription| Max number of unacknowledged messages allowed per shared subscription. Broker will stop dispatching messages to all consumers of the subscription once this limit reaches until consumer starts acknowledging messages back and unack count reaches to limit/2. Using a value of 0, is disabling unackedMessage-limit check and dispatcher can dispatch messages without any restriction |200000| +|maxUnackedMessagesPerConsumer| Max number of unacknowledged messages allowed to receive messages by a consumer on a shared subscription(For non-precise control, the actual value may be larger than this value than to trigger). Broker will stop sending messages to consumer once, this limit reaches until consumer starts acknowledging messages back. Using a value of 0, is disabling unackeMessage limit check and consumer can receive messages without any restriction |50000| +|maxUnackedMessagesPerSubscription| Max number of unacknowledged messages allowed per shared subscription(For non-precise control, the actual value may be larger than this value than to trigger). Broker will stop dispatching messages to all consumers of the subscription once this limit reaches until consumer starts acknowledging messages back and unack count reaches to limit/2. Using a value of 0, is disabling unackedMessage-limit check and dispatcher can dispatch messages without any restriction |200000| |subscriptionRedeliveryTrackerEnabled| Enable subscription message redelivery tracker |true| |subscriptionExpirationTimeMinutes | How long to delete inactive subscriptions from last consuming.

Setting this configuration to a value **greater than 0** deletes inactive subscriptions automatically.
Setting this configuration to **0** does not delete inactive subscriptions automatically.

Since this configuration takes effect on all topics, if there is even one topic whose subscriptions should not be deleted automatically, you need to set it to 0.
Instead, you can set a subscription expiration time for each **namespace** using the [`pulsar-admin namespaces set-subscription-expiration-time options` command](/tools/pulsar-admin/2.6.0-SNAPSHOT/#-em-set-subscription-expiration-time-em-). | 0 | |maxConcurrentLookupRequest| Max number of concurrent lookup request broker allows to throttle heavy incoming lookup traffic |50000|