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

ddanielr 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 e24f97dda3 Adds tablet extent, files, and full stacktrace to log 
message (#5863)
e24f97dda3 is described below

commit e24f97dda3d075f3cf7ca29b467058216b47a5ed
Author: Daniel Roberts <[email protected]>
AuthorDate: Thu Sep 11 11:24:58 2025 -0400

    Adds tablet extent, files, and full stacktrace to log message (#5863)
    
    * Adds tabletID, files, and full stacktrace to log
    
    Adds the tabletID, the set of files being called, and the full stack
    trace to the log message for better troubleshooting.
    
    If an exception is returned for "File does not exist" then compute the
    file set difference and log the output.
    If there is not a set difference than still log an error.
---
 .../org/apache/accumulo/tserver/tablet/Tablet.java | 24 ++++++++++++++++++----
 .../apache/accumulo/test/functional/SplitIT.java   |  2 +-
 2 files changed, 21 insertions(+), 5 deletions(-)

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 71f4efca1c..17a2716a9c 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
@@ -1470,8 +1470,8 @@ public class Tablet extends TabletBase {
   }
 
   // The following caches keys from users files needed to compute a tablets 
split point. This cached
-  // data could potentially be large and is therefore stored using a soft 
refence so the Java GC can
-  // release it if needed. If the cached information is not there it can 
always be recomputed.
+  // data could potentially be large and is therefore stored using a soft 
reference so the Java GC
+  // can release it if needed. If the cached information is not there it can 
always be recomputed.
   private volatile SoftReference<SplitComputations> lastSplitComputation =
       new SoftReference<>(null);
   private final Lock splitComputationLock = new ReentrantLock();
@@ -1507,6 +1507,7 @@ public class Tablet extends TabletBase {
     // Only want one thread doing this computation at time for a tablet.
     if (splitComputationLock.tryLock()) {
       try {
+        log.debug("Starting midpoint calculation for extent {}", extent);
         SortedMap<Double,Key> midpoint =
             FileUtil.findMidPoint(context, tableConfiguration, 
chooseTabletDir(),
                 extent.prevEndRow(), extent.endRow(), 
FileUtil.toPathStrings(files), .25, true);
@@ -1521,14 +1522,29 @@ public class Tablet extends TabletBase {
         newComputation = new SplitComputations(files, midpoint, lastRow);
 
         lastSplitComputation = new SoftReference<>(newComputation);
+      } catch (FileNotFoundException e) {
+        lastSplitComputation.clear();
+        // Create a copy of the unmodifiable file set and remove the files 
that still exist
+        Set<TabletFile> missingOriginalFiles = new HashSet<>(files);
+        missingOriginalFiles.removeAll(getDatafileManager().getFiles());
+        if (!missingOriginalFiles.isEmpty()) {
+          log.debug(
+              "Failed to compute split information. The following files have 
most likely been garbage collected: {}",
+              missingOriginalFiles);
+        } else {
+          // A file is missing in HDFS and should be reported as an error
+          log.error("Failed to compute split information from {} files in 
tablet {}", files.size(),
+              getExtent(), e);
+        }
+        return Optional.empty();
       } catch (IOException e) {
         lastSplitComputation.clear();
-        log.error("Failed to compute split information from files " + 
e.getMessage());
+        log.error("Failed to compute split information from {} files in tablet 
{}", files.size(),
+            getExtent(), e);
         return Optional.empty();
       } finally {
         splitComputationLock.unlock();
       }
-
       return Optional.of(newComputation);
     } else {
       // some other thread seems to be working on split, let the other thread 
work on it
diff --git 
a/test/src/main/java/org/apache/accumulo/test/functional/SplitIT.java 
b/test/src/main/java/org/apache/accumulo/test/functional/SplitIT.java
index 9db336554d..18db2d9c19 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/SplitIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/SplitIT.java
@@ -164,7 +164,7 @@ public class SplitIT extends AccumuloClusterHarness {
         }
 
         assertTrue(shortened > 0, "Shortened should be greater than zero: " + 
shortened);
-        assertTrue(count > 10, "Count should be cgreater than 10: " + count);
+        assertTrue(count > 10, "Count should be greater than 10: " + count);
       }
 
       assertEquals(0, 
getCluster().getClusterControl().exec(CheckForMetadataProblems.class,

Reply via email to