You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Ethan Rose (Jira)" <ji...@apache.org> on 2023/02/15 17:59:00 UTC

[jira] [Resolved] (HDDS-2694) HddsVolume#readVersionFile fails when reading older versions

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

Ethan Rose resolved HDDS-2694.
------------------------------
    Resolution: Fixed

This method is no longer present in {{HddsVolumeUtil}} and we do upgrade/downgrade testing as part of CI which would catch any incompatibilities. This was likely resolved as part of the upgrade framework so I'm resolving the issue.

> 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
>            Assignee: Aravindan Vijayan
>            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: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org