[improve] [admin] Make the default value of param --get-subscription-backlog-size of admin API topics stats true - #19302
Conversation
gaoran10
left a comment
There was a problem hiding this comment.
LGTM, the calculation uses the data in memory, no IO operations, and maybe we can return -1 when the option param --get-subscription-backlog-size is false.
…backlog-size of admin API topics stats true
a11a246 to
7f572b3
Compare
Good idea. Already make the attribute 'backlogSize' in the response to be -1 when if |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19302 +/- ##
============================================
+ Coverage 63.54% 64.94% +1.40%
- Complexity 3615 26379 +22764
============================================
Files 1895 1818 -77
Lines 137475 133776 -3699
Branches 15091 14692 -399
============================================
- Hits 87355 86885 -470
+ Misses 42240 39107 -3133
+ Partials 7880 7784 -96
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
@poorbarcode this is a breaking change. |
|
I agree, this is a change in a default, we should not cherry pick it. |
|
Thanks for checking my mistakes |
Motivation
In the PR #9302, the property backlog size of each subscription returned in the response of the API topics stats, by default this property is always equal to 0 in response, and this will confuse users. Since the calculation of backlog size is done in broker memory, there is no significant overhead(the process is described in the following section), so I think the correct values should be displayed by default.
Discuss in mail list
The following two APIs should be affected:
In Pulsar admin API
the default value of parameter
--get-subscription-backlog-sizewill betrueIn Pulsar Rest API
the default value of the parameter
subscriptionBacklogSizewill betrueThe following is the process of calculating backlog size:
PersistentTopc.ledgersinto two parts according to the ledgerId of the mark delete position of the cursor. The second part is ledgers indicating the messages still need to be consumed, aka backlogSizeInLedgers.backlogSizeInLedgers+backlogSizeInEntriesModifications
true-sbsis false, for distinguish whether--get-subscription-backlog-sizeis set to trueDocumentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: