[ 
https://issues.apache.org/jira/browse/HDDS-2694?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ethan Rose reopened HDDS-2694:
------------------------------
      Assignee:     (was: Aravindan Vijayan)

Scratch my last comment, I found the code, it just got moved from 
{{HddsVolumeUtil}} to {{StorageVolumeUtil}}.

If we do start using volume layout versions (we don't use them now) this will 
break upgrade/downgrade. We could change the validation to just make sure the 
volume layout version is less than the latest pretty easily. Even if we don't 
fix this right now, CI would catch this in the compat acceptance tests if it 
became a problem, so I don't think it needs critical status though.

> HddsVolume#readVersionFile fails when reading older versions
> ------------------------------------------------------------
>
>                 Key: HDDS-2694
>                 URL: https://issues.apache.org/jira/browse/HDDS-2694
>             Project: Apache Ozone
>          Issue Type: Improvement
>          Components: Ozone Datanode
>            Reporter: Attila Doroszlai
>            Priority: Critical
>              Labels: Triaged, ozone-jira-volunteer, upgrade
>
> {{HddsVolume#layoutVersion}} is a version number, supposed to be used for 
> handling upgrades from older versions.  Currently only one version is 
> defined.  But should a new version be introduced, HddsVolume would fail to 
> read older version file.  This is caused by a check in {{HddsVolumeUtil}} 
> that only considers the latest version as valid:
> {code:title=https://github.com/apache/hadoop-ozone/blob/1d56bc244995e857b842f62d3d1e544ee100bbc1/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/utils/HddsVolumeUtil.java#L137-L153}
>   /**
>    * Returns layOutVersion if it is valid. Throws an exception otherwise.
>    */
>   @VisibleForTesting
>   public static int getLayOutVersion(Properties props, File versionFile) 
> throws
>       InconsistentStorageStateException {
>     String lvStr = getProperty(props, OzoneConsts.LAYOUTVERSION, versionFile);
>     int lv = Integer.parseInt(lvStr);
>     if(DataNodeLayoutVersion.getLatestVersion().getVersion() != lv) {
>       throw new InconsistentStorageStateException("Invalid layOutVersion. " +
>           "Version file has layOutVersion as " + lv + " and latest Datanode " 
> +
>           "layOutVersion is " +
>           DataNodeLayoutVersion.getLatestVersion().getVersion());
>     }
>     return lv;
>   }
> {code}
> I think this should check whether the version number identifies a known 
> {{DataNodeLayoutVersion}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to