You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "zhaih (via GitHub)" <gi...@apache.org> on 2023/02/08 00:27:37 UTC

[GitHub] [lucene] zhaih commented on a diff in pull request #12126: Refactor part of IndexFileDeleter and ReplicaFileDeleter into a common utility class

zhaih commented on code in PR #12126:
URL: https://github.com/apache/lucene/pull/12126#discussion_r1099470288


##########
lucene/replicator/src/java/org/apache/lucene/replicator/nrt/CopyJob.java:
##########
@@ -206,7 +206,7 @@ private synchronized void _transferAndCancel(CopyJob prevJob) throws IOException
       if (Node.VERBOSE_FILES) {
         dest.message("remove partial file " + prevJob.current.tmpName);
       }
-      dest.deleter.deleteNewFile(prevJob.current.tmpName);
+      dest.deleter.deleteIfNoRef(prevJob.current.tmpName);

Review Comment:
   Ah I actually want to do it the opposite way, I'm not 100% sure why we need a `deleteNewFile` (force delete) here rather than `deleteIfNoRef` but I don't want to introduce a (possibly) different behavior in this change so I kept it. 
   Altho the `deleteNewFile` is a bit misleading so I changed the name to `forceDeleteFile`



-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org