-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[fix][broker] Fix duplicate increment of ADD_OP_COUNT_UPDATER in OpAddEntry #24506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
since I got some problems when rebase to master in #24502, so I close that PR and open a new one, please take a look again. thank you |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #24506 +/- ##
============================================
+ Coverage 73.57% 74.33% +0.76%
- Complexity 32624 32936 +312
============================================
Files 1877 1874 -3
Lines 139502 146230 +6728
Branches 15299 16772 +1473
============================================
+ Hits 102638 108703 +6065
+ Misses 28908 28875 -33
- Partials 7956 8652 +696
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…dEntry (#24506) Co-authored-by: crossoverJie <[email protected]> (cherry picked from commit 39ac65a)
…dEntry (#24506) Co-authored-by: crossoverJie <[email protected]> (cherry picked from commit 39ac65a)
…dEntry (#24506) Co-authored-by: crossoverJie <[email protected]> (cherry picked from commit 39ac65a)
…dEntry (apache#24506) Co-authored-by: crossoverJie <[email protected]> (cherry picked from commit 39ac65a) (cherry picked from commit ffc2495)
…dEntry (apache#24506) Co-authored-by: crossoverJie <[email protected]> (cherry picked from commit 39ac65a) (cherry picked from commit ffc2495)
…dEntry (apache#24506) Co-authored-by: crossoverJie <[email protected]> (cherry picked from commit 39ac65a) (cherry picked from commit c1c1b21)
…dEntry (apache#24506) Co-authored-by: crossoverJie <[email protected]> (cherry picked from commit 39ac65a) (cherry picked from commit ffc2495)
…dEntry (apache#24506) Co-authored-by: crossoverJie <[email protected]> (cherry picked from commit 39ac65a) (cherry picked from commit c1c1b21)
…dEntry (apache#24506) Co-authored-by: crossoverJie <[email protected]> (cherry picked from commit 39ac65a)
…dEntry (apache#24506) Co-authored-by: crossoverJie <[email protected]> (cherry picked from commit 39ac65a)
Motivation
Currently, when adding a message to a ledger,
ManagedLedgerImpl.ADD_OP_COUNT_UPDATER
is incremented twice:createOpAddEntryNoRetainBuffer()
when creating theOpAddEntry
OpAddEntry.initiate()
This double increment leads to incorrect operation counting and potential metric inaccuracies.

here's the example I've tested on my local.
Modifications
OpAddEntry.initiate()
fromincrementAndGet()
toget()
to prevent duplicate countingtestAddOpCountWithMessageAdd()
to verify the correct increment behaviorVerifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: 3pacccccc#11