Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-13142

Create Collection will put two replicas in same node

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Bug
    • Affects Version/s: 7.6
    • Fix Version/s: None
    • Component/s: SolrCloud
    • Labels:
      None

      Description

      I have a solr cluster with two nodes, and both of them are alive.

      Solr cluster: 

      http://10.58.91.47:8082/search

      http://10.58.91.83:8082/search

       

      In solr7.5 when create a collection in two nodes cluster with shards=1 and replicationFactor=2, each node will have a replica.

      However, in solr7.6, when use same request to create collection, two replicas will be put in same solr node.

      example:

      create collection request:

      http://10.58.91.47:8082/search/admin/collections?action=CREATE&name=NewCollection&numShards=1&replicationFactor=2&collection.configName=conf&shards=shard1&maxShardsPerNode=1

      response:

      {
      "responseHeader": {
      "status": 0,
      "QTime": 5392
      },
      "success": {
      "10.58.91.47:8082_search": {
      "responseHeader": {
      "status": 0,
      "QTime": 2584
      },
      "core": "NewCollection_shard1_replica_n1"
      }
      }
      }
      

      use clusterstatus request to query replica info:

      request: http://10.58.91.83:8082/search/admin/collections?action=CLUSTERSTATUS&collection=NewCollection

      response:

      Tree
      Chart
      JSON Input
      {
      "responseHeader": {
      "status": 0,
      "QTime": 8
      },
      "cluster": {
      "collections": {
      "NewCollection": {
      "pullReplicas": "0",
      "replicationFactor": "2",
      "shards": {
      "shard1": {
      "range": "80000000-7fffffff",
      "state": "active",
      "replicas": {
      "core_node3": {
      "core": "NewCollection_shard1_replica_n1",
      "base_url": "http://10.58.91.47:8082/search",
      "node_name": "10.58.91.47:8082_search",
      "state": "active",
      "type": "NRT"
      },
      "core_node4": {
      "core": "NewCollection_shard1_replica_n2",
      "base_url": "http://10.58.91.47:8082/search",
      "node_name": "10.58.91.47:8082_search",
      "state": "active",
      "type": "NRT",
      "leader": "true"
      }
      }
      }
      },
      "router": {
      "name": "compositeId"
      },
      "maxShardsPerNode": "1",
      "autoAddReplicas": "false",
      "nrtReplicas": "2",
      "tlogReplicas": "0",
      "znodeVersion": 4,
      "configName": "conf"
      }
      },
      "properties": {
      "legacyCloud": "true"
      },
      "live_nodes": [
      "10.58.91.47:8082_search",
      "10.58.91.83:8082_search"
      ]
      }
      }
      

      Is there any change for solr7.6 since I have not find any create collection API changes from document.

      Could anyone please provide help?

       

        Attachments

        1. autoscaling.json
          2 kB
          Lyle
        2. CLUSTERSTATUS.json
          8 kB
          Lyle
        3. diagnostics.json
          8 kB
          Lyle

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              lyle_wang Lyle
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: