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
This commit is contained in:
Erick Erickson 2013-11-11 23:27:33 +00:00
parent fc39ef0c24
commit 718d1a8001
2 changed files with 11 additions and 0 deletions

View File

@ -209,6 +209,9 @@ Other Changes
* SOLR-5401: SolrResourceLoader logs a warning if a deprecated (factory) class * SOLR-5401: SolrResourceLoader logs a warning if a deprecated (factory) class
is used in schema or config. (Uwe Schindler) 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 ================== ================== 4.5.1 ==================

View File

@ -861,6 +861,14 @@ public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAw
} }
NamedList master = (NamedList) initArgs.get("master"); NamedList master = (NamedList) initArgs.get("master");
boolean enableMaster = isEnabled( 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) { if (!enableSlave && !enableMaster) {
enableMaster = true; enableMaster = true;