Skip to content

Apache Lucene open-source search software

SOLR-1983 SOLR-2156: set replication flags and cleanup

Yonik Seeley5d8790eb8522
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 815b140524b..5022a1ed447 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -653,6 +653,11 @@ Bug Fixes
* SOLR-2261: fix velocity template layout.vm that referred to an older
version of jquery. (Eric Pugh via rmuir)
+* SOLR-1983: snappuller fails when modifiedConfFiles is not empty and
+ full copy of index is needed. (Alexander Kanarsky via yonik)
+
+* SOLR-2156: SnapPuller fails to clean Old Index Directories on Full Copy
+ (Jayendra Patil via yonik)
Other Changes
----------------------
diff --git a/solr/src/java/org/apache/solr/handler/SnapPuller.java b/solr/src/java/org/apache/solr/handler/SnapPuller.java
index 88ac16671cf..b93d34f389b 100644
--- a/solr/src/java/org/apache/solr/handler/SnapPuller.java
+++ b/solr/src/java/org/apache/solr/handler/SnapPuller.java
@@ -300,15 +300,17 @@ public class SnapPuller {
isFullCopyNeeded = true;
successfulInstall = false;
boolean deleteTmpIdxDir = true;
+ File indexDir = null ;
try {
- File indexDir = new File(core.getIndexDir());
+ indexDir = new File(core.getIndexDir());
downloadIndexFiles(isFullCopyNeeded, tmpIndexDir, latestVersion);
LOG.info("Total time taken for download : " + ((System.currentTimeMillis() - replicationStartTime) / 1000) + " secs");
Collection<Map<String, Object>> modifiedConfFiles = getModifiedConfFiles(confFilesToDownload);
if (!modifiedConfFiles.isEmpty()) {
downloadConfFiles(confFilesToDownload, latestVersion);
if (isFullCopyNeeded) {
- modifyIndexProps(tmpIndexDir.getName());
+ successfulInstall = modifyIndexProps(tmpIndexDir.getName());
+ deleteTmpIdxDir = false;
} else {
successfulInstall = copyIndexFiles(tmpIndexDir, indexDir);
}
@@ -339,7 +341,8 @@ public class SnapPuller {
} catch (Exception e) {
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Index fetch failed : ", e);
} finally {
- if(deleteTmpIdxDir) delTree(tmpIndexDir);
+ if (deleteTmpIdxDir) delTree(tmpIndexDir);
+ else delTree(indexDir);
}
return successfulInstall;
} finally {