madrob commented on a change in pull request #1297: SOLR-14253 Replace various sleep calls with ZK waits URL: https://github.com/apache/lucene-solr/pull/1297#discussion_r385779370
########## File path: solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerCollectionMessageHandler.java ########## @@ -630,34 +596,32 @@ private void modifyCollection(ClusterState clusterState, ZkNodeProps message, Na overseer.offerStateUpdate(Utils.toJSON(message)); - TimeOut timeout = new TimeOut(30, TimeUnit.SECONDS, timeSource); - boolean areChangesVisible = true; - while (!timeout.hasTimedOut()) { - DocCollection collection = cloudManager.getClusterStateProvider().getClusterState().getCollection(collectionName); - areChangesVisible = true; - for (Map.Entry<String,Object> updateEntry : message.getProperties().entrySet()) { - String updateKey = updateEntry.getKey(); - - if (!updateKey.equals(ZkStateReader.COLLECTION_PROP) - && !updateKey.equals(Overseer.QUEUE_OPERATION) - && updateEntry.getValue() != null // handled below in a separate conditional - && !updateEntry.getValue().equals(collection.get(updateKey))) { - areChangesVisible = false; - break; + try { + zkStateReader.waitForState(collectionName, 30, TimeUnit.SECONDS, c -> { + if (c == null) { Review comment: It could happen if there is a concurrent delete ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org