[
https://issues.apache.org/jira/browse/SOLR-8254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14996601#comment-14996601
]
Mark Miller commented on SOLR-8254:
-----------------------------------
+1, I hit this working on SOLR-6237 as well. Same fix.
{noformat}
Index: solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
===================================================================
--- solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
(revision 1712839)
+++ solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
(working copy)
@@ -783,12 +783,12 @@
for (Map.Entry<String, Slice> entry : entries) {
// first see if we have the leader
Replica leaderProps = clusterState.getLeader(collection, entry.getKey());
- if (liveNodes.contains(leaderProps.getNodeName()) &&
leaderProps.getState() == Replica.State.ACTIVE) {
- if (leaderProps != null) {
+ if (leaderProps != null) {
+ if (liveNodes.contains(leaderProps.getNodeName()) &&
leaderProps.getState() == Replica.State.ACTIVE) {
core = checkProps(leaderProps);
- }
- if (core != null) {
- return core;
+ if (core != null) {
+ return core;
+ }
}
}
{noformat}
bq. It also strikes me that this method probably belongs on CoreContainer,
rather than as a private method in HttpSolrCall?
I don't know, we do not tend to put a lot of SolrCloud specific methods on
CoreContainer.
> HttpSolrCall.getCoreByCollection can throw NPE if there are no leaders up
> -------------------------------------------------------------------------
>
> Key: SOLR-8254
> URL: https://issues.apache.org/jira/browse/SOLR-8254
> Project: Solr
> Issue Type: Bug
> Reporter: Alan Woodward
>
> See http://jenkins.thetaphi.de/job/Lucene-Solr-5.x-Windows/5254/
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]