From 753cc998140dabef85e995ad24333b983c971076 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Fri, 24 Jan 2020 11:53:13 -0800 Subject: [PATCH] HBASE-23726 Forward-port HBASE-21345 to branch-2.2, 2.3 & master as well. HBASE-21345 - [hbck2] Allow version check to proceed even though master is 'initializing'. Just remove the check state from the getClusterStatus call. Signed-off-by: Michael Stack Signed-off-by: Peter Somogyi Signed-off-by: Sakthi (cherry picked from commit dd8496a5460693c49ec0bf5475ef79e40457e6bd) --- .../org/apache/hadoop/hbase/master/MasterRpcServices.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java index 612c731ab31..5fb5f151c86 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java @@ -972,7 +972,10 @@ public class MasterRpcServices extends RSRpcServices GetClusterStatusRequest req) throws ServiceException { GetClusterStatusResponse.Builder response = GetClusterStatusResponse.newBuilder(); try { - master.checkInitialized(); + // We used to check if Master was up at this point but let this call proceed even if + // Master is initializing... else we shut out stuff like hbck2 tool from making progress + // since it queries this method to figure cluster version. hbck2 wants to be able to work + // against Master even if it is 'initializing' so it can do fixup. response.setClusterStatus(ClusterMetricsBuilder.toClusterStatus( master.getClusterMetrics(ClusterMetricsBuilder.toOptions(req.getOptionsList())))); } catch (IOException e) {