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

Christine Poerschke commented on SOLR-10880:
--------------------------------------------

(Disclosure: Domenico and I are in the same team and so I've already internally 
had input into the ideas and the initial code patch here.)

----

bq. ... Is it somehow connected to the new replication modes?

No, I don't think this is related to the replication modes.

bq. Can you give a real-world example for what to use this feature for? ...

*Scenario 1: separation of (say) heavy analytics requests*

* replicas (temporarily or permanently) designated to handle analytics requests 
are via the 
[ADDREPLICAPROP|https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-ADDREPLICAPROP:AddReplicaProperty]
 API marked to be of 'analytics' flavour.
* analytics requests ask to be routed to analytics flavour replicas

{code}
/admin/collections?action=ADDREPLICAPROP&...&property=replicaFlavour&property.value=analytics

....../select?replicaFlavour.like=analytics
or
....../select_analytics where replicaFlavour.like=analytics default or 
invariant is configured

/admin/collections?action=DELETEREPLICAPROP&...&property=replicaFlavour
{code}


*Scenario 2: avoidance of certain replicas*

* requests might wish to avoid certain replicas e.g. because they are on hosts 
under going maintenance (the scenario [~erickerickson] outlined in SOLR-10484)
* requests ask not to be routed to under-maintenance flavour replicas

{code}
/admin/collections?action=ADDREPLICAPROP&...&property=replicaFlavour&property.value=maintenance

....../select?replicaFlavour.dislike=maintenance
or
....../select_not_mm where replicaFlavour.dislike=maintenance default or 
invariant is configured

/admin/collections?action=DELETEREPLICAPROP&...&property=replicaFlavour
{code}

*Scenario 3: canary functionality*

* SOLR-10610 proposes a CanaryComponent
* requests can ask that replicas with a certain flavour be used for the canary 
request(s)

{code}
/admin/collections?action=ADDREPLICAPROP&...&property=replicaFlavour&property.value=yellow

....../select?replicaFlavour.canary=yellow

/admin/collections?action=DELETEREPLICAPROP&...&property=replicaFlavour
{code}

----

{{replicaFlavour}} is a tentative name, we would have to replace it with 
something that doesn't have the 'flavour' vs. 'flavor' misspelling potential 
but also something that is sufficiently distinct from the concepts of 
'replication mode' and 'replica role'.

{{replicaFlavour.like}} and {{replicaFlavour.dislike}} and 
{{replicaFlavour.canary}} style dot parameter notation would allow for the 
HttpShardHandler to look for parameters starting with {{replicaFlavour.}} and 
to only for those requests build the data structures required to support the 
like/dislike/canary logic.

> Support replica filtering by flavour
> ------------------------------------
>
>                 Key: SOLR-10880
>                 URL: https://issues.apache.org/jira/browse/SOLR-10880
>             Project: Solr
>          Issue Type: New Feature
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Domenico Fabio Marino
>            Priority: Minor
>         Attachments: SOLR-10880.patch
>
>
> Add a mechanism to allow queries to use only a subset of replicas(by 
> specifying the wanted replica "flavour").
> Some replicas have to be marked as "flavoured" before running the query.
> A query can specify ShardParams.SHARDS_REQUIRED_FLAVOUR to specify the 
> flavour it wants to use (Only one flavour can be specified) together with  
> ShardParams.SHARDS_CONSIDER_FLAVOURS set to true.
> The property Replica.REPLICA_FLAVOUR can be used to give a flavour to a 
> replica, the parameter it takes is a pipe ('|') separated list of flavours 
> (e.g. "chocolate|vanilla").
> The mappings between flavours is only computed when 
> ShardParams.SHARDS_CONSIDER_FLAVOURS is true, and it is computed separately 
> for each request.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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

Reply via email to