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

maxShardsPerNode=-1 needs special handling while restoring collections

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.5, 8.0
    • Component/s: Backup/Restore
    • Labels:
      None

      Description

      When you start Solr 6.6. and run the cloud example here's the log excerpt :

      Connecting to ZooKeeper at localhost:9983 ...
      
      INFO  - 2018-06-20 13:44:47.491; org.apache.solr.client.solrj.impl.ZkClientClusterStateProvider; Cluster at localhost:9983 ready
      ...
      
      Creating new collection 'gettingstarted' using command:
      
      http://localhost:8983/solr/admin/collections?action=CREATE&name=gettingstarted&numShards=2&replicationFactor=2&maxShardsPerNode=2&collection.configName=gettingstarted

      maxShardsPerNode get's set to 2 . 

       

      Compare this to Solr 7.3 

      INFO  - 2018-06-20 13:55:33.823; org.apache.solr.client.solrj.impl.ZkClientClusterStateProvider; Cluster at localhost:9983 ready
      
      Created collection 'gettingstarted' with 2 shard(s), 2 replica(s) with config-set 'gettingstarted'

      So something changed and now we no longer set maxShardsPerNode and it defaults to -1 . 

       

      -1 has special handing while creating a collection ( it means max int ) . This special handling is not there while restoring a collection and hence this fails

      We should not set maxShardsPerNode to -1 in the first place

      Steps to reproduce:

      1. ./bin/solr start -e cloud -noprompt : This creates a 2 node cluster and a gettingstarted collection which 2X2
      2. Add 4 docs (id=1,2,3,4) with commit=true and openSearcher=true (default)
      3. Call backup: http://localhost:8983/solr/admin/collections?action=BACKUP&name=gettingstarted_backup&collection=gettingstarted&location=/Users/varunthacker/solr-7.1.0
      4. Call restore:
      http://localhost:8983/solr/admin/collections?action=restore&name=gettingstarted_backup&collection=restore_gettingstarted&location=/Users/varunthacker/solr-7.1.0

        Attachments

        1. SOLR-11807.patch
          10 kB
          Varun Thacker
        2. SOLR-11807.patch
          3 kB
          Varun Thacker
        3. SOLR-11807.patch
          2 kB
          Varun Thacker

          Issue Links

            Activity

              People

              • Assignee:
                varun Varun Thacker
                Reporter:
                varun Varun Thacker
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: