HDFS-11316. TestDataNodeVolumeFailure#testUnderReplicationAfterVolFailure fails in trunk. Contributed by Yiqun Lin.
(cherry picked from commit 724bb86351
)
This commit is contained in:
parent
952113ebfd
commit
daa532b902
|
@ -413,12 +413,22 @@ public class TestDataNodeVolumeFailure {
|
||||||
DFSTestUtil.createFile(fs, file2, 1024, (short)3, 1L);
|
DFSTestUtil.createFile(fs, file2, 1024, (short)3, 1L);
|
||||||
DFSTestUtil.waitReplication(fs, file2, (short)3);
|
DFSTestUtil.waitReplication(fs, file2, (short)3);
|
||||||
|
|
||||||
// underReplicatedBlocks are due to failed volumes
|
GenericTestUtils.waitFor(new Supplier<Boolean>() {
|
||||||
int underReplicatedBlocks =
|
@Override
|
||||||
BlockManagerTestUtil.checkHeartbeatAndGetUnderReplicatedBlocksCount(
|
public Boolean get() {
|
||||||
cluster.getNamesystem(), bm);
|
// underReplicatedBlocks are due to failed volumes
|
||||||
assertTrue("There is no under replicated block after volume failure",
|
int underReplicatedBlocks = BlockManagerTestUtil
|
||||||
underReplicatedBlocks > 0);
|
.checkHeartbeatAndGetUnderReplicatedBlocksCount(
|
||||||
|
cluster.getNamesystem(), bm);
|
||||||
|
|
||||||
|
if (underReplicatedBlocks > 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
LOG.info("There is no under replicated block after volume failure.");
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}, 500, 60000);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue