From 718d1a8001adb6f0f8837e35954cb51600cebc3c Mon Sep 17 00:00:00 2001 From: Erick Erickson Date: Mon, 11 Nov 2013 23:27:33 +0000 Subject: [PATCH] SOLR-3397: Insure that replication and SolrCloud are compatible. Actually, just log a warning if SolrCloud is detected and master or slave is configured in solrconfig.xml git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1540881 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 3 +++ .../java/org/apache/solr/handler/ReplicationHandler.java | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 93139522ba4..93043884ae3 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -209,6 +209,9 @@ Other Changes * SOLR-5401: SolrResourceLoader logs a warning if a deprecated (factory) class is used in schema or config. (Uwe Schindler) + +* SOLR-3397: Warn if master or slave replication is enabled in SolrCloud mode. (Erick + Erickson) ================== 4.5.1 ================== diff --git a/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java b/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java index 3590ee6318c..854d7b09da8 100644 --- a/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java @@ -861,6 +861,14 @@ public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAw } NamedList master = (NamedList) initArgs.get("master"); boolean enableMaster = isEnabled( master ); + + if (enableMaster || enableSlave) { + if (core.getCoreDescriptor().getCoreContainer().getZkController() != null) { + LOG.warn("SolrCloud is enabled for core " + core.getName() + " but so is old-style replication. Make sure you" + + " intend this behavior, it usually indicates a mis-configuration. Master setting is " + + Boolean.toString(enableMaster) + " and slave setting is " + Boolean.toString(enableSlave)); + } + } if (!enableSlave && !enableMaster) { enableMaster = true;