yuikns opened a new issue #13925:
URL: https://github.com/apache/pulsar/issues/13925


   We use <https://pulsar.apache.org/admin/v2/broker-stats/topics> to monitor 
the unfinished messages in the system.
   
   We read each topic stats as following:
   
   ```
   "persistent://public/default/my-topic-name": {
             "publishers": [],
             "replication": {},
             "subscriptions": {
               "my-consumer-name": {
                 "consumers": [
                   {  // consumer info here
                   }
                 ],
                 "msgBacklog": 252, <<-- key field
                 "msgRateExpired": 0,
                 "msgRateOut": 0,
                 "msgThroughputOut": 0,
                 "msgRateRedeliver": 0,
                 "numberOfEntriesSinceFirstNotAckedMessage": 1,
                 "totalNonContiguousDeletedMessagesRange": 0,
                 "type": "Shared",
                 "blockedSubscriptionOnUnackedMsgs": false,
                 "unackedMessages": 0
               }
             },
             "producerCount": 0,
             "averageMsgSize": 0,
             "msgRateIn": 0,
             "msgRateOut": 0,
             "msgInCount": 0,   <<-- another key field
             "bytesInCount": 0,
             "msgOutCount": 0,
             "bytesOutCount": 0,
             "msgThroughputIn": 0,
             "msgThroughputOut": 0,
             "storageSize": 215024,
             "backlogSize": 215024,
             "pendingAddEntriesCount": 0
           }
   ```
   
   We may use `my-topic-name->subscriptions->my-consumer-name` to get the lag 
of this consumer, and use `my-topic-name->msgInCount` to get the total message 
count.
   
   It worked like a charm at first.
   
   However, after a few days later, some of the message may expired since we 
configured a time based retention policies. The statistics became strange:
   
   1. msgInCount became to be 0;
   2. storageSize and backlogSize are pretty large;
   3. subscriptions->msgBacklog is a positive value 
   4. and it can not be consumed what ever using sdk or admin cli tool
   
   all the above topics mentioned are  non-partitioned.
   
   May I know is there any way I did incorrect? Any help are appreciated.
   
   ## Additionally information 
   
   I am using 2.8.2 and 2.9.1. The above issue may occasionally happened on 
both of the these releases.
   
   Besides, the API response is `msgInCount` and [the 
doc](https://pulsar.apache.org/docs/en/standalone-docker/#get-the-topic-statistics)
 shows `msgInCounter`.  Maybe one of them is incorrect
   
   
   
   
   


-- 
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]


Reply via email to