From bbfc73789fb51bac8638cb67fa3bb363fec369bd Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Mon, 4 Nov 2019 08:59:57 -0800 Subject: [PATCH] HBASE-23247 [hbck2] Schedule SCPs for 'Unknown Servers' (#791) Signed-off-by: Sean Busbey Signed-off-by: Duo Zhang --- .../hbase/procedure2/store/ProcedureStoreTracker.java | 3 +++ .../apache/hadoop/hbase/master/MasterRpcServices.java | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.java b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.java index 9edd8714361..03e2ce3b78f 100644 --- a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.java +++ b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.java @@ -136,6 +136,9 @@ public class ProcedureStoreTracker { node = lookupClosestNode(node, procId); assert node != null : "expected node to update procId=" + procId; assert node.contains(procId) : "expected procId=" + procId + " in the node"; + if (node == null) { + throw new NullPointerException("pid=" + procId); + } node.insertOrUpdate(procId); trackProcIds(procId); return node; 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 06a99fa5432..383ebcb620e 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 @@ -20,6 +20,7 @@ package org.apache.hadoop.hbase.master; import static org.apache.hadoop.hbase.master.MasterWalManager.META_FILTER; +import java.io.FileNotFoundException; import java.io.IOException; import java.net.BindException; import java.net.InetAddress; @@ -2814,7 +2815,14 @@ public class MasterRpcServices extends RSRpcServices AbstractFSWALProvider.getWALDirectoryName(serverName.toString())); Path splitDir = logDir.suffix(AbstractFSWALProvider.SPLITTING_EXT); Path checkDir = master.getFileSystem().exists(splitDir) ? splitDir : logDir; - return master.getFileSystem().listStatus(checkDir, META_FILTER).length > 0; + try { + return master.getFileSystem().listStatus(checkDir, META_FILTER).length > 0; + } catch (FileNotFoundException fnfe) { + // If no files, then we don't contain metas; was failing schedule of + // SCP because this was FNFE'ing when no server dirs ('Unknown Server'). + LOG.warn("No dir for WALs for {}; continuing", serverName.toString()); + return false; + } } private boolean shouldSubmitSCP(ServerName serverName) {