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

Scott Blum commented on SOLR-9014:
----------------------------------

I don't know... seems like a dicey game to try to ensure that no collection 
node can ever exist without a state.json.  Even the process of migrating state 
format would have to be transactional.  It seems really tricky to both get all 
the edge cases right and convince ourselves there's never a legitimate use case 
(like having a non-collection just for holding shared config).

I think what I would most be in favor of is deprecating the existing API and 
return a Map<String, DocCollection> to at least avoid the cases where we're 
doing double lookups today.  Most callers are iterating over the returned set 
and fetching individual DocCollections in a loop, which causes a second lookup, 
which is the real problem.  You can never avoid doing at least one lookup 
anyway.

An alternate, wacky idea, is to do the same thing but return a custom Map 
implementation that lazily determines the map contents.

> Deprecate and reduce usage of ClusterState methods which may make calls to ZK 
> via the lazy collection reference
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-9014
>                 URL: https://issues.apache.org/jira/browse/SOLR-9014
>             Project: Solr
>          Issue Type: Improvement
>          Components: SolrCloud
>            Reporter: Shalin Shekhar Mangar
>             Fix For: 6.1, master
>
>         Attachments: SOLR-9014.patch
>
>
> ClusterState has a bunch of methods such as getSlice and getReplica which 
> internally call getCollectionOrNull that ends up making a call to ZK via the 
> lazy collection reference. Many classes use these methods even though a 
> DocCollection object is available. In such cases, multiple redundant calls to 
> ZooKeeper can happen if the collection is not watched locally. This is 
> especially true for Overseer classes which operate on all collections.
> We should audit all usages of these methods and replace them with calls to 
> appropriate DocCollection methods.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to