stillalex commented on PR #1504:
URL: https://github.com/apache/solr/pull/1504#issuecomment-1518426686

   I spent some more time on this class and have identified 2 problematic 
things I wanted to share:
    * this looks like a NPE waiting to happen 
https://github.com/apache/solr/blob/db4cb66271f615da6a0a3ae6fed5fb2e184fd053/solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java#L889
 I believe the intent could have been to check `docCollection` for null instead 
of `collection`?
    * all over the class there is a pattern of checking read only status to 
prevent some operations I believe could be broken.
   ```
   clusterState = zkController.getClusterState();
   if (isReadOnly()) {
     throw new SolrException(ErrorCode.FORBIDDEN, "Collection " + collection + 
" is read-only.");
   }
   ```
   refreshing the `clusterState` is insufficient, because the `isReadOnly` is 
based on the `readOnlyCollection` flag that is only initialized at the 
beginning. if the intent was to have a fresh check, the `readOnlyCollection` 
flag needs to be updated too, based on the new `clusterState`. please correct 
if I am reading this incorrectly.
   


-- 
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

Reply via email to