sindhushree
06/05/2025, 8:38 AMRunLLM
06/05/2025, 8:38 AMpulsar-admin topics partitioned-stats command can show backlogSize as 0 even when msgBacklog is greater than 0. This is a known issue and can occur because the backlog size is an estimate based on ledger data, while msgBacklog counts the number of unacknowledged messages. If the backlog is small or the cursor is at the end of the ledger, the size calculation may return 0 even though there are still unacknowledged messages, especially for partitioned topics or after certain operations like resets or skips. This behavior is documented and has been discussed in detail in the Pulsar community (see here).
For more accurate results, you can use the --get-precise-backlog flag with the stats or partitioned-stats command, but note that this may have a performance impact (see docs). Would you like more detail on how backlog size is calculated or how to get precise values?
Sources:
- Incorrect msgBacklog value
- see docs 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.sindhushree
06/06/2025, 2:28 AMRunLLM
06/06/2025, 2:28 AMmsgBacklog (number of unacknowledged messages) for a subscription is:
pulsar-admin topics stats <topic-name>
This command displays detailed stats, including msgBacklog for each subscription on the topic (see docs). For partitioned topics, use:
pulsar-admin topics partitioned-stats <topic-name>
Would you like more detail on filtering or scripting this output?
Sources:
- Pulsar Admin API: partitioned-stats 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.sindhushree
06/06/2025, 2:40 AMRunLLM
06/06/2025, 2:40 AM--get-precise-backlog flag (or -gpb) with partitioned-stats or stats forces Pulsar to calculate the exact number of unacknowledged messages by scanning the ledger, while the default partitioned-stats command returns an estimated backlog using counters, which is faster but may be inaccurate in some edge cases (see docs, see also).
Using --get-precise-backlog is more accurate but can impact performance, especially on large topics, because it requires locking and scanning the ledger. The default is more efficient but may show incorrect values after certain operations like cursor resets. Would you like more detail on when to use each option?
Sources:
- Pulsar Admin CLI reference
- Incorrect msgBacklog value 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.sindhushree
06/06/2025, 3:41 AMRunLLM
06/06/2025, 3:41 AMsindhushree
06/06/2025, 3:44 AMRunLLM
06/06/2025, 3:44 AMsindhushree
06/06/2025, 3:47 AMRunLLM
06/06/2025, 3:47 AMsindhushree
06/06/2025, 5:58 AMRunLLM
06/06/2025, 5:58 AMsindhushree
06/06/2025, 7:03 AMRunLLM
06/06/2025, 7:03 AMsindhushree
06/06/2025, 7:08 AM