You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ps...@apache.org on 2018/11/30 08:13:00 UTC
hbase git commit: HBASE-21518 TestMasterFailoverWithProcedures is
flaky
Repository: hbase
Updated Branches:
refs/heads/master d42e0ade1 -> dfeab9f5c
HBASE-21518 TestMasterFailoverWithProcedures is flaky
Signed-off-by: Sean Busbey <bu...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/dfeab9f5
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/dfeab9f5
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/dfeab9f5
Branch: refs/heads/master
Commit: dfeab9f5c968625ac1c642c53c721eb5e81068c0
Parents: d42e0ad
Author: Peter Somogyi <ps...@apache.org>
Authored: Thu Nov 29 18:04:53 2018 +0100
Committer: Peter Somogyi <ps...@apache.org>
Committed: Fri Nov 30 09:12:06 2018 +0100
----------------------------------------------------------------------
.../hadoop/hbase/util/JVMClusterUtil.java | 24 ++++++++++++++------
1 file changed, 17 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/dfeab9f5/hbase-server/src/main/java/org/apache/hadoop/hbase/util/JVMClusterUtil.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/JVMClusterUtil.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/JVMClusterUtil.java
index 8c92f66..7518d65 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/JVMClusterUtil.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/JVMClusterUtil.java
@@ -249,14 +249,24 @@ public class JVMClusterUtil {
// Do backups first.
JVMClusterUtil.MasterThread activeMaster = null;
for (JVMClusterUtil.MasterThread t : masters) {
- if (!t.master.isActiveMaster()) {
- try {
- t.master.stopMaster();
- } catch (IOException e) {
- LOG.error("Exception occurred while stopping master", e);
+ // Master was killed but could be still considered as active. Check first if it is stopped.
+ if (!t.master.isStopped()) {
+ if (!t.master.isActiveMaster()) {
+ try {
+ t.master.stopMaster();
+ } catch (IOException e) {
+ LOG.error("Exception occurred while stopping master", e);
+ }
+ LOG.info("Stopped backup Master {} is stopped: {}",
+ t.master.hashCode(), t.master.isStopped());
+ } else {
+ if (activeMaster != null) {
+ LOG.warn("Found more than 1 active master, hash {}", activeMaster.master.hashCode());
+ }
+ activeMaster = t;
+ LOG.debug("Found active master hash={}, stopped={}",
+ t.master.hashCode(), t.master.isStopped());
}
- } else {
- activeMaster = t;
}
}
// Do active after.