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 2022/09/20 02:27:32 UTC
[GitHub] [pulsar] lordcheng10 opened a new pull request, #17725: Fix metric messagesConsumedCounter calculation error
lordcheng10 opened a new pull request, #17725:
URL: https://github.com/apache/pulsar/pull/17725
### Motivation
Fix metric messagesConsumedCounter calculation error.
In the ManagedCursorImpl#setAcknowledgedPosition method, we will calculate skippedEntries based on newMarkDeletePosition and oldMarkDeletePosition, and then accumulate skippedEntries into MSG_CONSUMED_COUNTER_UPDATER: MSG_CONSUMED_COUNTER_UPDATER.addAndGet(this, skippedEntries);
But the newMarkDeletePosition here is not the final value, newMarkDeletePosition may change between calculating skippedEntries and accumulating to MSG_CONSUMED_COUNTER_UPDATER:
https://github.com/apache/pulsar/blob/bf6e815767c89512e0689562fbba0c2c453ff081/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java#L1769~L1802
### Modifications
Therefore, skippedEntries should only be calculated after newMarkDeletePosition has changed;
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc-required`
(Your PR needs to update docs and you will update later)
- [x] `doc-not-needed`
(Please explain why)
- [ ] `doc`
(Your PR contains doc changes)
- [ ] `doc-complete`
(Docs have been already added)
### Matching PR in forked repository
PR in forked repository: <!-- ENTER URL HERE
After opening this PR, the build in apache/pulsar will fail and instructions will
be provided for opening a PR in the PR author's forked repository.
apache/pulsar pull requests should be first tested in your own fork since the
apache/pulsar CI based on GitHub Actions has constrained resources and quota.
GitHub Actions provides separate quota for pull requests that are executed in
a forked repository.
The tests will be run in the forked repository until all PR review comments have
been handled, the tests pass and the PR is approved by a reviewer.
-->
--
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
[GitHub] [pulsar] lordcheng10 closed pull request #17725: [fix][broker]Fix metric messagesConsumedCounter calculation error
Posted by GitBox <gi...@apache.org>.
lordcheng10 closed pull request #17725: [fix][broker]Fix metric messagesConsumedCounter calculation error
URL: https://github.com/apache/pulsar/pull/17725
--
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