lhotari commented on code in PR #25091:
URL: https://github.com/apache/pulsar/pull/25091#discussion_r2639043457
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java:
##########
@@ -693,6 +694,9 @@ public CompletableFuture<AnalyzeBacklogResult>
analyzeBacklog(Optional<Position>
}
long num = entries.incrementAndGet();
messages.addAndGet(numMessages);
+ if (messageMetadata.hasMarkerType()) {
+ markerMessages.addAndGet(numMessages);
+ }
Review Comment:
this condition should be moved before `int numMessages = 1` line. In the
case that the entry is a marker message, the filter shouldn't be evaluated and
the counters shouldn't be incremented.
This is to be consistent with the behavior of the dispatcher which also
skips further dispatching logic when the entry is a marker message.
https://github.com/apache/pulsar/blob/3fb52c5d7494d4020956b7a26db5e9e721c7d555/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractBaseDispatcher.java#L210-L229
I forgot to mention this detail in the original issue, #25082.
Besides being consistent with the dispatcher logic, it will make the usage
of analyzing the backlog easier since there wouldn't be a need to subtract the
number of marker messages from the total message count and "filter accepted
entries" count.
--
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]