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

Pierre Salagnac commented on SOLR-17453:
----------------------------------------

I was looking for a ticket with {{newdev}} tag and had a look at this one.

I started by trying to remove the {{CloudUtil}} variant of waitForState(). 
There are only a few callers to it, and they are all in test classes. It is 
fine to replace it by the well known {{waitForState()}} for most of the calls, 
but unfortunately some of the calls in {{ReindexCollectionTest}} [wait for a 
condition|https://github.com/apache/solr/blob/main/solr/core/src/test/org/apache/solr/cloud/ReindexCollectionTest.java#L371]
 which is not stored in the collection state (but in another ZK node for the 
reindexing state). This means that we cannot just replace one method by the 
other, since the watch on the collection state is not triggered when the 
reindexing state (another ZK node) is updated, and consequently the predicate 
is not evaluated again.

Specifically for this test, I think this can be achieved by splitting the check 
it do. First, do a regular {{waitForState()}} to check the collection, and then 
check the re-indexing status with a busy waiting loop. The second can be with 
{{{}Timeout{}}}.
[~dsmiley] WDYT

(PS: There are other places where we can easily do the replacement, indeed! I 
may look at that in a second step)

> Replace CloudUtil.waitForState and some TimeOut with 
> ZkStateReader.waitForState
> -------------------------------------------------------------------------------
>
>                 Key: SOLR-17453
>                 URL: https://issues.apache.org/jira/browse/SOLR-17453
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: David Smiley
>            Priority: Minor
>              Labels: newdev
>
> We should universally use ZkStateReader.waitForState when waiting for the 
> ClusterState to change based on a predicate.  SolrCloudTestCase.waitForState 
> is fine since it calls the former.  But CloudUtil.waitForState does not; it 
> should be replaced.  Additionally, TimeOut is used in some places wait 
> waitForState ought to be used, like CreateCollectionCmd.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to