neils-dev commented on code in PR #3741:
URL: https://github.com/apache/ozone/pull/3741#discussion_r1122608079
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/HddsVolume.java:
##########
@@ -326,6 +345,70 @@ public void createDbStore(MutableVolumeSet dbVolumeSet)
throws IOException {
}
}
+ /**
+ * Ensure that volume is initialized properly with
+ * cleanup path. Should disk be re-inserted into
+ * cluster, cleanup path should already be on
+ * disk. This method syncs the HddsVolume
+ * with the path on disk.
+ *
+ * @param id clusterId or scmId
+ */
+ public void checkTmpDirPaths(String id) {
Review Comment:
@xBis7 , we can remove the need for the `checkTmpDir` methods in the
`HddsVolume` with a few changes that cleanup the code and also resolves this
issue.
1.) remove `HddsVolume.checkTmpPaths`
2.) remove `checkCleanupDirs `method and calls in `StorageVolumeUtil`
3.) in `HddsVolume.createTmpPath` get the `id` from a call to new`
HddsVolume` method,
`private String getIdDir() `that returns versions id : `return
VersionedDatanodeFeatures.ScmHA.chooseContainerPathID(this, getClusterID() ==
null ? "" : getClusterID());`
4.) In `keyValueContainerUtil.getLeftovers` and
`keyValueContainerUtil.moveToTmpDirectory` call `createDeleteServiceDir
`instead of `checkTmpPaths`. The `createDeleteServiceDir` will check whether
the path exists in hddsvolume intstance or on disk as we want it to.
With the above changes, the code is simplified in the datanode start
`VersionEndpointTask`, we no longer need the checkTmpPaths, it takes into
account the volume path layout for different versions (scmid, clusterid) and it
seems to pass all the unit tests. I'll supply you with the diff. Note the
unit test failures in the current CI workflow.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]