HBASE-23247 [hbck2] Schedule SCPs for 'Unknown Servers' (#791)

Signed-off-by: Sean Busbey <busbey@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
Michael Stack 2019-11-04 08:59:57 -08:00 committed by stack
parent c8c8eef0d4
commit 4f39b93a34
2 changed files with 12 additions and 1 deletions

View File

@ -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;

View File

@ -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;
@ -2780,7 +2781,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) {