jt2594838 commented on a change in pull request #460:
URL: https://github.com/apache/iotdb/pull/460#discussion_r537402666



##########
File path: 
server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java
##########
@@ -585,20 +555,34 @@ public void removeModFile() throws IOException {
    * Remove the data file, its resource file, and its modification file 
physically.
    */
   public void remove() {
-    file.delete();
-    fsFactory.getFile(file.getPath() + RESOURCE_SUFFIX).delete();
-    fsFactory.getFile(file.getPath() + ModificationFile.FILE_SUFFIX).delete();
+    try {
+      Files.deleteIfExists(file.toPath());
+    } catch (IOException e) {
+      logger.warn("TsFile {} cannot be deleted: {}", file, e.getMessage());

Review comment:
       This will break the code structure of many callers, and they can do 
nothing more than logging it.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to