You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by tf...@apache.org on 2014/10/03 22:26:37 UTC
svn commit: r1629311 - in /lucene/dev/branches/branch_5x: ./ solr/
solr/CHANGES.txt solr/core/
solr/core/src/java/org/apache/solr/core/SolrConfig.java
solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java
Author: tflobbe
Date: Fri Oct 3 20:26:37 2014
New Revision: 1629311
URL: http://svn.apache.org/r1629311
Log:
SOLR-6587: Correct exception thrown on bad collection configuration in SolrCloud mode
Modified:
lucene/dev/branches/branch_5x/ (props changed)
lucene/dev/branches/branch_5x/solr/ (props changed)
lucene/dev/branches/branch_5x/solr/CHANGES.txt (contents, props changed)
lucene/dev/branches/branch_5x/solr/core/ (props changed)
lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/SolrConfig.java
lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java
Modified: lucene/dev/branches/branch_5x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/CHANGES.txt?rev=1629311&r1=1629310&r2=1629311&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/solr/CHANGES.txt Fri Oct 3 20:26:37 2014
@@ -176,6 +176,8 @@ Bug Fixes
* SOLR-6530: Commits under network partitions can put any node in down state.
(Ramkumar Aiyengar, Alan Woodward, Mark Miller, shalin)
+* SOLR-6587: Misleading exception when creating collections in SolrCloud with bad configuration.
+ (Tomás Fernández Löbbe)
Other Changes
----------------------
Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/SolrConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/SolrConfig.java?rev=1629311&r1=1629310&r2=1629311&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/SolrConfig.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/SolrConfig.java Fri Oct 3 20:26:37 2014
@@ -21,6 +21,7 @@ package org.apache.solr.core;
import org.apache.lucene.index.IndexDeletionPolicy;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.util.Version;
+import org.apache.solr.cloud.ZkSolrResourceLoader;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.SolrException.ErrorCode;
import org.apache.solr.handler.component.SearchComponent;
@@ -144,7 +145,12 @@ public class SolrConfig extends Config {
return new SolrConfig(loader, name, null);
}
catch (Exception e) {
- String resource = loader.getConfigDir() + name;
+ String resource;
+ if (loader instanceof ZkSolrResourceLoader) {
+ resource = name;
+ } else {
+ resource = loader.getConfigDir() + name;
+ }
throw new SolrException(ErrorCode.SERVER_ERROR, "Error loading solr config from " + resource, e);
}
}
Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java?rev=1629311&r1=1629310&r2=1629311&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java Fri Oct 3 20:26:37 2014
@@ -17,9 +17,7 @@ package org.apache.solr.cloud;
* limitations under the License.
*/
-import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.util.LuceneTestCase.Slow;
-import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.ModifiableSolrParams;
@@ -27,8 +25,6 @@ import org.apache.solr.common.util.Named
import org.apache.solr.core.SolrCore;
import org.apache.solr.request.LocalSolrQueryRequest;
import org.apache.solr.request.SolrQueryRequest;
-import org.apache.solr.update.DirectUpdateHandler2;
-import org.apache.solr.util.RefCounted;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -151,12 +147,13 @@ public class BasicZkTest extends Abstrac
// we set the solrconfig to nothing, so this reload should fail
try {
- SolrTestCaseJ4.ignoreException("SolrException");
+ ignoreException("solrconfig.xml");
h.getCoreContainer().reload(h.getCore().getName());
- SolrTestCaseJ4.resetExceptionIgnores();
fail("The reloaded SolrCore did not pick up configs from zookeeper");
} catch(SolrException e) {
-
+ resetExceptionIgnores();
+ assertTrue(e.getMessage().contains("Unable to reload core [collection1]"));
+ assertTrue(e.getCause().getMessage().contains("Error loading solr config from solrconfig.xml"));
}
// test stats call