hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-20090 Properly handle Preconditions check failure in MemStoreFlusher.run
Date Wed, 21 Mar 2018 16:10:30 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-2.0 0b44b1360 -> 40507a8bc


HBASE-20090 Properly handle Preconditions check failure in MemStoreFlusher.run


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/40507a8b
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/40507a8b
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/40507a8b

Branch: refs/heads/branch-2.0
Commit: 40507a8bc570e6aa72a47648c79c45cf60ee0967
Parents: 0b44b13
Author: tedyu <yuzhihong@gmail.com>
Authored: Tue Mar 20 21:02:09 2018 -0700
Committer: Michael Stack <stack@apache.org>
Committed: Wed Mar 21 09:10:23 2018 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/regionserver/MemStoreFlusher.java | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/40507a8b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
index 23321e8..1b7e0bc 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
@@ -42,7 +42,6 @@ import org.apache.hadoop.hbase.DroppedSnapshotException;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.client.RegionReplicaUtil;
 import org.apache.hadoop.hbase.regionserver.HRegion.FlushResult;
-import org.apache.hbase.thirdparty.com.google.common.base.Preconditions;
 import org.apache.hadoop.hbase.trace.TraceUtil;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
@@ -253,8 +252,13 @@ class MemStoreFlusher implements FlushRequester {
           bestRegionReplicaSize = getMemStoreDataSize(bestRegionReplica);
       }
 
-      Preconditions.checkState(
-        (regionToFlush != null && regionToFlushSize > 0) || bestRegionReplicaSize
> 0);
+      if ((regionToFlush == null || regionToFlushSize == 0) && bestRegionReplicaSize
== 0) {
+        // A concurrency issue (such as splitting region) may happen such that the online
region
+        // seen by getCopyOfOnlineRegionsSortedByXX() method is no longer eligible to
+        // getBiggestMemStoreRegion(). This means that we can come out of the loop
+        LOG.debug("Above memory mark but there is no flushable region");
+        return false;
+      }
 
       if (regionToFlush == null ||
           (bestRegionReplica != null &&


Mime
View raw message