You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2017/05/15 16:49:34 UTC
hbase git commit: Two SPLIT requests came in on top of each other;
the second failed because it saw parent region was SPLIT. I 'fixed'
this before but my fix was in the wrong place
Repository: hbase
Updated Branches:
refs/heads/HBASE-14614 50511ad24 -> 9460eaf1b
Two SPLIT requests came in on top of each other; the second failed because it saw parent region was SPLIT. I 'fixed' this before but my fix was in the wrong place
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/9460eaf1
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/9460eaf1
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/9460eaf1
Branch: refs/heads/HBASE-14614
Commit: 9460eaf1bfd04b74bc7e4da7405c1601bd02b791
Parents: 50511ad2
Author: Michael Stack <st...@apache.org>
Authored: Mon May 15 09:49:30 2017 -0700
Committer: Michael Stack <st...@apache.org>
Committed: Mon May 15 09:49:30 2017 -0700
----------------------------------------------------------------------
.../hbase/procedure2/ProcedureExecutor.java | 2 +-
.../assignment/SplitTableRegionProcedure.java | 20 ++++++++++++--------
.../hadoop/hbase/regionserver/HRegion.java | 5 +++++
3 files changed, 18 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/9460eaf1/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureExecutor.java
----------------------------------------------------------------------
diff --git a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureExecutor.java b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureExecutor.java
index 258e268..bc73453 100644
--- a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureExecutor.java
+++ b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureExecutor.java
@@ -1147,7 +1147,7 @@ public class ProcedureExecutor<TEnvironment> {
scheduler.yield(proc);
break;
case LOCK_EVENT_WAIT:
- // someone will wake us up when the lock is available
+ // Someone will wake us up when the lock is available
LOG.debug(lockState + " " + proc);
break;
default:
http://git-wip-us.apache.org/repos/asf/hbase/blob/9460eaf1/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/SplitTableRegionProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/SplitTableRegionProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/SplitTableRegionProcedure.java
index 6815e9f..7ebe769 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/SplitTableRegionProcedure.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/SplitTableRegionProcedure.java
@@ -341,6 +341,15 @@ public class SplitTableRegionProcedure
if (node != null) {
parentHRI = node.getRegionInfo();
+ // Lookup the parent HRI state from the AM, which has the latest updated info.
+ // Protect against the case where concurrent SPLIT requests came in. Check a SPLIT
+ // did not just run.
+ if (parentHRI.isSplit() || parentHRI.isOffline()) {
+ setFailure(new IOException("Split " + parentHRI.getRegionNameAsString() + " FAILED because " +
+ "offline/split already."));
+ return false;
+ }
+
// expected parent to be online or closed
if (!node.isInState(EXPECTED_SPLIT_STATES)) {
// We may have SPLIT already?
@@ -350,13 +359,6 @@ public class SplitTableRegionProcedure
return false;
}
- // lookup the parent HRI state from the AM, which has the latest updated info.
- if (parentHRI.isSplit() || parentHRI.isOffline()) {
- setFailure(new IOException("Split " + parentHRI.getRegionNameAsString() + " FAILED because " +
- "offline/split already."));
- return false;
- }
-
// Ask the remote regionserver if this region is splittable. If we get an IOE, report it
// along w/ the failure so can see why we are not splittable at this time.
IOException splittableCheckIOE = null;
@@ -365,7 +367,9 @@ public class SplitTableRegionProcedure
GetRegionInfoResponse response =
Util.getRegionInfoResponse(env, node.getRegionLocation(), node.getRegionInfo());
splittable = response.hasSplittable() && response.getSplittable();
- LOG.info("REMOVE splittable " + splittable + " " + this + " " + node);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Splittable=" + splittable + " " + this + " " + node.toShortString());
+ }
} catch (IOException e) {
splittableCheckIOE = e;
}
http://git-wip-us.apache.org/repos/asf/hbase/blob/9460eaf1/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
index b06e226..d9ef1f0 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
@@ -7790,6 +7790,11 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
return null;
}
+ // Can't split a region that is closing.
+ if (this.isClosing()) {
+ return null;
+ }
+
if (!splitPolicy.shouldSplit()) {
return null;
}