[fix][managed-ledger] fix calculation in getNumberOfEntriesInStorage - #15627
Merged
Conversation
Contributor
Author
|
/pulsarbot run-failure-checks |
gaozhangmin
requested review from
eolivelli,
mattisonchao and
nicoloboschi
and removed request for
eolivelli,
mattisonchao and
nicoloboschi
May 17, 2022 06:35
Contributor
Author
|
/pulsarbot run-failure-checks |
AnonHxy
approved these changes
May 17, 2022
gaozhangmin
approved these changes
May 20, 2022
Contributor
|
/pulsarbot run-failure-checks |
Contributor
|
/pulsarbot rerun-failure-checks |
1 similar comment
Contributor
Author
|
/pulsarbot rerun-failure-checks |
hangc0276
pushed a commit
that referenced
this pull request
Jun 7, 2022
(cherry picked from commit a439811)
codelipenghui
pushed a commit
to codelipenghui/incubator-pulsar
that referenced
this pull request
Jun 7, 2022
(cherry picked from commit a439811)
Contributor
|
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? |
codelipenghui
added a commit
that referenced
this pull request
Jun 10, 2022
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)
codelipenghui
pushed a commit
that referenced
this pull request
Jun 10, 2022
(cherry picked from commit a439811)
nicoloboschi
pushed a commit
to datastax/pulsar
that referenced
this pull request
Jun 13, 2022
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)
This was referenced Jul 27, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The number of entries in storage is between
markDeletePositionandlastConfirmedEntry, which the markDeletePosition is excluded, and thelastConfirmedEntryin 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
yeswas 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