[Ledger] Fix ledger rollover scheduled task#11116
Merged
Merged
Conversation
gaoran10
requested review from
315157973,
codelipenghui,
congbobo184,
eolivelli,
jiazhai,
merlimat,
sijie and
zymap
June 26, 2021 17:24
315157973
reviewed
Jun 27, 2021
315157973
reviewed
Jun 27, 2021
Member
|
@gaoran10 does this affect docs? |
Member
|
Hi @gaoran10 any feedback? |
Contributor
Author
Sorry late response, this is not affect doc. |
…a new ledger has been created successfully.
gaoran10
force-pushed
the
fix-ledger-rollover-scheduler-task
branch
from
June 29, 2021 11:04
8d42418 to
eadebdc
Compare
315157973
approved these changes
Jun 30, 2021
sijie
approved these changes
Jun 30, 2021
codelipenghui
pushed a commit
that referenced
this pull request
Jul 7, 2021
### Motivation Currently, the ledger rollover scheduled task will execute before reach the ledger maximum rollover time, this will cause the ledger doesn't roll over in time. ### Modifications Only make the ledger rollover scheduled task after the ledger created successfully. If the scheduled task was executed when there is no entry in the current ledger, the scheduled task will not be re-executed, and if there is new entry is added the ledger will rollover. ### Verifying this change Add a unit test to verify the ledger could be rolled over in time. (cherry picked from commit a092ceb)
codelipenghui
pushed a commit
that referenced
this pull request
Jul 9, 2021
The PR #11116 couldn't be cherry-picked to `branch-2.7`, because there are too many conflicts. In PR #8946 the ledger rollover task had been moved from `BrokerService` to `ManagedLedgerImpl`, and this PR is based on it. ### Motivation Currently, the ledger rollover scheduled task will execute before reach the ledger maximum rollover time, this will cause the ledger doesn't roll over in time. ### Modifications Only make the ledger rollover scheduled task after the ledger created successfully. If the scheduled task was executed when there is no entry in the current ledger, the scheduled task will not be re-executed, and if there is new entry is added the ledger will rollover.
bharanic-dev
pushed a commit
to bharanic-dev/pulsar
that referenced
this pull request
Mar 18, 2022
### Motivation Currently, the ledger rollover scheduled task will execute before reach the ledger maximum rollover time, this will cause the ledger doesn't roll over in time. ### Modifications Only make the ledger rollover scheduled task after the ledger created successfully. If the scheduled task was executed when there is no entry in the current ledger, the scheduled task will not be re-executed, and if there is new entry is added the ledger will rollover. ### Verifying this change Add a unit test to verify the ledger could be rolled over in time.
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
Currently, the ledger rollover scheduled task will execute before reach the ledger maximum rollover time, this will cause the ledger doesn't roll over in time.
Modifications
Only make the ledger rollover scheduled task after the ledger created successfully.
If the scheduled task was executed when there is no entry in the current ledger, the scheduled task will not be re-executed, and if there is new entry is added the ledger will rollover.
Verifying this change
Add a unit test to verify the ledger could be rolled over in time.
Does this pull request potentially affect one of the following parts:
If
yeswas chosen, please highlight the changes