-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
make ledger rollover check task internal #8946
make ledger rollover check task internal #8946
Conversation
@wuzhanpeng Please help take a look, thanks. |
@@ -3300,6 +3305,13 @@ private void scheduleTimeoutTask() { | |||
checkReadTimeout(); | |||
}), timeoutSec, timeoutSec, TimeUnit.SECONDS); | |||
} | |||
|
|||
if (config.getMaximumRolloverTimeMs() > 0) { |
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.
I think it would be better to separate the timing task of checking that current ledger is full from scheduleTimeoutTask
and put it in the ledger initialize
method.
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.
Ok, I move it into individual method.
/pulsarbot run-failure-checks |
3 similar comments
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
/** | ||
* Roll current ledger if it is full | ||
*/ | ||
void rollCurrentLedgerIfFull(); |
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.
@hangc0276 we shouldn't remove a method from an interface directly. we should keep the method and mark it as deprecated.
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.
Ok, i move it back.
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
9fe915a
to
534326d
Compare
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
/pulsarbot run-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.
LGTM
Fix apache#7195 ### Changes 1. add a schedulerTask to rollover the ledger in `ManagedLedgerImpl` instead of `BrokerService` 2. add the test.
Fix apache#7195 1. add a schedulerTask to rollover the ledger in `ManagedLedgerImpl` instead of `BrokerService` 2. add the test. (cherry picked from commit b4ef76e)
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.
Fix #7195
Changes
ManagedLedgerImpl
instead ofBrokerService