Skip to content

Apache Lucene open-source search software

SOLR-8077: Replication can still cause index corruption.

Mark Robert Millerdfe7af145f3e
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 6fc10c6c397..16f18d08933 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -212,6 +212,8 @@ Bug Fixes
* SOLR-8069: Ensure that only the valid ZooKeeper registered leader can put a replica into Leader
Initiated Recovery. (Mark Miller, Jessica Cheng, Anshum Gupta)
+
+* SOLR-8077: Replication can still cause index corruption. (Mark Miller)
Optimizations
----------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java b/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
index 367e1bdc172..63cab01fab1 100644
--- a/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
+++ b/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
@@ -968,8 +968,11 @@ public class IndexFetcher {
boolean success = false;
try {
if (slowFileExists(indexDir, fname)) {
- LOG.info("Skipping move file - it already exists:" + fname);
- return true;
+ LOG.warn("Cannot complete replication attempt because file already exists:" + fname);
+
+ // we fail - we downloaded the files we need, if we can't move one in, we can't
+ // count on the correct index
+ return false;
}
} catch (IOException e) {
SolrException.log(LOG, "could not check if a file exists", e);