hongzhi-gao commented on code in PR #18456:
URL: https://github.com/apache/iotdb/pull/18456#discussion_r3772949298


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/node/WALNode.java:
##########
@@ -413,6 +493,7 @@ private void deleteOutdatedFilesAndUpdateMetric() {
       }
       buffer.subtractDiskUsage(deleteFileSize);
       buffer.subtractFileNum(successfullyDeleted.size());
+      removeDeletedWalFilesFromCache(successfullyDeleted);

Review Comment:
   deleteOutdatedFilesAndUpdateMetric() deletes WAL files from disk first, and 
only calls removeDeletedWalFilesFromCache() after the whole loop. Concurrent 
getSortedWalFiles() can still return those files, so a consensus reader may 
open a path that no longer exists.
   
   **Please remove the version from the cache before deleting the file.** 



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