diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index e4cc0d2eb93..1235a429653 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -163,6 +163,9 @@ Bug Fixes
* SOLR-482: Provide more exception handling in CSVLoader (gsingers)
+* SOLR-2320: Fixed ReplicationHandler detail reporting for masters
+ (hossman)
+
Other Changes
----------------------
diff --git a/solr/src/java/org/apache/solr/handler/ReplicationHandler.java b/solr/src/java/org/apache/solr/handler/ReplicationHandler.java
index d08cdb94cd2..188175a28a2 100644
--- a/solr/src/java/org/apache/solr/handler/ReplicationHandler.java
+++ b/solr/src/java/org/apache/solr/handler/ReplicationHandler.java
@@ -687,12 +687,12 @@ public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAw
LOG.error("Exception while writing replication details: ", e);
}
}
- if (isMaster)
- details.add("master", master);
- if (isSlave && showSlaveDetails)
- details.add("slave", slave);
-
}
+
+ if (isMaster)
+ details.add("master", master);
+ if (isSlave && showSlaveDetails)
+ details.add("slave", slave);
NamedList snapshotStats = snapShootDetails;
if (snapshotStats != null)
diff --git a/solr/src/test-files/solr/conf/solrconfig-repeater.xml b/solr/src/test-files/solr/conf/solrconfig-repeater.xml
new file mode 100644
index 00000000000..4584dfaba45
--- /dev/null
+++ b/solr/src/test-files/solr/conf/solrconfig-repeater.xml
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+ ${tests.luceneMatchVersion:LUCENE_CURRENT}
+
+ ${solr.data.dir:./solr/data}
+
+
+ false
+ 10
+ 32
+ 2147483647
+ 10000
+ 1000
+ 10000
+
+ 1000
+ 10000
+
+ single
+
+
+
+ false
+ 10
+ 32
+ 2147483647
+ 10000
+
+ true
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ commit
+ schema.xml
+
+
+ http://localhost:TEST_PORT/solr/replication
+ 00:00:01
+
+
+
+
+
+
+
+
+ max-age=30, public
+
+
+
+
diff --git a/solr/src/test/org/apache/solr/handler/TestReplicationHandler.java b/solr/src/test/org/apache/solr/handler/TestReplicationHandler.java
index addd3d445e1..b3f68ede013 100644
--- a/solr/src/test/org/apache/solr/handler/TestReplicationHandler.java
+++ b/solr/src/test/org/apache/solr/handler/TestReplicationHandler.java
@@ -25,9 +25,11 @@ import org.apache.lucene.store.SimpleFSDirectory;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.TestDistributedSearch;
import org.apache.solr.client.solrj.SolrServer;
+import org.apache.solr.client.solrj.SolrRequest;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.embedded.JettySolrRunner;
import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer;
+import org.apache.solr.client.solrj.request.QueryRequest;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrDocument;
import org.apache.solr.common.SolrDocumentList;
@@ -42,6 +44,8 @@ import org.junit.Test;
import java.io.*;
import java.net.URL;
+import java.util.Map;
+import java.util.HashMap;
/**
* Test for ReplicationHandler
@@ -53,7 +57,6 @@ public class TestReplicationHandler extends SolrTestCaseJ4 {
private static final String CONF_DIR = "." + File.separator + "solr" + File.separator + "conf" + File.separator;
- private static final String SLAVE_CONFIG = CONF_DIR + "solrconfig-slave.xml";
static JettySolrRunner masterJetty, slaveJetty;
static SolrServer masterClient, slaveClient;
@@ -157,6 +160,80 @@ public class TestReplicationHandler extends SolrTestCaseJ4 {
return res;
}
+ private NamedList