-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[fix][managed-ledger] fix calculation in getNumberOfEntriesInStorage #15627
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
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
/pulsarbot rerun-failure-checks |
1 similar comment
/pulsarbot rerun-failure-checks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
(cherry picked from commit a439811)
(cherry picked from commit a439811)
The new test is failing in the release branches because, in order to pass, it needs also #14672
I believe that we should NOT port #14672 to release branches since it's a behaviour change (even if internal). We can just modify the failing test @HQebupt could you do it? |
Fixes: #16000 After cherry-picked #15627, the test `org.apache.bookkeeper.mledger.impl.ManagedLedgerTest` will fail for branch-2.10. Details to see #15627 (comment) Not 100% sure what's going on for now, but looks like It's related to the concurrency issue in the class initialization. Just found some related information. https://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html#parallel-test-execution testcontainers/testcontainers-java#2939 (comment)
(cherry picked from commit a439811)
Fixes: apache#16000 After cherry-picked apache#15627, the test `org.apache.bookkeeper.mledger.impl.ManagedLedgerTest` will fail for branch-2.10. Details to see apache#15627 (comment) Not 100% sure what's going on for now, but looks like It's related to the concurrency issue in the class initialization. Just found some related information. https://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html#parallel-test-execution testcontainers/testcontainers-java#2939 (comment) (cherry picked from commit 0b7bacc)
Motivation
The number of entries in storage is between
markDeletePosition
andlastConfirmedEntry
, which the markDeletePosition is excluded, and thelastConfirmedEntry
in included.The current algorithm yields 1 more because
ledger.getLastPosition().getNext()
is included.Modifications
The right way is to make the algorithm not include
ledger.getLastPosition().getNext()
.Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation
Check the box below and label this PR (if you have committer privilege).
Need to update docs?
no-need-doc