Solr
  1. Solr
  2. SOLR-5014

The "no servers hosting shard" exception will never tell you the shard

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 4.3
    • Fix Version/s: None
    • Component/s: SolrCloud
    • Labels:
      None

      Description

      If none of the replicas for a shard are available, the "no servers hosting shard" exception is thrown. The code suggests that it will tell you which shard is available, but it does not. In fact, it can never do so.

      The reason is that the code at that point doesn't actually know the shard name or ID. The "shard" string passed to HttpShardHandler#submit method is "the | delimited list of equivalent servers". But... that list, by definition, is empty if all the servers are down for a shard.

      What I want to see is the actual shard name/ID, like "shard2".

      Here's the shard.info section from a response where the replicas for a second shard of a two-shard cluster have all been intentionally killed.

        "shards.info":{
          "":{
            "error":"org.apache.solr.common.SolrException: no servers hosting shard: ",
            "trace":"org.apache.solr.common.SolrException: no servers hosting shard: \r\n\tat org.apache.solr.handler.component.HttpShardHandler$1.call(HttpShardHandler.java:149)\r\n\tat org.apache.solr.handler.component.HttpShardHandler$1.call(HttpShardHandler.java:119)\r\n\tat java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)\r\n\tat java.util.concurrent.FutureTask.run(Unknown Source)\r\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)\r\n\tat java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)\r\n\tat java.util.concurrent.FutureTask.run(Unknown Source)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\r\n\tat java.lang.Thread.run(Unknown Source)\r\n",
            "time":0},
          "207.237.114.232:8983/solr/collection1/|207.237.114.232:8985/solr/collection1/":{
            "numFound":8,
            "maxScore":1.0,
            "time":98}},
      

      The request:

      curl "http://localhost:8983/solr/select/?q=*:*&indent=true&wt=json&shards.info=yes&shards.tolerant=yes"
      

      The shards.info section for the same request after the two killed replicas are restarted:

        "shards.info":{
          "207.237.114.232:8984/solr/collection1/|207.237.114.232:8986/solr/collection1/":{
            "numFound":2,
            "maxScore":1.0,
            "time":224},
          "207.237.114.232:8983/solr/collection1/|207.237.114.232:8985/solr/collection1/":{
            "numFound":8,
            "maxScore":1.0,
            "time":898}},
      

      Here's the cluster state for that cluster when all four nodes are up:

      {"collection1":{
          "shards":{
            "shard1":{
              "range":"80000000-ffffffff",
              "state":"active",
              "replicas":{
                "core_node1":{
                  "state":"active",
                  "core":"collection1",
                  "node_name":"207.237.114.232:8983_solr",
                  "base_url":"http://207.237.114.232:8983/solr",
                  "leader":"true"},
                "core_node3":{
                  "state":"active",
                  "core":"collection1",
                  "node_name":"207.237.114.232:8985_solr",
                  "base_url":"http://207.237.114.232:8985/solr"}}},
            "shard2":{
              "range":"0-7fffffff",
              "state":"active",
              "replicas":{
                "core_node2":{
                  "state":"active",
                  "core":"collection1",
                  "node_name":"207.237.114.232:8984_solr",
                  "base_url":"http://207.237.114.232:8984/solr",
                  "leader":"true"},
                "core_node4":{
                  "state":"active",
                  "core":"collection1",
                  "node_name":"207.237.114.232:8986_solr",
                  "base_url":"http://207.237.114.232:8986/solr"}}}},
          "router":"compositeId"}}
      

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          705d 17h 14m 1 Mark Miller 13/Jun/15 19:06
          Hide
          Shalin Shekhar Mangar added a comment -

          Thanks Mark, I did not search for duplicates, my bad.

          Show
          Shalin Shekhar Mangar added a comment - Thanks Mark, I did not search for duplicates, my bad.
          Mark Miller made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Duplicate [ 3 ]
          Hide
          Mark Miller added a comment -

          This issue was duplicated and resolved in SOLR-7566

          Show
          Mark Miller added a comment - This issue was duplicated and resolved in SOLR-7566
          Mark Miller made changes -
          Field Original Value New Value
          Link This issue duplicates SOLR-7566 [ SOLR-7566 ]
          Jack Krupansky created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              Jack Krupansky
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development