guihecheng commented on code in PR #3392:
URL: https://github.com/apache/ozone/pull/3392#discussion_r870920283


##########
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:
   This is good, just to confirm my understanding, the newly added `workingDir` 
is assigned a value only during format, so `getWorkingDir() == null` means we 
are doing a `finalizeUpgrade` operation otherwise we are formatting a volume, 
right?
   
   I've got an idea, if `createDbStore` rely on `workingDir` for now instead of 
clusterID, then maybe we should use `workingDir` in `loadDbStore` too?
   For example we could scan for the on-disk working dir when we do 
`initialize()` for a volume and assign a value to `workingDir` if it exists?



-- 
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]

Reply via email to