You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by gu...@apache.org on 2020/06/07 16:24:58 UTC
[lucene-solr] 01/03: Legibility: Only get the value of node from
messages once.
This is an automated email from the ASF dual-hosted git repository.
gus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
commit 14a988cc2a3eff5af7349e41300e83e57e6b8dbd
Author: Gus Heck <gu...@apache.org>
AuthorDate: Sat Jun 6 12:00:04 2020 -0400
Legibility: Only get the value of node from messages once.
---
.../src/java/org/apache/solr/cloud/api/collections/AddReplicaCmd.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/AddReplicaCmd.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/AddReplicaCmd.java
index 3e0332e..02d9fd7 100644
--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/AddReplicaCmd.java
+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/AddReplicaCmd.java
@@ -145,7 +145,7 @@ public class AddReplicaCmd implements OverseerCollectionMessageHandler.Cmd {
totalReplicas += entry.getValue();
}
if (totalReplicas > 1) {
- if (message.getStr(CoreAdminParams.NAME) != null) {
+ if (node != null) {
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Cannot create " + totalReplicas + " replicas if 'name' parameter is specified");
}
if (message.getStr(CoreAdminParams.CORE_NODE_NAME) != null) {