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/23 04:39:52 UTC
svn commit: r1633735 - in /lucene/dev/branches/lucene_solr_4_10: ./ 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: Thu Oct 23 02:39:52 2014
New Revision: 1633735
URL: http://svn.apache.org/r1633735
Log:
SOLR-6587: Correct exception thrown on bad collection configuration in SolrCloud mode
Modified:
lucene/dev/branches/lucene_solr_4_10/ (props changed)
lucene/dev/branches/lucene_solr_4_10/solr/ (props changed)
lucene/dev/branches/lucene_solr_4_10/solr/CHANGES.txt
lucene/dev/branches/lucene_solr_4_10/solr/core/ (props changed)
lucene/dev/branches/lucene_solr_4_10/solr/core/src/java/org/apache/solr/core/SolrConfig.java
lucene/dev/branches/lucene_solr_4_10/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java
Modified: lucene/dev/branches/lucene_solr_4_10/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_10/solr/CHANGES.txt?rev=1633735&r1=1633734&r2=1633735&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_10/solr/CHANGES.txt (original)
+++ lucene/dev/branches/lucene_solr_4_10/solr/CHANGES.txt Thu Oct 23 02:39:52 2014
@@ -33,6 +33,9 @@ Bug Fixes
* SOLR-6524: Collections left in recovery state after node restart because recovery sleep time
increases exponentially between retries. (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/lucene_solr_4_10/solr/core/src/java/org/apache/solr/core/SolrConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_10/solr/core/src/java/org/apache/solr/core/SolrConfig.java?rev=1633735&r1=1633734&r2=1633735&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_10/solr/core/src/java/org/apache/solr/core/SolrConfig.java (original)
+++ lucene/dev/branches/lucene_solr_4_10/solr/core/src/java/org/apache/solr/core/SolrConfig.java Thu Oct 23 02:39:52 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/lucene_solr_4_10/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_10/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java?rev=1633735&r1=1633734&r2=1633735&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_10/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java (original)
+++ lucene/dev/branches/lucene_solr_4_10/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java Thu Oct 23 02:39:52 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