poorbarcode commented on code in PR #21423:
URL: https://github.com/apache/pulsar/pull/21423#discussion_r1432423593
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:
##########
@@ -995,6 +1023,13 @@ public void addUnAckedMessages(int numberOfMessages) {
topic.getBrokerService().addUnAckedMessages(this, numberOfMessages);
}
+ @Override
+ public void afterAckMessages(Object position, Throwable error, Object ctx)
{
+ if (!cursor.isMetadataTooLargeToPersist()) {
Review Comment:
@coderzc
> Use shouldPauseOnAckStatePersist directly?
If we call `shouldPauseOnAckStatePersist(ReadType.Normal)` here, the param
`ReadType.Normal` is confuse.
@codelipenghui
> Will it waste too many CPU circles if cursor.isMetadataTooLargeToPersist()
is always false? This method readMoreEntriesAsync will be executed by another
thread and it will do lot of checks for each call.
> I think what we want to do is if the dispatcher is paused by the ack state
persistence before, but now the ack state persistence is good. We should resume
the message dispatching.
Good suggestion. I added a counter indicates how many times the dispatching
has been paused, and call `readMoreEntries` only the counter is larger than `0`
--
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]