You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by kt...@apache.org on 2019/03/07 16:38:12 UTC

[accumulo] branch 1.9 updated: fixes #998 handle splitting tablet with no data and files (#999)

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

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


The following commit(s) were added to refs/heads/1.9 by this push:
     new 59e056c  fixes #998 handle splitting tablet with no data and files (#999)
59e056c is described below

commit 59e056cb5debeff2a19903647cdc206d20fb3204
Author: Keith Turner <kt...@apache.org>
AuthorDate: Thu Mar 7 11:38:07 2019 -0500

    fixes #998 handle splitting tablet with no data and files (#999)
---
 .../main/java/org/apache/accumulo/server/util/FileUtil.java   |  4 ++--
 .../main/java/org/apache/accumulo/tserver/tablet/Tablet.java  | 11 +++++++++++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java
index 6128324..6543e4e 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java
@@ -58,6 +58,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Optional;
+import com.google.common.collect.ImmutableSortedMap;
 
 public class FileUtil {
 
@@ -332,8 +333,7 @@ public class FileUtil {
           // need to pass original map files, not possibly reduced indexes
           return findMidPoint(fs, acuConf, prevEndRow, endRow, origMapFiles, minSplit, false);
         }
-        throw new IOException("Failed to find mid point, no entries between " + prevEndRow + " and "
-            + endRow + " for " + mapFiles);
+        return ImmutableSortedMap.of();
       }
 
       // @formatter:off
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 98bf80a..1a2fe37 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
@@ -1635,6 +1635,17 @@ public class Tablet implements TabletCommitter {
       return null;
     }
 
+    if (keys.isEmpty()) {
+      log.info("Cannot split tablet " + extent + ", files contain no data for tablet.");
+
+      // set the following to keep tablet from attempting to split until the tablets set of files
+      // changes.
+      sawBigRow = true;
+      timeOfLastMinCWhenBigFreakinRowWasSeen = lastMinorCompactionFinishTime;
+      timeOfLastImportWhenBigFreakinRowWasSeen = lastMapFileImportTime;
+      return null;
+    }
+
     // check to see if one row takes up most of the tablet, in which case we can not split
     try {