HDFS-12605. [READ] TestNameNodeProvidedImplementation#testProvidedDatanodeFailures fails after rebase

This commit is contained in:
Virajith Jalaparti 2017-10-18 13:53:11 -07:00 committed by Chris Douglas
parent 17052c4aff
commit d6a9a89973
2 changed files with 15 additions and 3 deletions

View File

@ -489,6 +489,18 @@ void injectStorage(DatanodeStorageInfo s) {
synchronized (storageMap) {
DatanodeStorageInfo storage = storageMap.get(s.getStorageID());
if (null == storage) {
LOG.info("Adding new storage ID {} for DN {}", s.getStorageID(),
getXferAddr());
DFSTopologyNodeImpl parent = null;
if (getParent() instanceof DFSTopologyNodeImpl) {
parent = (DFSTopologyNodeImpl) getParent();
}
StorageType type = s.getStorageType();
if (!hasStorageType(type) && parent != null) {
// we are about to add a type this node currently does not have,
// inform the parent that a new type is added to this datanode
parent.childAddStorage(getName(), type);
}
storageMap.put(s.getStorageID(), s);
} else {
assert storage == s : "found " + storage + " expected " + s;

View File

@ -482,12 +482,12 @@ public void testProvidedDatanodeFailures() throws Exception {
dnInfos[0].getDatanodeUuid());
// stop the 2nd provided datanode
cluster.stopDataNode(1);
MiniDFSCluster.DataNodeProperties providedDNProperties2 =
cluster.stopDataNode(0);
// make NameNode detect that datanode is down
BlockManagerTestUtil.noticeDeadDatanode(
cluster.getNameNode(),
providedDatanode2.getDatanodeId().getXferAddr());
getAndCheckBlockLocations(client, filename, 0);
//restart the provided datanode