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

Shalin Shekhar Mangar commented on SOLR-13325:
----------------------------------------------

I'm looking at this again. I think we should change the syntax slightly and get 
rid of the {{#policy}} key name. Instead, this can operate on any collection 
property such as policy or configName or autoAddReplicas etc that are part of 
the collection state. What's slightly complicating is that there are additional 
collection properties (stored in collectionprops.json). I don't intend to 
support that at the moment. On a related note, collection props have write APIs 
but no read APIs which severely limit the usefulness of that feature? That's 
something we should fix separately.

Now once we have this working, it reduces the need for a separate 
AutoAddReplicasPlanAction because you can get the same behavior by setting the 
following in ComputePlanAction:
{code}
"collection": {"autoAddReplicas": "true"}
{code}
However, there is a difference between the current implementation of 
"collections" in ComputePlanAction and how AutoAddReplicasPlanAction works 
which is that the former filters out suggestions of non-matching collections 
but the latter pushes down the collection hint to the policy engine so that it 
doesn't even compute suggestions for non-matching collections in the first 
place. The latter is obviously more efficient.

The one thing we have to be careful about is that the list of matching 
collections should be evaluated lazily when the action is triggered instead of 
early in the init method so that it can *see* the changes in the cluster state.

> Add a collection selector to triggers
> -------------------------------------
>
>                 Key: SOLR-13325
>                 URL: https://issues.apache.org/jira/browse/SOLR-13325
>             Project: Solr
>          Issue Type: Improvement
>          Components: AutoScaling
>            Reporter: Shalin Shekhar Mangar
>            Priority: Major
>             Fix For: master (9.0), 8.2
>
>
> Similar to SOLR-13273, it'd be nice to have a collection selector that 
> applies to triggers. An example use-case would be to selectively add replicas 
> on new nodes for certain collections only.
> Here is a selector that returns collections that match the given collection 
> property/value pair:
> {code}
> "collection": {"property_name": "property_value"}
> {code}
> Here's another selector that returns collections that have the given policy 
> applied
> {code}
> "collection": {"#policy": "policy_name"}
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to