dannytbecker commented on code in PR #6018:
URL: https://github.com/apache/hadoop/pull/6018#discussion_r1319177733


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/BootstrapStandby.java:
##########
@@ -405,8 +423,14 @@ private boolean checkLogsAvailableForRead(FSImage image, 
long imageTxId,
     }
   }
 
-  private boolean checkLayoutVersion(NamespaceInfo nsInfo) throws IOException {
-    return (nsInfo.getLayoutVersion() == 
HdfsServerConstants.NAMENODE_LAYOUT_VERSION);
+  private boolean checkLayoutVersion(NamespaceInfo nsInfo, boolean 
isRollingUpgrade) {
+    if (isRollingUpgrade) {
+      // During a rolling upgrade the service layout versions may be different,
+      // but we should check that the layout version being sent is compatible
+      return nsInfo.getLayoutVersion() <=
+          HdfsServerConstants.MINIMUM_COMPATIBLE_NAMENODE_LAYOUT_VERSION;

Review Comment:
   The version numbers are negative so the 
`HdfsServerConstants.MINIMUM_COMPATIBLE_NAMENODE_LAYOUT_VERSION` is -61. We 
want the nsInfo's layout version to be a "higher" version than the minimum 
which is -61. So we need to use `<=` because a "higher" version is a lower 
negative like -67. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to