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

Have an option to disable autoAddReplicas temporarily for all collections

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      When doing offline maintenance on my cluster I would like to disable autoAddReplicas since I don't want replicas being created on nodes during this time.

      It would be useful to have an option to enable/disable autoAddReplicas via an API.

      This API would disable autoAddReplicas:

      admin/collections?action=CLUSTERPROP&name=autoAddReplicas&val=false
      

      Now when I want to enable it again the API call would look like this:

      admin/collections?action=CLUSTERPROP&name=autoAddReplicas
      

      This uses the CLUSTERPROP semantics of unsetting a property when the val param is not provided.

      1. SOLR-6879.patch
        7 kB
        Varun Thacker
      2. SOLR-6879.patch
        8 kB
        Varun Thacker

        Issue Links

          Activity

          Hide
          varunthacker Varun Thacker added a comment -

          Patch with a test case.
          I found a bug in how the Overseer deals with a CLUSTERPROP event. The switch case does not break. I have fixed it in the same patch. Should I create another Jira for it if we want to backport this to the 4.x branch?

          Show
          varunthacker Varun Thacker added a comment - Patch with a test case. I found a bug in how the Overseer deals with a CLUSTERPROP event. The switch case does not break. I have fixed it in the same patch. Should I create another Jira for it if we want to backport this to the 4.x branch?
          Hide
          markrmiller@gmail.com Mark Miller added a comment -

          Should I create another Jira for it if we want to backport this to the 4.x branch?

          Sure - if it's a bug, good to get it's own issue.

          Show
          markrmiller@gmail.com Mark Miller added a comment - Should I create another Jira for it if we want to backport this to the 4.x branch? Sure - if it's a bug, good to get it's own issue.
          Hide
          steve_rowe Steve Rowe added a comment -

          +1 for the patch (with the bugfix on its own issue first)

          I also noticed that ReplicaMutator.addReplicaProperty() misspells ADDREPLICAPROP as SETREPLICAPROPERTY in a couple exception messages - I've opened SOLR-6882.

          Show
          steve_rowe Steve Rowe added a comment - +1 for the patch (with the bugfix on its own issue first) I also noticed that ReplicaMutator.addReplicaProperty() misspells ADDREPLICAPROP as SETREPLICAPROPERTY in a couple exception messages - I've opened SOLR-6882 .
          Hide
          varunthacker Varun Thacker added a comment -

          Same patch as before, but the CLUSTERPROP bug is broken out into it's own issue.

          Show
          varunthacker Varun Thacker added a comment - Same patch as before, but the CLUSTERPROP bug is broken out into it's own issue.
          Hide
          steve_rowe Steve Rowe added a comment -

          Thanks Varun, I'll commit this tomorrow.

          Show
          steve_rowe Steve Rowe added a comment - Thanks Varun, I'll commit this tomorrow.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 1647811 from Use account "steve_rowe" instead in branch 'dev/trunk'
          [ https://svn.apache.org/r1647811 ]

          SOLR-6879: Have an option to disable autoAddReplicas temporarily for all collections.

          Show
          jira-bot ASF subversion and git services added a comment - Commit 1647811 from Use account "steve_rowe" instead in branch 'dev/trunk' [ https://svn.apache.org/r1647811 ] SOLR-6879 : Have an option to disable autoAddReplicas temporarily for all collections.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 1647812 from Use account "steve_rowe" instead in branch 'dev/branches/branch_5x'
          [ https://svn.apache.org/r1647812 ]

          SOLR-6879: Have an option to disable autoAddReplicas temporarily for all collections. (merged trunk r1647811)

          Show
          jira-bot ASF subversion and git services added a comment - Commit 1647812 from Use account "steve_rowe" instead in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1647812 ] SOLR-6879 : Have an option to disable autoAddReplicas temporarily for all collections. (merged trunk r1647811)
          Hide
          steve_rowe Steve Rowe added a comment -

          Committed to trunk and branch_5x.

          Thanks Varun!

          Show
          steve_rowe Steve Rowe added a comment - Committed to trunk and branch_5x. Thanks Varun!
          Hide
          varunthacker Varun Thacker added a comment -

          Thanks Steve.

          Couple of ref guide updates that we would need to make -

          1. https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api11
          Instead of "As of Solr 4.7, only the property urlScheme is supported."
          we could have something like - "The two supported properties are - 'urlScheme' and 'autoAddReplicas' "

          2. Under "AutoAddReplica Settings" on https://cwiki.apache.org/confluence/display/solr/Running+Solr+on+HDFS we could add the following section-

          "Temporarily disable autoAddReplicas for the entire cluster" - When doing offline maintenance on the cluster and for various other use cases where an admin would like to disable autoAddReplicas temporarily, one could use the following APIs to disable and enable autoAddReplicas cluster wide.

          API to disable autoAddReplicas:

          admin/collections?action=CLUSTERPROP&name=autoAddReplicas&val=false
          

          API to enable autoAddReplicas:

          admin/collections?action=CLUSTERPROP&name=autoAddReplicas
          
          Show
          varunthacker Varun Thacker added a comment - Thanks Steve. Couple of ref guide updates that we would need to make - 1. https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api11 Instead of "As of Solr 4.7, only the property urlScheme is supported." we could have something like - "The two supported properties are - 'urlScheme' and 'autoAddReplicas' " 2. Under "AutoAddReplica Settings" on https://cwiki.apache.org/confluence/display/solr/Running+Solr+on+HDFS we could add the following section- "Temporarily disable autoAddReplicas for the entire cluster" - When doing offline maintenance on the cluster and for various other use cases where an admin would like to disable autoAddReplicas temporarily, one could use the following APIs to disable and enable autoAddReplicas cluster wide. API to disable autoAddReplicas: admin/collections?action=CLUSTERPROP&name=autoAddReplicas&val= false API to enable autoAddReplicas: admin/collections?action=CLUSTERPROP&name=autoAddReplicas
          Hide
          anshumg Anshum Gupta added a comment -

          Bulk close after 5.0 release.

          Show
          anshumg Anshum Gupta added a comment - Bulk close after 5.0 release.

            People

            • Assignee:
              steve_rowe Steve Rowe
              Reporter:
              varunthacker Varun Thacker
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development