This is an automated email from the ASF dual-hosted git repository. yong pushed a commit to branch branch-4.16 in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
commit 6ade69fce63d2e24358f0373ce1dfa9e4592ae74 Author: wenbingshen <[email protected]> AuthorDate: Thu Apr 27 13:38:50 2023 +0800 fix wrong update checkAllLedgersTime when ledgerReplication disabled (#3939) ### Motivation When ledgerReplication disabled, we don't need to register `checkAllLedgersTime` failedEvent because we already skipped the check and didn't encounter any exception. ```java Stopwatch stopwatch = Stopwatch.createStarted(); boolean checkSuccess = false; try { if (!isLedgerReplicationEnabled()) { LOG.info("Ledger replication disabled, skipping checkAllLedgers"); checkSuccess = true; <= here return; } LOG.info("Starting checkAllLedgers"); checkAllLedgers(); ...... checkSuccess = true; } catch (InterruptedException ie) { ...... } finally { if (!checkSuccess) { long checkAllLedgersDuration = stopwatch.stop().elapsed(TimeUnit.MILLISECONDS); auditorStats.getCheckAllLedgersTime() .registerFailedEvent(checkAllLedgersDuration, TimeUnit.MILLISECONDS); } } ``` (cherry picked from commit c765aea600fde1a8ac7cb8a53a1157a372026894) --- .../org/apache/bookkeeper/replication/AuditorCheckAllLedgersTask.java | 1 + 1 file changed, 1 insertion(+) diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AuditorCheckAllLedgersTask.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AuditorCheckAllLedgersTask.java index f6b7a6f36e..580fa60538 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AuditorCheckAllLedgersTask.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AuditorCheckAllLedgersTask.java @@ -102,6 +102,7 @@ public class AuditorCheckAllLedgersTask extends AuditorTask { try { if (!isLedgerReplicationEnabled()) { LOG.info("Ledger replication disabled, skipping checkAllLedgers"); + checkSuccess = true; return; }
