Copilot commented on code in PR #16869:
URL: https://github.com/apache/iotdb/pull/16869#discussion_r2616008822


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/allocation/AbstractNodeAllocationStrategy.java:
##########
@@ -55,8 +55,13 @@ protected AbstractNodeAllocationStrategy() {
     }
   }
 
-  protected IWALNode createWALNode(String identifier) {
+  protected synchronized IWALNode createWALNode(String identifier) {
     try {
+      if (folderManager == null) {
+        folderManager =
+            new FolderManager(
+                Arrays.asList(commonConfig.getWalDirs()), 
DirectoryStrategyType.SEQUENCE_STRATEGY);
+      }

Review Comment:
   Consider adding a comment explaining why folderManager re-initialization is 
necessary. This would help future developers understand that folderManager can 
be null when the system starts with a full disk, and needs to be lazily 
initialized when disk space becomes available.



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