HDFS-3169. TestFsck should test multiple -move operations in a row. Contributed by Colin Patrick McCabe
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1327776 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
54e61ffdc0
commit
4550627cab
@ -393,6 +393,9 @@ Release 2.0.0 - UNRELEASED
|
|||||||
HDFS-3206. Miscellaneous xml cleanups for OEV.
|
HDFS-3206. Miscellaneous xml cleanups for OEV.
|
||||||
(Colin Patrick McCabe via eli)
|
(Colin Patrick McCabe via eli)
|
||||||
|
|
||||||
|
HDFS-3169. TestFsck should test multiple -move operations in a row.
|
||||||
|
(Colin Patrick McCabe via eli)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
HDFS-3024. Improve performance of stringification in addStoredBlock (todd)
|
HDFS-3024. Improve performance of stringification in addStoredBlock (todd)
|
||||||
|
@ -228,6 +228,7 @@ public Object run() throws Exception {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testFsckMoveAndDelete() throws Exception {
|
public void testFsckMoveAndDelete() throws Exception {
|
||||||
|
final int MAX_MOVE_TRIES = 5;
|
||||||
DFSTestUtil util = new DFSTestUtil("TestFsck", 5, 3, 8*1024);
|
DFSTestUtil util = new DFSTestUtil("TestFsck", 5, 3, 8*1024);
|
||||||
MiniDFSCluster cluster = null;
|
MiniDFSCluster cluster = null;
|
||||||
FileSystem fs = null;
|
FileSystem fs = null;
|
||||||
@ -269,17 +270,19 @@ public void testFsckMoveAndDelete() throws Exception {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// After a fsck -move, the corrupted file should still exist.
|
// After a fsck -move, the corrupted file should still exist.
|
||||||
outStr = runFsck(conf, 1, true, "/", "-move" );
|
for (int i = 0; i < MAX_MOVE_TRIES; i++) {
|
||||||
assertTrue(outStr.contains(NamenodeFsck.CORRUPT_STATUS));
|
outStr = runFsck(conf, 1, true, "/", "-move" );
|
||||||
String[] newFileNames = util.getFileNames(topDir);
|
assertTrue(outStr.contains(NamenodeFsck.CORRUPT_STATUS));
|
||||||
boolean found = false;
|
String[] newFileNames = util.getFileNames(topDir);
|
||||||
for (String f : newFileNames) {
|
boolean found = false;
|
||||||
if (f.equals(corruptFileName)) {
|
for (String f : newFileNames) {
|
||||||
found = true;
|
if (f.equals(corruptFileName)) {
|
||||||
break;
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
assertTrue(found);
|
||||||
}
|
}
|
||||||
assertTrue(found);
|
|
||||||
|
|
||||||
// Fix the filesystem by moving corrupted files to lost+found
|
// Fix the filesystem by moving corrupted files to lost+found
|
||||||
outStr = runFsck(conf, 1, true, "/", "-move", "-delete");
|
outStr = runFsck(conf, 1, true, "/", "-move", "-delete");
|
||||||
|
Loading…
Reference in New Issue
Block a user