rdhabalia commented on a change in pull request #13073:
URL: https://github.com/apache/pulsar/pull/13073#discussion_r772715296
##########
File path:
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
##########
@@ -729,6 +733,8 @@ private synchronized void internalAsyncAddEntry(OpAddEntry
addOperation) {
if (!beforeAddEntry(addOperation)) {
return;
}
+ // check if ledger can be closed due to inactivity
+ checkInactiveLedgerAndRollOver(lastAddEntryTimeMs);
Review comment:
hmm.. actually lazy check should be enough because eventually ledger
will be closed if topic in unloaded, broker restarts or topic receives a new
write and that will protect topic from the issue. However, adding scheduled
task will not have much harm except it might repetitive close empty ledger but
might give certainty to ledger age.
I have made the change and moved check to scheduled task.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]