HDFS-6032. -rollingUpgrade query hits NPE after the NN restarts. Contributed by Haohui Mai.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-5535@1572801 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e9a17c8ce0
commit
5409908026
@ -120,3 +120,6 @@ HDFS-5535 subtasks:
|
||||
|
||||
HDFS-6029. Secondary NN fails to checkpoint after -rollingUpgrade prepare.
|
||||
(jing9)
|
||||
|
||||
HDFS-6032. -rollingUpgrade query hits NPE after the NN restarts. (Haohui Mai
|
||||
via jing9)
|
||||
|
@ -881,9 +881,12 @@ private void loadFSImage(File imageFile, FSNamesystem target,
|
||||
*/
|
||||
private void loadFSImage(File curFile, MD5Hash expectedMd5,
|
||||
FSNamesystem target, MetaRecoveryContext recovery) throws IOException {
|
||||
// BlockPoolId is required when the FsImageLoader loads the rolling upgrade
|
||||
// information. Make sure the ID is properly set.
|
||||
target.setBlockPoolId(this.getBlockPoolID());
|
||||
|
||||
FSImageFormat.LoaderDelegator loader = FSImageFormat.newLoader(conf, target);
|
||||
loader.load(curFile);
|
||||
target.setBlockPoolId(this.getBlockPoolID());
|
||||
|
||||
// Check that the image digest we loaded matches up with what
|
||||
// we expected
|
||||
|
@ -432,6 +432,32 @@ public void testQuery() throws Exception {
|
||||
}
|
||||
}
|
||||
|
||||
@Test (timeout = 300000)
|
||||
public void testQueryAfterRestart() throws IOException, InterruptedException {
|
||||
final Configuration conf = new Configuration();
|
||||
MiniDFSCluster cluster = null;
|
||||
try {
|
||||
cluster = new MiniDFSCluster.Builder(conf).numDataNodes(0).build();
|
||||
cluster.waitActive();
|
||||
DistributedFileSystem dfs = cluster.getFileSystem();
|
||||
|
||||
dfs.setSafeMode(SafeModeAction.SAFEMODE_ENTER);
|
||||
// start rolling upgrade
|
||||
dfs.rollingUpgrade(RollingUpgradeAction.PREPARE);
|
||||
queryForPreparation(dfs);
|
||||
dfs.setSafeMode(SafeModeAction.SAFEMODE_ENTER);
|
||||
dfs.saveNamespace();
|
||||
dfs.setSafeMode(SafeModeAction.SAFEMODE_LEAVE);
|
||||
|
||||
cluster.restartNameNodes();
|
||||
dfs.rollingUpgrade(RollingUpgradeAction.QUERY);
|
||||
} finally {
|
||||
if (cluster != null) {
|
||||
cluster.shutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test(timeout = 300000)
|
||||
public void testCheckpoint() throws IOException, InterruptedException {
|
||||
final Configuration conf = new Configuration();
|
||||
|
Loading…
Reference in New Issue
Block a user