patsonluk commented on code in PR #909: URL: https://github.com/apache/solr/pull/909#discussion_r922392959
########## solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java: ########## @@ -525,8 +652,14 @@ private void constructState(Set<String> changedCollections) { Map<String, ClusterState.CollectionRef> result = new LinkedHashMap<>(); // Add collections - for (Map.Entry<String, DocCollection> entry : watchedCollectionStates.entrySet()) { - result.put(entry.getKey(), new ClusterState.CollectionRef(entry.getValue())); + for (Entry<String, StatefulCollectionWatch> entry : + collectionWatches.watchedCollectionEntries()) { + if (entry.getValue().currentState != null) { + // if the doc is null for the collection watch, then it should not be inserted into the + // state + result.putIfAbsent( Review Comment: I'm scratch my head too 🤣 , as the latest code is not doing `putIfAbsent` here either. I feel like I could be just copying the original code from some earlier [commit](https://github.com/apache/solr/blame/54c5dd7d6d8b486df9132e637a6d7c5871ac4664/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java#L591) Anyway, using `put` instead! -- 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. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org