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

Allow percentage in replica attribute in policy

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.5, 8.0
    • Component/s: AutoScaling, SolrCloud
    • Labels:
      None

      Description

      Today we can only specify an absolute number in the 'replica' attribute in the policy rules. It'd be useful to write a percentage value to make certain use-cases easier. For example:

      // Keep a third of the the replicas of each shard in east region
      {"replica" : "<34%", "shard" : "#EACH", "sysprop:region": "east"}
      // Keep two thirds of the the replicas of each shard in west region
      {"replica" : "<67%", "shard" : "#EACH", "sysprop:region": "west"}
      

      Today the above must be represented by different rules for each collection if they have different replication factors. Also if the replication factor changes later, the absolute value has to be changed in tandem. So expressing a percentage removes both of these restrictions.

      This feature means that the value of the attribute "replica" is only available just in time. We call such values "computed values" . The computed value for this attribute depends on other attributes as well.
      Take the following 2 rules

      //example 1
      {"replica" : "<34%", "shard" : "#EACH", "sysprop:region": "east"}
      //example 2
      {"replica" : "<34%",  "sysprop:region": "east"}
      

      assume we have collection "A" with 2 shards and replicationFactor=3

      example 1 would mean that the value of replica is computed as

      3 * 34 / 100 = 1.02

      Which means for each shard keep less than 1.02 replica in east availability zone

       

      example 2 would mean that the value of replica is computed as 

      3 * 2 * 34 / 100 = 2.04

       

      which means for each collection keep less than 2.04 replicas on east availability zone

        Attachments

        1. SOLR-11985.patch
          23 kB
          Noble Paul
        2. SOLR-11985.patch
          69 kB
          Noble Paul

          Issue Links

            Activity

              People

              • Assignee:
                noble.paul Noble Paul
                Reporter:
                shalinmangar Shalin Shekhar Mangar
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: