michaeljmarshall commented on a change in pull request #13073:
URL: https://github.com/apache/pulsar/pull/13073#discussion_r761440344
##########
File path:
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
##########
@@ -2228,6 +2228,14 @@
)
private int managedLedgerOffloadPrefetchRounds = 1;
+ @FieldContext(
+ dynamic = true,
+ category = CATEGORY_STORAGE_ML,
+ doc = "Time to rollover ledger for inactive topic (duration without
any publish on that topic)."
Review comment:
```suggestion
doc = "Time to rollover ledger for inactive topic (duration without
any publish on that topic). "
```
##########
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:
The implementation relies on messages to trigger ledger closure due to
inactivity. While it might be a slightly heavier solution, would it make more
sense to have a single scheduled task that runs in the broker service to check
for inactive ledgers? Otherwise, a ledger that stops receiving messages will
not close until the `managedLedgerMaxLedgerRolloverTimeMinutes` has passed.
--
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]