sonatype-lift[bot] commented on a change in pull request #288:
URL: https://github.com/apache/solr/pull/288#discussion_r742198500



##########
File path: 
solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java
##########
@@ -383,47 +419,7 @@ protected void doDeleteByQuery(DeleteUpdateCommand cmd) 
throws IOException {
       if (rollupReplicationTracker == null) {
         rollupReplicationTracker = new RollupRequestReplicationTracker();
       }
-      boolean leaderForAnyShard = false;  // start off by assuming we are not 
a leader for any shard
-
-      ModifiableSolrParams outParams = new 
ModifiableSolrParams(filterParams(req.getParams()));
-      outParams.set(DISTRIB_UPDATE_PARAM, DistribPhase.TOLEADER.toString());
-      outParams.set(DISTRIB_FROM, ZkCoreNodeProps.getCoreUrl(
-          zkController.getBaseUrl(), req.getCore().getName()));
-
-      SolrParams params = req.getParams();
-      String route = params.get(ShardParams._ROUTE_);
-      Collection<Slice> slices = coll.getRouter().getSearchSlices(route, 
params, coll);
-
-      List<SolrCmdDistributor.Node> leaders =  new ArrayList<>(slices.size());
-      for (Slice slice : slices) {
-        String sliceName = slice.getName();
-        Replica leader;
-        try {
-          leader = zkController.getZkStateReader().getLeaderRetry(collection, 
sliceName);
-        } catch (InterruptedException e) {
-          throw new SolrException(SolrException.ErrorCode.SERVICE_UNAVAILABLE, 
"Exception finding leader for shard " + sliceName, e);
-        }
-
-        // TODO: What if leaders changed in the meantime?
-        // should we send out slice-at-a-time and if a node returns "hey, I'm 
not a leader" (or we get an error because it went down) then look up the new 
leader?
-
-        // Am I the leader for this slice?
-        ZkCoreNodeProps coreLeaderProps = new ZkCoreNodeProps(leader);
-        String leaderCoreNodeName = leader.getName();
-        String coreNodeName = cloudDesc.getCoreNodeName();
-        isLeader = coreNodeName.equals(leaderCoreNodeName);
-
-        if (isLeader) {
-          // don't forward to ourself
-          leaderForAnyShard = true;
-        } else {
-          leaders.add(new SolrCmdDistributor.ForwardNode(coreLeaderProps, 
zkController.getZkStateReader(), collection, sliceName, maxRetriesOnForward));
-        }
-      }
-
-      outParams.remove("commit"); // this will be distributed from the local 
commit
-
-      cmdDistrib.distribDelete(cmd, leaders, outParams, false, 
rollupReplicationTracker, null);
+      boolean leaderForAnyShard = forwardDelete(coll, cmd);

Review comment:
       *THREAD_SAFETY_VIOLATION:*  Unprotected write. Non-private method 
`DistributedZkUpdateProcessor.doDeleteByQuery(...)` indirectly writes to field 
`noggit.JSONParser.devNull.buf` outside of synchronization.
    Reporting because another access to the same memory occurs on a background 
thread, although this access may not.
   (at-me [in a reply](https://help.sonatype.com/lift/talking-to-lift) with 
`help` or `ignore`)




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