HDFS-15448. Remove duplicate BlockPoolManager starting when run DataNode. Contriubted by jianghua zhu.

This commit is contained in:
He Xiaoqiao 2020-08-24 21:13:47 +08:00
parent 960fb0aa4f
commit a7830423c5
2 changed files with 16 additions and 1 deletions

View File

@ -2710,7 +2710,11 @@ void closeBlock(ExtendedBlock block, String delHint, String storageUuid,
* If this thread is specifically interrupted, it will stop waiting. * If this thread is specifically interrupted, it will stop waiting.
*/ */
public void runDatanodeDaemon() throws IOException { public void runDatanodeDaemon() throws IOException {
blockPoolManager.startAll();
// Verify that blockPoolManager has been started.
if (!isDatanodeUp()) {
throw new IOException("Failed to instantiate DataNode.");
}
// start dataXceiveServer // start dataXceiveServer
dataXceiverServer.start(); dataXceiverServer.start();

View File

@ -82,6 +82,17 @@ private void stopBPServiceThreads(int numStopThreads, DataNode dn)
dn.getBpOsCount()); dn.getBpOsCount());
} }
@Test
public void testBPServiceState() {
List<DataNode> dataNodes = cluster.getDataNodes();
for (DataNode dataNode : dataNodes) {
List<BPOfferService> bposList = dataNode.getAllBpOs();
for (BPOfferService bpOfferService : bposList) {
assertTrue(bpOfferService.isAlive());
}
}
}
/** /**
* Test BPService Thread Exit * Test BPService Thread Exit
*/ */