ChenSammi commented on code in PR #3392:
URL: https://github.com/apache/ozone/pull/3392#discussion_r871971774
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/HddsVolume.java:
##########
@@ -214,28 +223,32 @@ public void loadDbStore() throws IOException {
}
dbParentDir = storageIdDir;
+ dbLoaded.set(true);
+ LOG.info("SchemaV3 db is loaded at {} for volume {}", containerDBPath,
+ getStorageID());
}
/**
* Pick a DbVolume for HddsVolume and init db instance.
* Use the HddsVolume directly if no DbVolume found.
* @param dbVolumeSet
*/
- public void createDbStore(MutableVolumeSet dbVolumeSet)
- throws IOException {
+ public void createDbStore(MutableVolumeSet dbVolumeSet) throws IOException {
DbVolume chosenDbVolume = null;
File clusterIdDir;
+ String workingDir = getWorkingDir() == null ? getClusterID() :
Review Comment:
You are right. workingDir != null means we have formatted the volume this
time DN starts, otherwise vice versa.
loadDbStore will be called only when schema V3 is finalized. So, workingDir
will definitely be the clusterID. There is no doubt of that. Scan will
introduce unnecessary complexity. That's why we persist chunks path and
metadata path in container file. One solution we can consider, is persisting
the DB path in HddsVolume version file.
--
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]