You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by is...@apache.org on 2018/04/17 05:19:39 UTC
lucene-solr:branch_7x: SOLR-11920: Adding a file exists check before
skipping a file for replication
Repository: lucene-solr
Updated Branches:
refs/heads/branch_7x 0ccd991fa -> d60ecf29d
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/d60ecf29
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/d60ecf29
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/d60ecf29
Branch: refs/heads/branch_7x
Commit: d60ecf29d0b08cd1209b7ebea163a64bfa0fe7ba
Parents: 0ccd991
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:49:27 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/d60ecf29/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