From d0c2e60e36616086bb4ec8bec108fe46403dd734 Mon Sep 17 00:00:00 2001 From: Ankit Singhal Date: Wed, 14 Nov 2018 22:31:53 -0800 Subject: [PATCH] HBASE-21440 Assign procedure on the crashed server is not properly interrupted --- .../procedure2/RemoteProcedureDispatcher.java | 2 +- .../master/assignment/AssignProcedure.java | 12 ++++++ .../master/assignment/AssignmentManager.java | 39 ------------------- .../assignment/RegionTransitionProcedure.java | 6 ++- .../procedure/ServerCrashProcedure.java | 16 ++++---- .../replication/RefreshPeerProcedure.java | 3 +- .../master/snapshot/TestAssignProcedure.java | 3 +- 7 files changed, 30 insertions(+), 51 deletions(-) diff --git a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/RemoteProcedureDispatcher.java b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/RemoteProcedureDispatcher.java index 9c1f5ca8a46..73f6d473c09 100644 --- a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/RemoteProcedureDispatcher.java +++ b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/RemoteProcedureDispatcher.java @@ -237,7 +237,7 @@ public abstract class RemoteProcedureDispatcher } @Override - public synchronized void remoteCallFailed(MasterProcedureEnv env, ServerName remote, + public synchronized boolean remoteCallFailed(MasterProcedureEnv env, ServerName remote, IOException exception) { complete(env, exception); + return true; } @Override diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestAssignProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestAssignProcedure.java index 8836c9f75e5..5067fc361c1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestAssignProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestAssignProcedure.java @@ -108,11 +108,12 @@ public class TestAssignProcedure { } @Override - public void remoteCallFailed(final MasterProcedureEnv env, + public boolean remoteCallFailed(final MasterProcedureEnv env, final ServerName serverName, final IOException exception) { // Just skip this remoteCallFailed. Its too hard to mock. Assert it is called though. // Happens after the code we are testing has been called. this.remoteCallFailedWasCalled.set(true); + return true; } };