diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java index bccdb1d1df8..428f763ea7a 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java @@ -1233,8 +1233,9 @@ private CompletableFuture publishSuspectedLedgersAsync(Collection mis if (exception == null) { underReplicatedSize.add(metadata.getValue().getLength()); } - }), null); - underReplicatedLedgerTotalSize.registerSuccessfulValue(underReplicatedSize.longValue()); + }), null).whenComplete((res, e) -> { + underReplicatedLedgerTotalSize.registerSuccessfulValue(underReplicatedSize.longValue()); + }); return FutureUtils.processList( Lists.newArrayList(ledgers),