You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Tomás Fernández Löbbe (JIRA)" <ji...@apache.org> on 2017/08/10 17:16:02 UTC

[jira] [Commented] (SOLR-10880) Support replica filtering by tag

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

Tomás Fernández Löbbe commented on SOLR-10880:
----------------------------------------------

Hi Domenico, thanks for working on this. 
As I said, I'd like this to also be usable for replica types in addition to tags, so I'd like the syntax to be ready for that extension at least, even if support for replica types is not added as part of this Jira. I'd like to suggest a different syntax, what do you think about:
{code}
&shards.filter=replicaProp:red
{code}
I think "shards.filter" is a good idea because this is like an extension of the feature that allows you to explicitly choose the shards or replicas when using SolrCloud  that we have today (e.g. {{&shards=shard1}}). In the future, we could add things like:
{code}
&shards.filter=replicaType:PULL
{code}
To query only replicas of type PULL, or 
{code}
&shards.filter=nodeRole:analytics
{code}


> Support replica filtering by tag
> --------------------------------
>
>                 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, SOLR-10880.patch, SOLR-10880.patch, SOLR-10880.patch
>
>
> Add a mechanism to allow queries to use only a subset of replicas(by specifying the wanted replica tag).
> Some replicas have to be marked as tag before running the query.
> A query has to specify ShardParams.REPLICA_TAG_NAME to specify what property holds the tag it wants to use (for example "replica.tag") and then use ShardParams.REPLICA_TAG_LIKE "tagName" to tell the ShardHandler to only use the replicas matching tagName.
> A query can also use ShardParams.REPLICA_TAG_DISLIKE "tagName" to use all the replicas that do not match tagName.
> In order to properly use this system, replicas need to be tagged, tagging a replica involves setting the property ShardParams.REPLICA_TAG_NAME to a property name and then set that property in the replicas.
> An example can be seen in the ReplicaTagTest included in this patch where a dynamic cloud has some tags assigned to it both randomly and on a fixed basis.
> A replica can have multiple tags attached to it, and these tags are separated by default by "|"(pipe character), the delimiter can be changed by setting ShardParams.REPLICA_TAG_DELIMITER in the query to anything else.
> No validity check is performed on the tags, therefore one may get an array of shard URLs that contains empty URLs, or that is null(when the property does not exist), the user of this feature has to deal with it.
> The tag to replica mappings are rebuilt for each query that specifies ShardParams.REPLICA_TAG_NAME. 



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org