You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sa...@apache.org on 2016/06/17 21:52:54 UTC
[1/2] lucene-solr:branch_5_5: SOLR-8801: /bin/solr create script
always returns exit code 0 when a collection/core already exists
Repository: lucene-solr
Updated Branches:
refs/heads/branch_5_5 e86eb9d1e -> f249b61dc
refs/heads/branch_5x d58bff079 -> 77e7fbbaa
SOLR-8801: /bin/solr create script always returns exit code 0 when a collection/core already exists
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/f249b61d
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/f249b61d
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/f249b61d
Branch: refs/heads/branch_5_5
Commit: f249b61dcb3e36a75bb75115a3fc3c8daa969721
Parents: e86eb9d
Author: Steve Rowe <sa...@apache.org>
Authored: Fri May 20 19:36:39 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Fri Jun 17 17:51:41 2016 -0400
----------------------------------------------------------------------
solr/CHANGES.txt | 3 +++
solr/core/src/java/org/apache/solr/util/SolrCLI.java | 4 ++--
.../src/test/org/apache/solr/cloud/SolrCloudExampleTest.java | 4 ++++
3 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f249b61d/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 75028ce..98696b9 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -71,6 +71,9 @@ Bug Fixes
* SOLR-9116: Race condition causing occasional SolrIndexSearcher leak when SolrCore is reloaded.
(Jessica Cheng Mallet via shalin)
+* SOLR-8801: /bin/solr create script always returns exit code 0 when a collection/core already exists.
+ (Khalid Alharbi, Marius Grama via Steve Rowe)
+
======================= 5.5.1 =======================
Bug Fixes
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f249b61d/solr/core/src/java/org/apache/solr/util/SolrCLI.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/SolrCLI.java b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
index 20f7515..adc7e19 100644
--- a/solr/core/src/java/org/apache/solr/util/SolrCLI.java
+++ b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
@@ -1640,7 +1640,7 @@ public class SolrCLI {
String systemInfoUrl = solrUrl+"admin/info/system";
CloseableHttpClient httpClient = getHttpClient();
- Tool tool = null;
+ ToolBase tool = null;
try {
Map<String, Object> systemInfo = getJson(httpClient, systemInfoUrl, 2, true);
if ("solrcloud".equals(systemInfo.get("mode"))) {
@@ -1648,7 +1648,7 @@ public class SolrCLI {
} else {
tool = new CreateCoreTool(stdout);
}
- tool.runTool(cli);
+ tool.runImpl(cli);
} finally {
closeHttpClient(httpClient);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f249b61d/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java b/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
index 606d066..0562e8d 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
@@ -94,6 +94,10 @@ public class SolrCloudExampleTest extends AbstractFullDistribZkTestBase {
ensureAllReplicasAreActive(testCollectionName, "shard2", 2, 2, 10);
cloudClient.setDefaultCollection(testCollectionName);
+ int invalidToolExitStatus = 1;
+ assertEquals("Collection '" + testCollectionName + "' created even though it already existed",
+ invalidToolExitStatus, tool.runTool(cli));
+
// now index docs like bin/post would do but we can't use SimplePostTool because it uses System.exit when
// it encounters an error, which JUnit doesn't like ...
log.info("Created collection, now posting example docs!");
[2/2] lucene-solr:branch_5x: SOLR-8801: /bin/solr create script
always returns exit code 0 when a collection/core already exists
Posted by sa...@apache.org.
SOLR-8801: /bin/solr create script always returns exit code 0 when a collection/core already exists
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/77e7fbba
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/77e7fbba
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/77e7fbba
Branch: refs/heads/branch_5x
Commit: 77e7fbbaa37223e91f2adae9829ef48c689286ea
Parents: d58bff0
Author: Steve Rowe <sa...@apache.org>
Authored: Fri May 20 19:36:39 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Fri Jun 17 17:52:18 2016 -0400
----------------------------------------------------------------------
solr/core/src/java/org/apache/solr/util/SolrCLI.java | 4 ++--
.../src/test/org/apache/solr/cloud/SolrCloudExampleTest.java | 4 ++++
2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/77e7fbba/solr/core/src/java/org/apache/solr/util/SolrCLI.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/SolrCLI.java b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
index 20f7515..adc7e19 100644
--- a/solr/core/src/java/org/apache/solr/util/SolrCLI.java
+++ b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
@@ -1640,7 +1640,7 @@ public class SolrCLI {
String systemInfoUrl = solrUrl+"admin/info/system";
CloseableHttpClient httpClient = getHttpClient();
- Tool tool = null;
+ ToolBase tool = null;
try {
Map<String, Object> systemInfo = getJson(httpClient, systemInfoUrl, 2, true);
if ("solrcloud".equals(systemInfo.get("mode"))) {
@@ -1648,7 +1648,7 @@ public class SolrCLI {
} else {
tool = new CreateCoreTool(stdout);
}
- tool.runTool(cli);
+ tool.runImpl(cli);
} finally {
closeHttpClient(httpClient);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/77e7fbba/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java b/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
index 606d066..0562e8d 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
@@ -94,6 +94,10 @@ public class SolrCloudExampleTest extends AbstractFullDistribZkTestBase {
ensureAllReplicasAreActive(testCollectionName, "shard2", 2, 2, 10);
cloudClient.setDefaultCollection(testCollectionName);
+ int invalidToolExitStatus = 1;
+ assertEquals("Collection '" + testCollectionName + "' created even though it already existed",
+ invalidToolExitStatus, tool.runTool(cli));
+
// now index docs like bin/post would do but we can't use SimplePostTool because it uses System.exit when
// it encounters an error, which JUnit doesn't like ...
log.info("Created collection, now posting example docs!");