761417898 commented on code in PR #15676:
URL: https://github.com/apache/iotdb/pull/15676#discussion_r2166404093


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/LoadTsFileManager.java:
##########
@@ -212,13 +212,25 @@ public void writeToDataRegion(DataRegion dataRegion, 
LoadTsFilePieceNode pieceNo
           uuid2WriterManager.computeIfAbsent(
               uuid,
               o -> {
-                try {
-                  return new TsFileWriterManager(new File(getNextFolder(), 
uuid));
-                } catch (DiskSpaceInsufficientException e) {
-                  exception.set(e);
-                  return null;
+                String folder = null;
+                for (int retryTimes = 0; retryTimes <= 1; retryTimes++) {
+                  try {
+                    folder = getNextFolder();
+                    return new TsFileWriterManager(new File(folder, uuid));
+                  } catch (DiskSpaceInsufficientException e) {
+                    exception.set(e);
+                    return null;
+                  } catch (Exception ignored) {
+                    synchronized (FOLDER_MANAGER) {
+                      FOLDER_MANAGER
+                          .get()
+                          .updateFolderState(folder, 
FolderManager.FolderState.ABNORMAL);
+                    }
+                  }
                 }
+                return null;
               });

Review Comment:
   `public <T, E extends Exception> T getNextWithRetry(ThrowingFunction<String, 
T, E> folderConsumer)`



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