Skip to content

Apache Lucene open-source search software

LUCENE-8149: NRTCachingDirectory does not need to preemptively delete segment files and generate exceptions

Erick Erickson4bd49726c141
diff --git a/lucene/core/src/java/org/apache/lucene/store/NRTCachingDirectory.java b/lucene/core/src/java/org/apache/lucene/store/NRTCachingDirectory.java
index c2b071ba234..696fafea2c4 100644
--- a/lucene/core/src/java/org/apache/lucene/store/NRTCachingDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/NRTCachingDirectory.java
@@ -142,18 +142,8 @@ public class NRTCachingDirectory extends FilterDirectory implements Accountable
if (VERBOSE) {
System.out.println(" to cache");
}
- try {
- in.deleteFile(name);
- } catch (IOException ioe) {
- // This is fine: file may not exist
- }
return cache.createOutput(name, context);
} else {
- try {
- cache.deleteFile(name);
- } catch (IOException ioe) {
- // This is fine: file may not exist
- }
return in.createOutput(name, context);
}
}
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 94d3588b4f7..487ee5f031b 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -192,6 +192,9 @@ Optimizations
* SOLR-11711: Fixed distributed processing of facet.field/facet.pivot sub requests to prevent requesting
unneccessary and excessive '0' count terms from each shard (Houston Putman via hossman)
+* LUCENE-8149: NRTCachingDirectory does not need to preemptively delete segment files and generate exceptions
+ (Erick Erickson)
+
Other Changes
----------------------