StevenLuMT commented on code in PR #3762:
URL: https://github.com/apache/bookkeeper/pull/3762#discussion_r1095460266


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileSystemUpgrade.java:
##########
@@ -99,7 +100,13 @@ public boolean accept(File dir, String name) {
     private static List<File> getAllDirectories(ServerConfiguration conf) {
         List<File> dirs = new ArrayList<>();
         dirs.addAll(Lists.newArrayList(conf.getJournalDirs()));
-        Collections.addAll(dirs, conf.getLedgerDirs());
+        final File[] ledgerDirs = conf.getLedgerDirs();
+        final File[] indexDirs = conf.getIndexDirs();
+        if (indexDirs != null
+                && 
!Arrays.asList(indexDirs).equals(Arrays.asList(ledgerDirs))) {

Review Comment:
   ok, LGTM, let Enrico or others review it again @wenbingshen 
   
   > If you are worried about the existence of duplicate directories, resulting 
in multiple executions, then we can use the Set collection, but the original 
implementation did not consider whether JournalDirs and LedgerDirs are 
duplicated? Also, 1 vs 1 doesn't make a difference here.
   
   



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

Reply via email to