You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/11/29 06:04:50 UTC

[GitHub] massakam opened a new pull request #3092: Fix process of calculating msgBacklog included in stats

massakam opened a new pull request #3092: Fix process of calculating msgBacklog included in stats
URL: https://github.com/apache/pulsar/pull/3092
 
 
   `msgBacklog` included in the stats of the topic sometimes remains 1 even though all messages have been consumed.
   
   Normally, the number of messages in the backlog is calculated by the expression `entriesAddedCounter - messagesConsumedCounter`. However, if this result is less than 0, the number of entries is calculated from `markDeletePosition` and `lastConfirmedEntry`. At this time, the value passed to `getNumberOfEntries()` is a closed interval, so the return value of `getNumberOfEntries()` is 1 larger than the actual number of entries.
   https://github.com/apache/pulsar/blob/5fde6f32b038327163ebf7babc556b72f337a1a1/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java#L694-L700

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services