HDFS-14599. HDFS-12487 breaks test TestDiskBalancer.testDiskBalancerWithFedClusterWithOneNameServiceEmpty. Contributed by He Xiaoqiao.
This commit is contained in:
parent
041e0c0564
commit
4a212242d9
|
@ -906,8 +906,8 @@ public class DiskBalancer {
|
||||||
try {
|
try {
|
||||||
ExtendedBlock block = iter.nextBlock();
|
ExtendedBlock block = iter.nextBlock();
|
||||||
if(null == block){
|
if(null == block){
|
||||||
LOG.info("NextBlock call returned null.No valid block to copy. {}",
|
LOG.info("NextBlock call returned null. No valid block to copy. {}",
|
||||||
item.toJson());
|
item.toJson());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// A valid block is a finalized block, we iterate until we get
|
// A valid block is a finalized block, we iterate until we get
|
||||||
|
@ -923,13 +923,11 @@ public class DiskBalancer {
|
||||||
item.incErrorCount();
|
item.incErrorCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.getErrorCount() >= getMaxError(item)) {
|
if (item.getErrorCount() >= getMaxError(item)) {
|
||||||
item.setErrMsg("Error count exceeded.");
|
item.setErrMsg("Error count exceeded.");
|
||||||
LOG.info("Maximum error count exceeded. Error count: {} Max error:{} ",
|
LOG.info("Maximum error count exceeded. Error count: {} Max error:{} ",
|
||||||
item.getErrorCount(), item.getMaxDiskErrors());
|
item.getErrorCount(), item.getMaxDiskErrors());
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -316,14 +316,12 @@ public class TestDiskBalancer {
|
||||||
final Path filePath = new Path(fileName);
|
final Path filePath = new Path(fileName);
|
||||||
long fileLen = blockCount * blockSize;
|
long fileLen = blockCount * blockSize;
|
||||||
|
|
||||||
|
|
||||||
//Writing data only to one nameservice.
|
//Writing data only to one nameservice.
|
||||||
FileSystem fs = cluster.getFileSystem(0);
|
FileSystem fs = cluster.getFileSystem(0);
|
||||||
TestBalancer.createFile(cluster, filePath, fileLen, (short) 1,
|
TestBalancer.createFile(cluster, filePath, fileLen, (short) 1,
|
||||||
0);
|
0);
|
||||||
DFSTestUtil.waitReplication(fs, filePath, (short) 1);
|
DFSTestUtil.waitReplication(fs, filePath, (short) 1);
|
||||||
|
|
||||||
|
|
||||||
GenericTestUtils.LogCapturer logCapturer = GenericTestUtils.LogCapturer
|
GenericTestUtils.LogCapturer logCapturer = GenericTestUtils.LogCapturer
|
||||||
.captureLogs(DiskBalancer.LOG);
|
.captureLogs(DiskBalancer.LOG);
|
||||||
|
|
||||||
|
@ -334,15 +332,14 @@ public class TestDiskBalancer {
|
||||||
NodePlan plan = dataMover.generatePlan();
|
NodePlan plan = dataMover.generatePlan();
|
||||||
dataMover.executePlan(plan);
|
dataMover.executePlan(plan);
|
||||||
dataMover.verifyPlanExectionDone();
|
dataMover.verifyPlanExectionDone();
|
||||||
//Because here we have one nameservice empty, don't check
|
// Because here we have one nameservice empty, don't check blockPoolCount.
|
||||||
// blockPoolCount.
|
|
||||||
dataMover.verifyAllVolumesHaveData(false);
|
dataMover.verifyAllVolumesHaveData(false);
|
||||||
} finally {
|
} finally {
|
||||||
Assert.assertTrue(logCapturer.getOutput().contains("There are no " +
|
String logOut = logCapturer.getOutput();
|
||||||
"blocks in the blockPool"));
|
Assert.assertTrue("Wrong log: " + logOut, logOut.contains(
|
||||||
|
"NextBlock call returned null. No valid block to copy."));
|
||||||
cluster.shutdown();
|
cluster.shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue