-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Change rollCurrentLedgerIfFull logic to follow lazy creation of ledger
#14672
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
Merged
Conversation
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
rollCurrentLedgerIfFull to follow lazy creation of ledgerrollCurrentLedgerIfFull logic to follow lazy creation of ledger
BewareMyPower
approved these changes
Mar 14, 2022
Member
Author
|
@eolivelli |
codelipenghui
approved these changes
Mar 14, 2022
Member
Author
|
@codelipenghui @BewareMyPower @eolivelli @lhotari @michaeljmarshall @Technoboy- This change affects some tests, PTAL :) |
managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerTest.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerTest.java
Outdated
Show resolved
Hide resolved
...r-broker/src/test/java/org/apache/pulsar/broker/service/CurrentLedgerRolloverIfFullTest.java
Outdated
Show resolved
Hide resolved
…l/ManagedLedgerTest.java Co-authored-by: Yunze Xu <xyzinfernity@163.com>
codelipenghui
approved these changes
Mar 16, 2022
BewareMyPower
approved these changes
Mar 16, 2022
aparajita89
pushed a commit
to aparajita89/pulsar
that referenced
this pull request
Mar 21, 2022
…edger (apache#14672) ### Motivation The original ledger creation design was lazy, meaning that the ledger was created when a new write operation was requested. https://github.com/apache/pulsar/blob/ad2cc2d38280b7dd0f056ee981ec8d3b157e3526/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java#L778-L786 However, the current ``rollCurrentLedgerIfFull`` logic is to create a ledger regardless of the condition (even if ``ManagedLedgerImpl#pendingAddEntries`` is empty) https://github.com/apache/pulsar/blob/ad2cc2d38280b7dd0f056ee981ec8d3b157e3526/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java#L1669-L1692 Therefore, we need to change to lazy creation according to the original design. ### Modifications - Remove ``createLedgerAfterClosed`` invoke in the ``rollCurrentLedgerIfFull`` method.
Nicklee007
pushed a commit
to Nicklee007/pulsar
that referenced
this pull request
Apr 20, 2022
…edger (apache#14672) ### Motivation The original ledger creation design was lazy, meaning that the ledger was created when a new write operation was requested. https://github.com/apache/pulsar/blob/ad2cc2d38280b7dd0f056ee981ec8d3b157e3526/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java#L778-L786 However, the current ``rollCurrentLedgerIfFull`` logic is to create a ledger regardless of the condition (even if ``ManagedLedgerImpl#pendingAddEntries`` is empty) https://github.com/apache/pulsar/blob/ad2cc2d38280b7dd0f056ee981ec8d3b157e3526/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java#L1669-L1692 Therefore, we need to change to lazy creation according to the original design. ### Modifications - Remove ``createLedgerAfterClosed`` invoke in the ``rollCurrentLedgerIfFull`` method.
This was referenced May 6, 2022
Nicklee007
pushed a commit
to Nicklee007/pulsar
that referenced
this pull request
May 17, 2022
…ion of ledger (apache#14672)" This reverts commit 30f7f00
2 tasks
nicoloboschi
pushed a commit
that referenced
this pull request
Jun 8, 2022
…edger (#14672) ### Motivation The original ledger creation design was lazy, meaning that the ledger was created when a new write operation was requested. https://github.com/apache/pulsar/blob/ad2cc2d38280b7dd0f056ee981ec8d3b157e3526/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java#L778-L786 However, the current ``rollCurrentLedgerIfFull`` logic is to create a ledger regardless of the condition (even if ``ManagedLedgerImpl#pendingAddEntries`` is empty) https://github.com/apache/pulsar/blob/ad2cc2d38280b7dd0f056ee981ec8d3b157e3526/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java#L1669-L1692 Therefore, we need to change to lazy creation according to the original design. ### Modifications - Remove ``createLedgerAfterClosed`` invoke in the ``rollCurrentLedgerIfFull`` method. (cherry picked from commit 30f7f00)
Merged
2 tasks
Technoboy-
pushed a commit
to merlimat/pulsar
that referenced
this pull request
Aug 16, 2022
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 original ledger creation design was lazy, meaning that the ledger was created when a new write operation was requested.
pulsar/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Lines 778 to 786 in ad2cc2d
However, the current
rollCurrentLedgerIfFulllogic is to create a ledger regardless of the condition (even ifManagedLedgerImpl#pendingAddEntriesis empty)pulsar/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Lines 1669 to 1692 in ad2cc2d
Therefore, we need to change to lazy creation according to the original design.
Modifications
createLedgerAfterClosedinvoke in therollCurrentLedgerIfFullmethod.Verifying this change
Documentation
no-need-doc