HDFS-10920. TestStorageMover#testNoSpaceDisk is failing intermittently. Contributed by Rakesh R
This commit is contained in:
parent
b2618685fb
commit
3972bb3bba
@ -641,8 +641,10 @@ public void testHotWarmColdDirs() throws Exception {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void waitForAllReplicas(int expectedReplicaNum, Path file,
|
private void waitForAllReplicas(int expectedReplicaNum, Path file,
|
||||||
DistributedFileSystem dfs) throws Exception {
|
DistributedFileSystem dfs, int retryCount) throws Exception {
|
||||||
for (int i = 0; i < 5; i++) {
|
LOG.info("Waiting for replicas count " + expectedReplicaNum
|
||||||
|
+ ", file name: " + file);
|
||||||
|
for (int i = 0; i < retryCount; i++) {
|
||||||
LocatedBlocks lbs = dfs.getClient().getLocatedBlocks(file.toString(), 0,
|
LocatedBlocks lbs = dfs.getClient().getLocatedBlocks(file.toString(), 0,
|
||||||
BLOCK_SIZE);
|
BLOCK_SIZE);
|
||||||
LocatedBlock lb = lbs.get(0);
|
LocatedBlock lb = lbs.get(0);
|
||||||
@ -692,7 +694,7 @@ public void testNoSpaceDisk() throws Exception {
|
|||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
final Path p = new Path(pathPolicyMap.hot, "file" + i);
|
final Path p = new Path(pathPolicyMap.hot, "file" + i);
|
||||||
DFSTestUtil.createFile(test.dfs, p, BLOCK_SIZE, replication, 0L);
|
DFSTestUtil.createFile(test.dfs, p, BLOCK_SIZE, replication, 0L);
|
||||||
waitForAllReplicas(replication, p, test.dfs);
|
waitForAllReplicas(replication, p, test.dfs, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
// set all the DISK volume to full
|
// set all the DISK volume to full
|
||||||
@ -707,16 +709,17 @@ public void testNoSpaceDisk() throws Exception {
|
|||||||
final Replication r = test.getReplication(file0);
|
final Replication r = test.getReplication(file0);
|
||||||
final short newReplication = (short) 5;
|
final short newReplication = (short) 5;
|
||||||
test.dfs.setReplication(file0, newReplication);
|
test.dfs.setReplication(file0, newReplication);
|
||||||
Thread.sleep(10000);
|
waitForAllReplicas(newReplication, file0, test.dfs, 10);
|
||||||
test.verifyReplication(file0, r.disk, newReplication - r.disk);
|
test.verifyReplication(file0, r.disk, newReplication - r.disk);
|
||||||
|
|
||||||
// test creating a cold file and then increase replication
|
// test creating a cold file and then increase replication
|
||||||
final Path p = new Path(pathPolicyMap.cold, "foo");
|
final Path p = new Path(pathPolicyMap.cold, "foo");
|
||||||
DFSTestUtil.createFile(test.dfs, p, BLOCK_SIZE, replication, 0L);
|
DFSTestUtil.createFile(test.dfs, p, BLOCK_SIZE, replication, 0L);
|
||||||
|
waitForAllReplicas(replication, p, test.dfs, 10);
|
||||||
test.verifyReplication(p, 0, replication);
|
test.verifyReplication(p, 0, replication);
|
||||||
|
|
||||||
test.dfs.setReplication(p, newReplication);
|
test.dfs.setReplication(p, newReplication);
|
||||||
Thread.sleep(10000);
|
waitForAllReplicas(newReplication, p, test.dfs, 10);
|
||||||
test.verifyReplication(p, 0, newReplication);
|
test.verifyReplication(p, 0, newReplication);
|
||||||
|
|
||||||
//test move a hot file to warm
|
//test move a hot file to warm
|
||||||
@ -750,7 +753,7 @@ public void testNoSpaceArchive() throws Exception {
|
|||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
final Path p = new Path(pathPolicyMap.cold, "file" + i);
|
final Path p = new Path(pathPolicyMap.cold, "file" + i);
|
||||||
DFSTestUtil.createFile(test.dfs, p, BLOCK_SIZE, replication, 0L);
|
DFSTestUtil.createFile(test.dfs, p, BLOCK_SIZE, replication, 0L);
|
||||||
waitForAllReplicas(replication, p, test.dfs);
|
waitForAllReplicas(replication, p, test.dfs, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
// set all the ARCHIVE volume to full
|
// set all the ARCHIVE volume to full
|
||||||
@ -767,7 +770,7 @@ public void testNoSpaceArchive() throws Exception {
|
|||||||
|
|
||||||
final short newReplication = (short) 5;
|
final short newReplication = (short) 5;
|
||||||
test.dfs.setReplication(file0, newReplication);
|
test.dfs.setReplication(file0, newReplication);
|
||||||
Thread.sleep(10000);
|
waitForAllReplicas(r.archive, file0, test.dfs, 10);
|
||||||
|
|
||||||
test.verifyReplication(file0, 0, r.archive);
|
test.verifyReplication(file0, 0, r.archive);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user