hbase git commit: Revert "HBASE-21095 The timeout retry logic for several procedures are broken after master restarts"

2018-08-24 Thread stack
Repository: hbase
Updated Branches:
  refs/heads/branch-2 09be1d0d5 -> a220566b9


Revert "HBASE-21095 The timeout retry logic for several procedures are broken 
after master restarts"

This reverts commit 09be1d0d571f861a8f0c47560ebf120f34a44119.


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

Branch: refs/heads/branch-2
Commit: a220566b9875615e92a848d109b17fcfc1566b19
Parents: 09be1d0
Author: Michael Stack 
Authored: Fri Aug 24 12:24:17 2018 -0700
Committer: Michael Stack 
Committed: Fri Aug 24 12:24:17 2018 -0700

--
 .../assignment/RegionTransitionProcedure.java | 11 +++
 .../assignment/TestUnexpectedStateException.java  | 18 --
 2 files changed, 11 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/a220566b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionTransitionProcedure.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionTransitionProcedure.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionTransitionProcedure.java
index c10bf2d..0db8676 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionTransitionProcedure.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionTransitionProcedure.java
@@ -364,9 +364,12 @@ public abstract class RegionTransitionProcedure
   LOG.warn("Failed transition, suspend {}secs {}; {}; waiting on rectified 
condition fixed " +
   "by other Procedure or operator intervention", backoff / 1000, 
this,
   regionNode.toShortString(), e);
-  setTimeout(Math.toIntExact(backoff));
-  setState(ProcedureProtos.ProcedureState.WAITING_TIMEOUT);
-  throw new ProcedureSuspendedException();
+  getRegionState(env).getProcedureEvent().suspend();
+  if (getRegionState(env).getProcedureEvent().suspendIfNotReady(this)) {
+setTimeout(Math.toIntExact(backoff));
+setState(ProcedureProtos.ProcedureState.WAITING_TIMEOUT);
+throw new ProcedureSuspendedException();
+  }
 }
 
 return new Procedure[] {this};
@@ -384,7 +387,7 @@ public abstract class RegionTransitionProcedure
   @Override
   protected synchronized boolean setTimeoutFailure(MasterProcedureEnv env) {
 setState(ProcedureProtos.ProcedureState.RUNNABLE);
-env.getProcedureScheduler().addFront(this);
+getRegionState(env).getProcedureEvent().wake(env.getProcedureScheduler());
 return false; // 'false' means that this procedure handled the timeout
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/a220566b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestUnexpectedStateException.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestUnexpectedStateException.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestUnexpectedStateException.java
index 16648c0..0f62f8e 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestUnexpectedStateException.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestUnexpectedStateException.java
@@ -24,15 +24,17 @@ import java.util.Iterator;
 import java.util.List;
 import org.apache.hadoop.hbase.HBaseClassTestRule;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
-import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.RegionInfo;
-import org.apache.hadoop.hbase.master.HMaster;
 import org.apache.hadoop.hbase.testclassification.MasterTests;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Threads;
+import org.apache.hbase.thirdparty.com.google.gson.JsonArray;
+import org.apache.hbase.thirdparty.com.google.gson.JsonElement;
+import org.apache.hbase.thirdparty.com.google.gson.JsonObject;
+import org.apache.hbase.thirdparty.com.google.gson.JsonParser;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -44,11 +46,6 @@ import org.junit.rules.TestName;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.hbase.thirdparty.com.google.gson.JsonArray;
-import org.apache.hbase.thirdparty.com.google.gson.JsonElement;
-import org.apache.hbase.thirdparty.com.google.gson.JsonObject;
-import org.a

hbase git commit: Revert "HBASE-21095 The timeout retry logic for several procedures are broken after master restarts"

2018-08-24 Thread stack
Repository: hbase
Updated Branches:
  refs/heads/branch-2.0 dae6b2f3f -> 19b722e84


Revert "HBASE-21095 The timeout retry logic for several procedures are broken 
after master restarts"

This reverts commit dae6b2f3fbeb0e2af21cac9a3a3255416fbc9bf2.


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

Branch: refs/heads/branch-2.0
Commit: 19b722e8412b48d6318a9599b702995e99099d7e
Parents: dae6b2f
Author: Michael Stack 
Authored: Fri Aug 24 12:24:51 2018 -0700
Committer: Michael Stack 
Committed: Fri Aug 24 12:24:51 2018 -0700

--
 .../assignment/RegionTransitionProcedure.java | 11 +++
 .../assignment/TestUnexpectedStateException.java  | 18 --
 2 files changed, 11 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/19b722e8/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionTransitionProcedure.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionTransitionProcedure.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionTransitionProcedure.java
index c9d141a..de39f4c 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionTransitionProcedure.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionTransitionProcedure.java
@@ -371,9 +371,12 @@ public abstract class RegionTransitionProcedure
   LOG.warn("Failed transition, suspend {}secs {}; {}; waiting on rectified 
condition fixed " +
   "by other Procedure or operator intervention", backoff / 1000, 
this,
   regionNode.toShortString(), e);
-  setTimeout(Math.toIntExact(backoff));
-  setState(ProcedureProtos.ProcedureState.WAITING_TIMEOUT);
-  throw new ProcedureSuspendedException();
+  getRegionState(env).getProcedureEvent().suspend();
+  if (getRegionState(env).getProcedureEvent().suspendIfNotReady(this)) {
+setTimeout(Math.toIntExact(backoff));
+setState(ProcedureProtos.ProcedureState.WAITING_TIMEOUT);
+throw new ProcedureSuspendedException();
+  }
 }
 
 return new Procedure[] {this};
@@ -391,7 +394,7 @@ public abstract class RegionTransitionProcedure
   @Override
   protected synchronized boolean setTimeoutFailure(MasterProcedureEnv env) {
 setState(ProcedureProtos.ProcedureState.RUNNABLE);
-env.getProcedureScheduler().addFront(this);
+getRegionState(env).getProcedureEvent().wake(env.getProcedureScheduler());
 return false; // 'false' means that this procedure handled the timeout
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/19b722e8/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestUnexpectedStateException.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestUnexpectedStateException.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestUnexpectedStateException.java
index 16648c0..0f62f8e 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestUnexpectedStateException.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestUnexpectedStateException.java
@@ -24,15 +24,17 @@ import java.util.Iterator;
 import java.util.List;
 import org.apache.hadoop.hbase.HBaseClassTestRule;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
-import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.RegionInfo;
-import org.apache.hadoop.hbase.master.HMaster;
 import org.apache.hadoop.hbase.testclassification.MasterTests;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Threads;
+import org.apache.hbase.thirdparty.com.google.gson.JsonArray;
+import org.apache.hbase.thirdparty.com.google.gson.JsonElement;
+import org.apache.hbase.thirdparty.com.google.gson.JsonObject;
+import org.apache.hbase.thirdparty.com.google.gson.JsonParser;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -44,11 +46,6 @@ import org.junit.rules.TestName;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.hbase.thirdparty.com.google.gson.JsonArray;
-import org.apache.hbase.thirdparty.com.google.gson.JsonElement;
-import org.apache.hbase.thirdparty.com.google.gson.JsonObject;
-import o

hbase git commit: Revert "HBASE-21095 The timeout retry logic for several procedures are broken after master restarts"

2018-08-24 Thread stack
Repository: hbase
Updated Branches:
  refs/heads/branch-2.1 b82cd670c -> 4978db810


Revert "HBASE-21095 The timeout retry logic for several procedures are broken 
after master restarts"

This reverts commit b82cd670c3f473fde937c5b8445acc83ca76c5c6.


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

Branch: refs/heads/branch-2.1
Commit: 4978db81028f3a955932589af77599b53d909a46
Parents: b82cd67
Author: Michael Stack 
Authored: Fri Aug 24 12:24:32 2018 -0700
Committer: Michael Stack 
Committed: Fri Aug 24 12:24:32 2018 -0700

--
 .../assignment/RegionTransitionProcedure.java | 11 +++
 .../assignment/TestUnexpectedStateException.java  | 18 --
 2 files changed, 11 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/4978db81/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionTransitionProcedure.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionTransitionProcedure.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionTransitionProcedure.java
index c10bf2d..0db8676 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionTransitionProcedure.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionTransitionProcedure.java
@@ -364,9 +364,12 @@ public abstract class RegionTransitionProcedure
   LOG.warn("Failed transition, suspend {}secs {}; {}; waiting on rectified 
condition fixed " +
   "by other Procedure or operator intervention", backoff / 1000, 
this,
   regionNode.toShortString(), e);
-  setTimeout(Math.toIntExact(backoff));
-  setState(ProcedureProtos.ProcedureState.WAITING_TIMEOUT);
-  throw new ProcedureSuspendedException();
+  getRegionState(env).getProcedureEvent().suspend();
+  if (getRegionState(env).getProcedureEvent().suspendIfNotReady(this)) {
+setTimeout(Math.toIntExact(backoff));
+setState(ProcedureProtos.ProcedureState.WAITING_TIMEOUT);
+throw new ProcedureSuspendedException();
+  }
 }
 
 return new Procedure[] {this};
@@ -384,7 +387,7 @@ public abstract class RegionTransitionProcedure
   @Override
   protected synchronized boolean setTimeoutFailure(MasterProcedureEnv env) {
 setState(ProcedureProtos.ProcedureState.RUNNABLE);
-env.getProcedureScheduler().addFront(this);
+getRegionState(env).getProcedureEvent().wake(env.getProcedureScheduler());
 return false; // 'false' means that this procedure handled the timeout
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/4978db81/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestUnexpectedStateException.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestUnexpectedStateException.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestUnexpectedStateException.java
index 16648c0..0f62f8e 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestUnexpectedStateException.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestUnexpectedStateException.java
@@ -24,15 +24,17 @@ import java.util.Iterator;
 import java.util.List;
 import org.apache.hadoop.hbase.HBaseClassTestRule;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
-import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.RegionInfo;
-import org.apache.hadoop.hbase.master.HMaster;
 import org.apache.hadoop.hbase.testclassification.MasterTests;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Threads;
+import org.apache.hbase.thirdparty.com.google.gson.JsonArray;
+import org.apache.hbase.thirdparty.com.google.gson.JsonElement;
+import org.apache.hbase.thirdparty.com.google.gson.JsonObject;
+import org.apache.hbase.thirdparty.com.google.gson.JsonParser;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -44,11 +46,6 @@ import org.junit.rules.TestName;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.hbase.thirdparty.com.google.gson.JsonArray;
-import org.apache.hbase.thirdparty.com.google.gson.JsonElement;
-import org.apache.hbase.thirdparty.com.google.gson.JsonObject;
-import o