guihecheng commented on a change in pull request #477:
URL: https://github.com/apache/ratis/pull/477#discussion_r629188621



##########
File path: 
ratis-server/src/main/java/org/apache/ratis/server/impl/ServerState.java
##########
@@ -104,17 +104,24 @@
     configurationManager = new ConfigurationManager(initialConf);
     LOG.info("{}: {}", getMemberId(), configurationManager);
 
+    boolean storageFound = false;
     List<File> directories = RaftServerConfigKeys.storageDir(prop);
     while (!directories.isEmpty()) {
       // use full uuid string to create a subdirectory
       File dir = chooseStorageDir(directories, 
group.getGroupId().getUuid().toString());
       try {
         storage = new RaftStorageImpl(dir, 
RaftServerConfigKeys.Log.corruptionPolicy(prop));
+        storageFound = true;
         break;
-      } catch (AccessDeniedException e) {
-        directories.remove(dir);
+      } catch (IOException e) {
+        directories.removeIf(d -> d.getAbsolutePath().equals(dir.getParent()));
       }
     }
+
+    if (!storageFound) {
+      throw new IOException("No healthy directories found for RaftStorage");

Review comment:
       @szetszwo ok.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to