lhotari commented on code in PR #23231:
URL: https://github.com/apache/pulsar/pull/23231#discussion_r1746810620
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -949,6 +949,48 @@ The max allowed delay for delayed delivery (in
milliseconds). If the broker rece
+ " back and unack count reaches to `limit/2`. Using a value of 0,
is disabling unackedMessage-limit"
+ " check and broker doesn't block dispatchers")
private int maxUnackedMessagesPerBroker = 0;
+
+ @FieldContext(
+ category = CATEGORY_POLICIES,
+ doc = "For Key_Shared subscriptions, if messages cannot be
dispatched to consumers due to a slow consumer"
+ + " or a blocked key hash (because of ordering
constraints), the broker will continue reading more"
+ + " messages from the backlog and attempt to dispatch them
to consumers until the number of replay"
+ + " messages reaches the calculated threshold.\n"
+ + "Formula: threshold =
max(keySharedLookAheadMsgInReplayThresholdPerConsumer *"
+ + " connected consumer count,
keySharedLookAheadMsgInReplayThresholdPerSubscription)"
+ + ".\n"
+ + "Setting this value to 0 will disable the limit
calculated per consumer.",
+ dynamic = true
+ )
+ private int keySharedLookAheadMsgInReplayThresholdPerConsumer = 1000;
+
+ @FieldContext(
+ category = CATEGORY_POLICIES,
+ doc = "For Key_Shared subscriptions, if messages cannot be
dispatched to consumers due to a slow consumer"
+ + " or a blocked key hash (because of ordering
constraints), the broker will continue reading more"
+ + " messages from the backlog and attempt to dispatch them
to consumers until the number of replay"
+ + " messages reaches the calculated threshold.\n"
+ + "Formula: threshold =
max(keySharedLookAheadMsgInReplayThresholdPerConsumer *"
+ + " connected consumer count,
keySharedLookAheadMsgInReplayThresholdPerSubscription)"
+ + ".\n"
+ + "This value should be set to a value less than 2 *
managedLedgerMaxUnackedRangesToPersist.\n"
+ + "Setting this value to 0 will disable the limit
calculated per subscription.\n",
+ dynamic = true
+ )
+ private int keySharedLookAheadMsgInReplayThresholdPerSubscription = 10000;
+
+
+ @FieldContext(
+ category = CATEGORY_POLICIES,
+ doc = "For Key_Shared subscriptions, if messages cannot be
dispatched to consumers due to a slow consumer"
+ + " or a blocked key hash (because of ordering
constraints), the broker will continue reading more"
+ + " messages from the backlog and attempt to dispatch them
to consumers until the number of replay"
+ + " messages reaches the calculated threshold.\n"
+ + "This setting controls whether look ahead is enabled
when recently joined consumers are present.",
+ dynamic = true
+ )
+ private boolean keySharedLookAheadEnabledWhenRecentlyJoinedConsumersExist
= false;
Review Comment:
> Even if keySharedLookAheadEnabledWhenRecentlyJoinedConsumersExist is
false, the broker will still look ahead and read entries, because it only
affects when messagesSent == 0
Thanks for pinpointing this. I'm making a refactoring where the "look ahead"
limit applies to all code paths.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]