HDFS-5984. Fix TestEditLog and TestStandbyCheckpoints. Contributed by jing9
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-5535@1570361 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
55aec006f4
commit
016d3b8171
|
@ -60,3 +60,5 @@ HDFS-5535 subtasks:
|
|||
(Haohui Mai via Arpit Agarwal)
|
||||
|
||||
HDFS-5980. Rollback does not need to load edits. (jing9 via szetszwo)
|
||||
|
||||
HDFS-5984. Fix TestEditLog and TestStandbyCheckpoints. (jing9 via szetszwo)
|
||||
|
|
|
@ -623,10 +623,9 @@ public class FSImage implements Closeable {
|
|||
throw new IOException("Failed to load an FSImage file!");
|
||||
}
|
||||
prog.endPhase(Phase.LOADING_FSIMAGE);
|
||||
long txnsAdvanced = 0;
|
||||
|
||||
if (!rollingRollback) {
|
||||
loadEdits(editStreams, target, startOpt, recovery);
|
||||
long txnsAdvanced = loadEdits(editStreams, target, startOpt, recovery);
|
||||
needToSave |= needsResaveBasedOnStaleCheckpoint(imageFile.getFile(),
|
||||
txnsAdvanced);
|
||||
} else {
|
||||
|
|
|
@ -192,9 +192,9 @@ public class TestStandbyCheckpoints {
|
|||
Thread.sleep(2000);
|
||||
|
||||
// We should make exactly one checkpoint at this new txid.
|
||||
Mockito.verify(spyImage1, Mockito.times(1))
|
||||
.saveNamespace((FSNamesystem) Mockito.anyObject(), NameNodeFile.IMAGE,
|
||||
(Canceler)Mockito.anyObject());
|
||||
Mockito.verify(spyImage1, Mockito.times(1)).saveNamespace(
|
||||
(FSNamesystem) Mockito.anyObject(), Mockito.eq(NameNodeFile.IMAGE),
|
||||
(Canceler) Mockito.anyObject());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -281,9 +281,9 @@ public class TestStandbyCheckpoints {
|
|||
FSImage spyImage1 = NameNodeAdapter.spyOnFsImage(nn1);
|
||||
DelayAnswer answerer = new DelayAnswer(LOG);
|
||||
Mockito.doAnswer(answerer).when(spyImage1)
|
||||
.saveNamespace(Mockito.any(FSNamesystem.class), NameNodeFile.IMAGE,
|
||||
Mockito.any(Canceler.class));
|
||||
|
||||
.saveNamespace(Mockito.any(FSNamesystem.class),
|
||||
Mockito.eq(NameNodeFile.IMAGE), Mockito.any(Canceler.class));
|
||||
|
||||
// Perform some edits and wait for a checkpoint to start on the SBN.
|
||||
doEdits(0, 1000);
|
||||
nn0.getRpcServer().rollEditLog();
|
||||
|
|
Loading…
Reference in New Issue