Skip to content

Apache Lucene open-source search software

SOLR-1781: ensure we are cleaning up the 'newest' old index directory

Mark Robert Miller645547df3ef6
diff --git a/solr/core/src/java/org/apache/solr/handler/SnapPuller.java b/solr/core/src/java/org/apache/solr/handler/SnapPuller.java
index fd1a91002bf..79638f4ae66 100644
--- a/solr/core/src/java/org/apache/solr/handler/SnapPuller.java
+++ b/solr/core/src/java/org/apache/solr/handler/SnapPuller.java
@@ -324,7 +324,8 @@ public class SnapPuller {
successfulInstall = false;
boolean deleteTmpIdxDir = true;
- final File indexDir = new File(core.getIndexDir());
+ // make sure it's the newest known index dir...
+ final File indexDir = new File(core.getNewIndexDir());
Directory oldDirectory = null;
try {
downloadIndexFiles(isFullCopyNeeded, tmpIndexDir, latestGeneration);