This is an automated email from the ASF dual-hosted git repository.

dlmarion pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/2.1 by this push:
     new 3a4ff420c4 Slow down assigned tablet logging during Manager shut down 
(#5742)
3a4ff420c4 is described below

commit 3a4ff420c44ac714feb21ad55b14f2d051c9eb94
Author: Dave Marion <[email protected]>
AuthorDate: Fri Jul 18 08:47:20 2025 -0400

    Slow down assigned tablet logging during Manager shut down (#5742)
    
    Three messages are logged every 10s during the Manager shut
    down process while the Manager is in safe mode. This change
    uses the DeduplicatingLogger to suppress duplicate messages
    so that they are only logged once every minute.
    
    Closes #5647
---
 .../src/main/java/org/apache/accumulo/manager/Manager.java    | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git 
a/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java 
b/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java
index a9b861fbd4..36f0282102 100644
--- a/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java
+++ b/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java
@@ -29,6 +29,7 @@ import static 
org.apache.accumulo.core.util.UtilWaitThread.sleepUninterruptibly;
 
 import java.io.IOException;
 import java.net.UnknownHostException;
+import java.time.Duration;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -74,6 +75,7 @@ import 
org.apache.accumulo.core.fate.zookeeper.ZooReaderWriter;
 import org.apache.accumulo.core.fate.zookeeper.ZooUtil;
 import org.apache.accumulo.core.fate.zookeeper.ZooUtil.NodeExistsPolicy;
 import org.apache.accumulo.core.fate.zookeeper.ZooUtil.NodeMissingPolicy;
+import org.apache.accumulo.core.logging.ConditionalLogger.DeduplicatingLogger;
 import org.apache.accumulo.core.manager.balancer.AssignmentParamsImpl;
 import org.apache.accumulo.core.manager.balancer.BalanceParamsImpl;
 import org.apache.accumulo.core.manager.balancer.TServerStatusImpl;
@@ -170,6 +172,13 @@ public class Manager extends AbstractServer implements 
LiveTServerSet.Listener,
 
   static final Logger log = LoggerFactory.getLogger(Manager.class);
 
+  // When in safe mode totalAssignedOrHosted() is called every 10s
+  // which logs 3 messages about assigned tablets, 1 message
+  // per TabletGroupWatcher. This DeduplicatingLogger slows
+  // down the log messages to once per minute.
+  private static final DeduplicatingLogger DEDUPE_LOG =
+      new DeduplicatingLogger(log, Duration.ofMinutes(1), 6);
+
   static final int ONE_SECOND = 1000;
   private static final long CLEANUP_INTERVAL_MINUTES = 5;
   static final long WAIT_BETWEEN_ERRORS = ONE_SECOND;
@@ -333,7 +342,7 @@ public class Manager extends AbstractServer implements 
LiveTServerSet.Listener,
     int result = 0;
     for (TabletGroupWatcher watcher : watchers) {
       for (TableCounts counts : watcher.getStats().values()) {
-        log.debug(
+        DEDUPE_LOG.debug(
             "Watcher: {}: Assigned Tablets: {}, Dead tserver assignments: {}, 
Suspended Tablets: {}",
             watcher.getName(), counts.assigned(), 
counts.assignedToDeadServers(),
             counts.suspended());

Reply via email to