Repository navigation
[fix][ml] Fix ledger left in OPEN state when enable inactiveLedgerRollOverTimeMs - #20276
Conversation
inactiveLedgerRollOverTimeMs
|
@lifepuzzlefun Please add the following content to your PR description and select a checkbox: |
|
@lifepuzzlefun Please run the tests at least once in your own fork and update the information of the PR in your own fork to the description of the PR. We do this to save the limited resources in our CI in apache/pulsar. |
|
lifepuzzlefun#18 all test pass in my local repo. some of them fail on update cov file. |
+1, please update this link to the PR description so that it can be found there. |
…l/ManagedLedgerImpl.java Co-authored-by: Lari Hotari <[email protected]>
lhotari
left a comment
There was a problem hiding this comment.
LGTM, good work @lifepuzzlefun
lhotari
left a comment
There was a problem hiding this comment.
LGTM, good work @lifepuzzlefun
|
|
||
| ledgerClosed(lh); | ||
| // we do not create ledger here, since topic is inactive for a long time. | ||
| }, System.nanoTime()); |
There was a problem hiding this comment.
The context System.nanoTime() is not used. Can we set this param to null?
There was a problem hiding this comment.
agree. change both (inactive and rollover) callback ctx to null.
| if (rc == Code.OK) { | ||
| log.debug("Successfully closed ledger {}", lh.getId()); | ||
| } else { | ||
| log.warn("Error when closing ledger {}. Status={}", lh.getId(), BKException.getMessage(rc)); |
There was a problem hiding this comment.
The log should include the name of this managed ledger object, such as
log.warn("[{}] Error when closing ledger...", name,...);BTW, can you also change rollCurrentLedgerIfFull's log in this PR? And it is better to make these two logs are not the same, so it is easier to troubleshoot problems based on logs.
There was a problem hiding this comment.
yeah~ fix have been submitted, it looks with more detail now. nice suggestion!
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #20276 +/- ##
=============================================
+ Coverage 37.61% 72.93% +35.32%
- Complexity 12589 31948 +19359
=============================================
Files 1691 1868 +177
Lines 129028 138617 +9589
Branches 14066 15244 +1178
=============================================
+ Hits 48530 101104 +52574
+ Misses 74183 29461 -44722
- Partials 6315 8052 +1737
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…llOverTimeMs` (#20276) close `currentLegder` after roll current ledger if full
…llOverTimeMs` (#20276) close `currentLegder` after roll current ledger if full
…llOverTimeMs` (apache#20276) close `currentLegder` after roll current ledger if full (cherry picked from commit 64688d5)
Motivation
when ledger close or rollover. ml will change to ClosingLedger state and close current ledger.
and call
ledgerClosedmethod.the
inactiveLedgerRollOverTimeMstask didn't follow this routinue.Modifications
patch the close logic when enable
inactiveLedgerRollOverTimeMsthis optionVerifying this change
add unit test to check all ledger is closed.
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: (lifepuzzlefun#18)