xichen01 commented on code in PR #6113:
URL: https://github.com/apache/ozone/pull/6113#discussion_r1540654310
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/HddsVolume.java:
##########
@@ -343,35 +357,41 @@ public void loadDbStore(boolean readOnly) throws
IOException {
File clusterIdDir = new File(dbVolume == null ?
getStorageDir() : dbVolume.getStorageDir(),
getClusterID());
- if (!clusterIdDir.exists()) {
- throw new IOException("Working dir " + clusterIdDir.getAbsolutePath() +
- " not created for HddsVolume: " + getStorageDir().getAbsolutePath());
- }
+ try {
+ if (!clusterIdDir.exists()) {
+ throw new IOException("Working dir " + clusterIdDir.getAbsolutePath() +
+ " not created for HddsVolume: " +
getStorageDir().getAbsolutePath());
+ }
- File storageIdDir = new File(clusterIdDir, getStorageID());
- if (!storageIdDir.exists()) {
- throw new IOException("Db parent dir " + storageIdDir.getAbsolutePath() +
- " not found for HddsVolume: " + getStorageDir().getAbsolutePath());
- }
+ File storageIdDir = new File(clusterIdDir, getStorageID());
+ if (!storageIdDir.exists()) {
+ throw new IOException("Db parent dir " +
storageIdDir.getAbsolutePath() +
+ " not found for HddsVolume: " + getStorageDir().getAbsolutePath());
+ }
- File containerDBFile = new File(storageIdDir, CONTAINER_DB_NAME);
- if (!containerDBFile.exists()) {
- throw new IOException("Db dir " + storageIdDir.getAbsolutePath() +
- " not found for HddsVolume: " + getStorageDir().getAbsolutePath());
- }
+ File containerDBFile = new File(storageIdDir, CONTAINER_DB_NAME);
+ if (!containerDBFile.exists()) {
+ throw new IOException("Db dir " + storageIdDir.getAbsolutePath() +
+ " not found for HddsVolume: " + getStorageDir().getAbsolutePath());
+ }
- String containerDBPath = containerDBFile.getAbsolutePath();
- try {
- initPerDiskDBStore(containerDBPath, getConf(), readOnly);
+ String containerDBPath = containerDBFile.getAbsolutePath();
+ try {
+ initPerDiskDBStore(containerDBPath, getConf(), readOnly);
+ } catch (IOException e) {
+ throw new IOException("Can't init db instance under path "
+ + containerDBPath + " for volume " + getStorageID(), e);
+ }
+
+ dbParentDir = storageIdDir;
+ dbLoaded.set(true);
+ dbLoadFailure.set(false);
+ LOG.info("SchemaV3 db is loaded at {} for volume {}", containerDBPath,
+ getStorageID());
} catch (IOException e) {
- throw new IOException("Can't init db instance under path "
- + containerDBPath + " for volume " + getStorageID(), e);
+ dbLoadFailure.set(true);
Review Comment:
OK, I will
--
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]