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

kturner 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 0733d3ae86 adds logging when tablet close is waiting on a scan (#3582)
0733d3ae86 is described below

commit 0733d3ae86cae082faab9b40b46bb55149e0852f
Author: Keith Turner <[email protected]>
AuthorDate: Wed Jul 12 12:58:05 2023 -0400

    adds logging when tablet close is waiting on a scan (#3582)
---
 .../org/apache/accumulo/tserver/tablet/ScanDataSource.java    | 11 +++++++++++
 .../main/java/org/apache/accumulo/tserver/tablet/Tablet.java  | 11 +++++++++++
 2 files changed, 22 insertions(+)

diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java
 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java
index 93b0e8a7f2..51ada87625 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java
@@ -50,6 +50,8 @@ import 
org.apache.accumulo.server.iterators.TabletIteratorEnvironment;
 import org.apache.accumulo.tserver.InMemoryMap.MemoryIterator;
 import org.apache.accumulo.tserver.TabletServer;
 import org.apache.accumulo.tserver.scan.ScanParameters;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -286,4 +288,13 @@ class ScanDataSource implements DataSource {
     throw new UnsupportedOperationException();
   }
 
+  @Override
+  public String toString() {
+    return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
+        .append("isNull(memIters)", memIters == null)
+        .append("isNull(fileManager)", fileManager == null)
+        .append("fileReservationId", 
fileReservationId).append("interruptFlag", interruptFlag.get())
+        .append("expectedDeletionCount", 
expectedDeletionCount).append("scanParams", scanParams)
+        .toString();
+  }
 }
diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
index 8097c3660b..23cc377bcf 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
@@ -978,8 +978,19 @@ public class Tablet extends TabletBase {
       activeScan.interrupt();
     }
 
+    long lastLogTime = System.nanoTime();
+
     // wait for reads and writes to complete
     while (writesInProgress > 0 || !activeScans.isEmpty()) {
+
+      if (log.isDebugEnabled() && System.nanoTime() - lastLogTime > 
TimeUnit.SECONDS.toNanos(60)) {
+        for (ScanDataSource activeScan : activeScans) {
+          log.debug("Waiting on scan in completeClose {} {}", extent, 
activeScan);
+        }
+
+        lastLogTime = System.nanoTime();
+      }
+
       try {
         log.debug("Waiting to completeClose for {}. {} writes {} scans", 
extent, writesInProgress,
             activeScans.size());

Reply via email to