[ 
https://issues.apache.org/jira/browse/SOLR-12495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16520032#comment-16520032
 ] 

Noble Paul commented on SOLR-12495:
-----------------------------------

{quote}That seems confusing to me; the way I read it is: keep a minimum number 
of replicas on every node. ...
{quote}
Actually, the terms *replica* , *shard* are always associated with a 
collection. If the attribute *shard* is present , the replica counts are 
computed on a per-shard basis , if it is absent, it is computed on a 
per-collection basis

The equivalent term for a replica globally is a *core* which is not associated 
with a collection or shard
{quote}I understand that it's not constant, but what I'm saying is the rule 
itself can not be violated but the cluster not balanced.
{quote}
right . what it means is that it will not show any violation even though new 
replicas are assigned appropriately. I'm going to redefine the meaning of 
*#MINIMUM*

Instead of computing the value to {{<= 
Math.ceil(number_of_replicas/number_of_valid_nodes)}} it will be computed to 
the actual value of {{number_of_replicas/number_of_valid_nodes}} .
 So, in your case if there are *40* nodes and *42* replicas , it is equivalent 
to
{code:java}
{"replica": "1.02", "node": "#ANY"}
{code}
That means The no:of of replicas will have to be between 1 and 2 (inclusive) . 
Which means , both 1 and 2 are valid but *0* , *3* or *>3* are invalid

> Enhance the Autoscaling policy syntax to evenly distribute replicas
> -------------------------------------------------------------------
>
>                 Key: SOLR-12495
>                 URL: https://issues.apache.org/jira/browse/SOLR-12495
>             Project: Solr
>          Issue Type: New Feature
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: AutoScaling
>            Reporter: Noble Paul
>            Priority: Major
>
> Support a new function value for {{replica= "#MINIMUM"}}
> {{#MINIMUM}} means the minimum computed value for the given configuration
> the value of replica will be calculated as  {{<= 
> Math.ceil(number_of_replicas/number_of_valid_nodes) }}
> *example 1:*
> {code:java}
> {"replica" : "#MINIMUM" , "shard" : "#EACH" , "node" : "#ANY"}
> {code}
> *case 1* : nodes=3, replicationFactor=4
>  the value of replica will be calculated as {{Math.ceil(4/3) = 2}}
> current state : nodes=3, replicationFactor=2
> this is equivalent to the hard coded rule
> {code:java}
> {"replica" : "<3" , "shard" : "#EACH" , "node" : "#ANY"}
> {code}
> *case 2* : 
> current state : nodes=3, replicationFactor=2
> this is equivalent to the hard coded rule
> {code:java}
> {"replica" : "<3" , "shard" : "#EACH" , "node" : "#ANY"}
> {code}
> *example:2*
> {code}
> {"replica" : "#MINIMUM"  , "node" : "#ANY"}{code}
> case 1: numShards = 2, replicationFactor=3, nodes = 5
> this is equivalent to the hard coded rule
> {code:java}
> {"replica" : "<3" , "node" : "#ANY"}
> {code}
> *example:3*
> {code}
> {"replica" : "<2"  , "shard" : "#EACH" , "port" : "8983"}{code}
> case 1: {{replicationFactor=3, nodes with port 8983 = 2}}
> this is equivalent to the hard coded rule
> {code}
> {"replica" : "<3"  , "shard" : "#EACH" , "port" : "8983"}{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to