Radiancebobo commented on code in PR #4873:
URL: https://github.com/apache/bookkeeper/pull/4873#discussion_r4754187257
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AuditorTask.java:
##########
@@ -88,24 +88,47 @@ protected CompletableFuture<?>
publishSuspectedLedgersAsync(Collection<String> m
.attr("ledgers", ledgers)
.attr("missingBookies", missingBookies)
.log("Following ledgers are identified as underreplicated");
-
auditorStats.getNumUnderReplicatedLedger().registerSuccessfulValue(ledgers.size());
+ LongAdder publishedLedgers = new LongAdder();
LongAdder underReplicatedSize = new LongAdder();
- FutureUtils.processList(
+ CompletableFuture<List<Void>> publishFuture = FutureUtils.processList(
Lists.newArrayList(ledgers),
- ledgerId ->
-
ledgerManager.readLedgerMetadata(ledgerId).whenComplete((metadata, exception)
-> {
- if (exception == null) {
-
underReplicatedSize.add(metadata.getValue().getLength());
- }
- }), null).whenComplete((res, e) -> {
+ ledgerId ->
ledgerManager.readLedgerMetadata(ledgerId).handle((metadata, exception) -> {
Review Comment:
Thanks for catching this. I’ve bounded both the Auditor metadata check and
the worker’s historical-task metadata check using the existing zkTimeout
setting.
The Auditor publishes fail-open on timeout, while the worker falls back to
normal replication. Neither timeout modifies the original metadata future.
Added regression coverage for a pending read, subsequent-ledger progress, late
completion, and worker retry cleanup. These bounds apply to the metadata
checks, not the entire publication or replication operation.
--
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]