diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index d5317a585c9..f9fa09de810 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -113,6 +113,9 @@ Bug Fixes
* SOLR-3611: We do not show ZooKeeper data in the UI for a node that has children.
(Mark Miller)
+* SOLR-3789: Fix bug in SnapPuller that caused "internal" compression to fail.
+ (siren)
+
Other Changes
----------------------
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 6b9291fcecd..42806d07786 100644
--- a/solr/core/src/java/org/apache/solr/handler/SnapPuller.java
+++ b/solr/core/src/java/org/apache/solr/handler/SnapPuller.java
@@ -1151,7 +1151,7 @@ public class SnapPuller {
params.set(FILE, fileName);
}
if (useInternal) {
- params.set(COMPRESSION, "internal");
+ params.set(COMPRESSION, "true");
}
//use checksum
if (this.includeChecksum) {
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-slave.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-slave.xml
index 5ee5459212a..0ff8f87680d 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-slave.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-slave.xml
@@ -53,7 +53,8 @@
http://localhost:TEST_PORT/solr
00:00:01
-
+ COMPRESSION
+
diff --git a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
index 88bf5e7b26b..d3b254685bc 100644
--- a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
+++ b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
@@ -41,7 +41,6 @@ import org.apache.lucene.store.SimpleFSDirectory;
import org.apache.lucene.util.LuceneTestCase.Slow;
import org.apache.solr.BaseDistributedSearchTestCase;
import org.apache.solr.SolrTestCaseJ4;
-import org.apache.solr.TestDistributedSearch;
import org.apache.solr.client.solrj.SolrServer;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.embedded.JettySolrRunner;
@@ -57,7 +56,6 @@ import org.apache.solr.common.util.SimpleOrderedMap;
import org.apache.solr.util.AbstractSolrTestCase;
import org.junit.AfterClass;
import org.junit.BeforeClass;
-import org.junit.Ignore;
/**
* Test for ReplicationHandler
@@ -928,13 +926,13 @@ public class TestReplicationHandler extends SolrTestCaseJ4 {
/* character copy of file using UTF-8 */
private static void copyFile(File src, File dst) throws IOException {
- copyFile(src, dst, null);
+ copyFile(src, dst, null, false);
}
/**
* character copy of file using UTF-8. If port is non-null, will be substituted any time "TEST_PORT" is found.
*/
- private static void copyFile(File src, File dst, Integer port) throws IOException {
+ private static void copyFile(File src, File dst, Integer port, boolean internalCompression) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(src), "UTF-8"));
Writer out = new OutputStreamWriter(new FileOutputStream(dst), "UTF-8");
@@ -942,6 +940,9 @@ public class TestReplicationHandler extends SolrTestCaseJ4 {
if (null != port)
line = line.replace("TEST_PORT", port.toString());
+
+ line = line.replace("COMPRESSION", internalCompression?"internal":"false");
+
out.write(line);
}
in.close();
@@ -1020,10 +1021,9 @@ public class TestReplicationHandler extends SolrTestCaseJ4 {
public void copyConfigFile(String srcFile, String destFile)
throws IOException {
-
copyFile(getFile(srcFile),
new File(confDir, destFile),
- testPort);
+ testPort, random().nextBoolean());
}
}