SOLR-8549: start script checks against failed cores as well before attempting to create a core with the same name

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1724680 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Varun Thacker 2016-01-14 20:04:09 +00:00
parent 57d85d8839
commit 40e0c5bf28
2 changed files with 7 additions and 2 deletions

View File

@ -524,6 +524,9 @@ Other Changes
* SOLR-8535: Support forcing define-lucene-javadoc-url to be local (Gregory Chanan)
* SOLR-8549: Solr start script checks for cores which have failed to load as well before attempting to
create a core with the same name (Varun Thacker)
================== 5.4.1 ==================
Bug Fixes

View File

@ -1360,7 +1360,9 @@ public class SolrCLI {
Map<String,Object> existsCheckResult = getJson(coreStatusUrl);
Map<String,Object> status = (Map<String, Object>)existsCheckResult.get("status");
Map<String,Object> coreStatus = (Map<String, Object>)status.get(coreName);
exists = coreStatus != null && coreStatus.containsKey(NAME);
Map<String,Object> failureStatus = (Map<String, Object>)existsCheckResult.get("initFailures");
String errorMsg = (String) failureStatus.get(coreName);
exists = coreStatus != null && coreStatus.containsKey(NAME) || errorMsg != null;
} catch (Exception exc) {
// just ignore it since we're only interested in a positive result here
}
@ -2284,7 +2286,7 @@ public class SolrCLI {
throw new Exception("Failed to create "+collectionName+" using command: "+ Arrays.asList(createArgs));
}
if ("techproducts".equals(exampleName)) {
if ("techproducts".equals(exampleName) && !alreadyExists) {
File exampledocsDir = new File(exampleDir, "exampledocs");
if (!exampledocsDir.isDirectory()) {