You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "poorbarcode (via GitHub)" <gi...@apache.org> on 2025/12/04 10:48:18 UTC
[PR] [fix][broker]Incorrect backlog that is larger than expected [pulsar]
poorbarcode opened a new pull request, #25037:
URL: https://github.com/apache/pulsar/pull/25037
### Motivation
By default, the backlog of a subscription is got by `{num of entries published} - {num of entries acknowleged}`
- `num of entries published`: `ManagedLedger.entriesAddedCounter`
- `num of entries acknowleged`: `ManagedLedger.messagesConsumedCounter`
There is bug that calculates the entries count between two positons in the method `ManagedLedger.getNumberOfEntries`, which causes `ManagedLedger.messagesConsumedCounter` going to a incorrect value. BTW, this bug was introduced by https://github.com/apache/pulsar/pull/24938
It happens when the `{from position} < {currentLedger}:0` and `{to position} > {currentLedger}:0 and {top position} < {LAC}`
### Modifications
Fix the bug.
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository: x
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][broker]Incorrect backlog that is larger than expected [pulsar]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #25037:
URL: https://github.com/apache/pulsar/pull/25037#issuecomment-3611791978
## [Codecov](https://app.codecov.io/gh/apache/pulsar/pull/25037?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 74.36%. Comparing base ([`b71bea4`](https://app.codecov.io/gh/apache/pulsar/commit/b71bea4c42353f9d14f817aa9a0877d495336f34?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`a0e6d9e`](https://app.codecov.io/gh/apache/pulsar/commit/a0e6d9ed3231a4e87b80d2b2768de9f21241e148?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 1 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/pulsar/pull/25037?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #25037 +/- ##
=============================================
+ Coverage 38.52% 74.36% +35.84%
- Complexity 13254 34105 +20851
=============================================
Files 1864 1921 +57
Lines 146187 150351 +4164
Branches 16977 17464 +487
=============================================
+ Hits 56318 111808 +55490
+ Misses 82183 29619 -52564
- Partials 7686 8924 +1238
```
| [Flag](https://app.codecov.io/gh/apache/pulsar/pull/25037/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [inttests](https://app.codecov.io/gh/apache/pulsar/pull/25037/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `26.37% <0.00%> (+0.09%)` | :arrow_up: |
| [systests](https://app.codecov.io/gh/apache/pulsar/pull/25037/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `22.87% <0.00%> (+0.05%)` | :arrow_up: |
| [unittests](https://app.codecov.io/gh/apache/pulsar/pull/25037/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.90% <100.00%> (+39.19%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Files with missing lines](https://app.codecov.io/gh/apache/pulsar/pull/25037?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [...che/bookkeeper/mledger/impl/ManagedLedgerImpl.java](https://app.codecov.io/gh/apache/pulsar/pull/25037?src=pr&el=tree&filepath=managed-ledger%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fbookkeeper%2Fmledger%2Fimpl%2FManagedLedgerImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bWFuYWdlZC1sZWRnZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2Jvb2trZWVwZXIvbWxlZGdlci9pbXBsL01hbmFnZWRMZWRnZXJJbXBsLmphdmE=) | `81.18% <100.00%> (+30.17%)` | :arrow_up: |
... and [1422 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/25037/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][broker]Incorrect backlog that is larger than expected [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari merged PR #25037:
URL: https://github.com/apache/pulsar/pull/25037
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][broker]Incorrect backlog that is larger than expected [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #25037:
URL: https://github.com/apache/pulsar/pull/25037#discussion_r2589919664
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:
##########
Review Comment:
Could you also fix the typo here? `formLedger` should most likely be `fromLedger`.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org