You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2018/04/17 10:05:31 UTC

[7/9] lucene-solr:jira/solr-11833: SOLR-11920: Adding a file exists check before skipping a file for replication

SOLR-11920: Adding a file exists check before skipping a file for replication


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/72ee0f64
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/72ee0f64
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/72ee0f64

Branch: refs/heads/jira/solr-11833
Commit: 72ee0f64d4eaad9f81ff9730ebfbc466548586e4
Parents: a417a2c
Author: Ishan Chattopadhyaya <is...@apache.org>
Authored: Tue Apr 17 10:48:36 2018 +0530
Committer: Ishan Chattopadhyaya <is...@apache.org>
Committed: Tue Apr 17 10:48:36 2018 +0530

----------------------------------------------------------------------
 solr/core/src/java/org/apache/solr/handler/IndexFetcher.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/72ee0f64/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
----------------------------------------------------------------------
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 3c6859b..9fde19c 100644
--- a/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
+++ b/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
@@ -1037,8 +1037,9 @@ public class IndexFetcher {
       boolean alwaysDownload = filesToAlwaysDownloadIfNoChecksums(filename, size, compareResult);
       LOG.debug("Downloading file={} size={} checksum={} alwaysDownload={}", filename, size, file.get(CHECKSUM), alwaysDownload);
       if (!compareResult.equal || downloadCompleteIndex || alwaysDownload) {
-        if (downloadCompleteIndex && doDifferentialCopy && compareResult.equal && compareResult.checkSummed) {
-          File localFile = new File(indexDirPath, filename);
+        File localFile = new File(indexDirPath, filename);
+        if (downloadCompleteIndex && doDifferentialCopy && compareResult.equal && compareResult.checkSummed
+            && localFile.exists()) {
           LOG.info("Don't need to download this file. Local file's path is: {}, checksum is: {}",
               localFile.getAbsolutePath(), file.get(CHECKSUM));
           // A hard link here should survive the eventual directory move, and should be more space efficient as