From 13e7efaa971cd3613b065ac50836c5ee98985d13 Mon Sep 17 00:00:00 2001 From: lifepuzzlefun Date: Mon, 8 Jan 2024 12:26:08 +0800 Subject: [PATCH] fix LedgerHandle `ensembleChangeCounter` not used. (#4103) ### Motivation fix #4096 ensemble change counter not inc when ensemble change . ### Changes inc counter when ensemble change. --- .../src/main/java/org/apache/bookkeeper/client/LedgerHandle.java | 1 + 1 file changed, 1 insertion(+) diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java index 945b2844373..9486b2e632c 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java @@ -1913,6 +1913,7 @@ void handleBookieFailure(final Map failedBookies) { void ensembleChangeLoop(List origEnsemble, Map failedBookies) { int ensembleChangeId = numEnsembleChanges.incrementAndGet(); + ensembleChangeCounter.inc(); String logContext = String.format("[EnsembleChange(ledger:%d, change-id:%010d)]", ledgerId, ensembleChangeId); // when the ensemble changes are too frequent, close handle