svn merge -c 1575021 from trunk for HDFS-6060. NameNode should not check DataNode layout version

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1576149 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Tsz-wo Sze 2014-03-11 00:12:57 +00:00
parent bb7e14902b
commit a42d3356db
2 changed files with 2 additions and 15 deletions

View File

@ -643,6 +643,8 @@ HDFS-5535 subtasks:
HDFS-6041. Downgrade/Finalize should rename the rollback image instead of HDFS-6041. Downgrade/Finalize should rename the rollback image instead of
purging it. (jing9) purging it. (jing9)
HDFS-6060. NameNode should not check DataNode layout version (brandonli)
Release 2.3.1 - UNRELEASED Release 2.3.1 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -105,7 +105,6 @@ import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifie
import org.apache.hadoop.hdfs.server.blockmanagement.BlockManager; import org.apache.hadoop.hdfs.server.blockmanagement.BlockManager;
import org.apache.hadoop.hdfs.server.common.HdfsServerConstants.NamenodeRole; import org.apache.hadoop.hdfs.server.common.HdfsServerConstants.NamenodeRole;
import org.apache.hadoop.hdfs.server.common.IncorrectVersionException; import org.apache.hadoop.hdfs.server.common.IncorrectVersionException;
import org.apache.hadoop.hdfs.server.datanode.DataNodeLayoutVersion;
import org.apache.hadoop.hdfs.server.namenode.NameNode.OperationCategory; import org.apache.hadoop.hdfs.server.namenode.NameNode.OperationCategory;
import org.apache.hadoop.hdfs.server.namenode.metrics.NameNodeMetrics; import org.apache.hadoop.hdfs.server.namenode.metrics.NameNodeMetrics;
import org.apache.hadoop.hdfs.server.namenode.web.resources.NamenodeWebHdfsMethods; import org.apache.hadoop.hdfs.server.namenode.web.resources.NamenodeWebHdfsMethods;
@ -1097,20 +1096,6 @@ class NameNodeRpcServer implements NamenodeProtocols {
+ " but the expected ID is " + expectedID); + " but the expected ID is " + expectedID);
throw new UnregisteredNodeException(nodeReg); throw new UnregisteredNodeException(nodeReg);
} }
// verify layout version if there is no rolling upgrade.
if (!namesystem.isRollingUpgrade()) {
final int lv = nodeReg.getVersion();
final int expectedLV = nodeReg instanceof NamenodeRegistration?
NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION
: DataNodeLayoutVersion.CURRENT_LAYOUT_VERSION;
if (expectedLV != nodeReg.getVersion()) {
LOG.warn("Layout versions mismatched: the "
+ nodeReg.getClass().getSimpleName() + " LV is " + lv
+ " but the expected LV is " + expectedLV);
throw new UnregisteredNodeException(nodeReg);
}
}
} }