Repository: hadoop Updated Branches: refs/heads/branch-2 165abe6c4 -> 57e0c735f refs/heads/branch-2.7 f50f889c1 -> 0c48c17ae refs/heads/branch-2.7.2 4e8799fff -> c62d42cd8 refs/heads/trunk 0348e769a -> 9f256d1d7
HDFS-9426. Rollingupgrade finalization is not backward compatible (Contributed by Kihwal Lee) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/c62d42cd Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/c62d42cd Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/c62d42cd Branch: refs/heads/branch-2.7.2 Commit: c62d42cd8bb09a5ffc0c5eefa2d87913e71b9e7e Parents: 4e8799f Author: Vinayakumar B <vinayakum...@apache.org> Authored: Thu Nov 26 09:33:21 2015 +0530 Committer: Vinayakumar B <vinayakum...@apache.org> Committed: Thu Nov 26 09:33:21 2015 +0530 ---------------------------------------------------------------------- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../DatanodeProtocolClientSideTranslatorPB.java | 6 +++++- .../DatanodeProtocolServerSideTranslatorPB.java | 12 ++++++++++-- .../hadoop-hdfs/src/main/proto/DatanodeProtocol.proto | 1 + 4 files changed, 19 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/c62d42cd/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index d2e1b7d..4fefe52 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -95,6 +95,9 @@ Release 2.7.2 - 2015-11-11 HDFS-9413. getContentSummary() on standby should throw StandbyException. (Brahma Reddy Battula via mingma) + HDFS-9426. Rollingupgrade finalization is not backward compatible + (Kihwal Lee via vinayakumarb) + Release 2.7.1 - 2015-07-06 INCOMPATIBLE CHANGES http://git-wip-us.apache.org/repos/asf/hadoop/blob/c62d42cd/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/DatanodeProtocolClientSideTranslatorPB.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/DatanodeProtocolClientSideTranslatorPB.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/DatanodeProtocolClientSideTranslatorPB.java index 825e835..86422e6 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/DatanodeProtocolClientSideTranslatorPB.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/DatanodeProtocolClientSideTranslatorPB.java @@ -161,7 +161,11 @@ public class DatanodeProtocolClientSideTranslatorPB implements index++; } RollingUpgradeStatus rollingUpdateStatus = null; - if (resp.hasRollingUpgradeStatus()) { + + // Use v2 semantics if available. + if (resp.hasRollingUpgradeStatusV2()) { + rollingUpdateStatus = PBHelper.convert(resp.getRollingUpgradeStatusV2()); + } else if (resp.hasRollingUpgradeStatus()) { rollingUpdateStatus = PBHelper.convert(resp.getRollingUpgradeStatus()); } return new HeartbeatResponse(cmds, PBHelper.convert(resp.getHaStatus()), http://git-wip-us.apache.org/repos/asf/hadoop/blob/c62d42cd/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/DatanodeProtocolServerSideTranslatorPB.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/DatanodeProtocolServerSideTranslatorPB.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/DatanodeProtocolServerSideTranslatorPB.java index 873eb6d..ca9e4df 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/DatanodeProtocolServerSideTranslatorPB.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/DatanodeProtocolServerSideTranslatorPB.java @@ -46,6 +46,7 @@ import org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.StorageBlock import org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.StorageReceivedDeletedBlocksProto; import org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.DatanodeIDProto; import org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.LocatedBlockProto; +import org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.RollingUpgradeStatusProto; import org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.VersionRequestProto; import org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.VersionResponseProto; import org.apache.hadoop.hdfs.server.protocol.DatanodeCommand; @@ -132,8 +133,15 @@ public class DatanodeProtocolServerSideTranslatorPB implements RollingUpgradeStatus rollingUpdateStatus = response .getRollingUpdateStatus(); if (rollingUpdateStatus != null) { - builder.setRollingUpgradeStatus(PBHelper - .convertRollingUpgradeStatus(rollingUpdateStatus)); + // V2 is always set for newer datanodes. + // To be compatible with older datanodes, V1 is set to null + // if the RU was finalized. + RollingUpgradeStatusProto rus = PBHelper.convertRollingUpgradeStatus( + rollingUpdateStatus); + builder.setRollingUpgradeStatusV2(rus); + if (!rollingUpdateStatus.isFinalized()) { + builder.setRollingUpgradeStatus(rus); + } } return builder.build(); } http://git-wip-us.apache.org/repos/asf/hadoop/blob/c62d42cd/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/DatanodeProtocol.proto ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/DatanodeProtocol.proto b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/DatanodeProtocol.proto index bce5f56..a17d784 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/DatanodeProtocol.proto +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/DatanodeProtocol.proto @@ -217,6 +217,7 @@ message HeartbeatResponseProto { repeated DatanodeCommandProto cmds = 1; // Returned commands can be null required NNHAStatusHeartbeatProto haStatus = 2; optional RollingUpgradeStatusProto rollingUpgradeStatus = 3; + optional RollingUpgradeStatusProto rollingUpgradeStatusV2 = 4; } /**