[ https://issues.apache.org/jira/browse/HDDS-2694?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marton Elek updated HDDS-2694: ------------------------------ Target Version/s: 0.7.0 (was: 0.6.0) > HddsVolume#readVersionFile fails when reading older versions > ------------------------------------------------------------ > > Key: HDDS-2694 > URL: https://issues.apache.org/jira/browse/HDDS-2694 > Project: Hadoop Distributed Data Store > Issue Type: Improvement > Components: Ozone Datanode > Reporter: Attila Doroszlai > Assignee: Aravindan Vijayan > Priority: Major > Labels: Triaged, 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.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org