HoustonPutman commented on code in PR #760:
URL: https://github.com/apache/solr/pull/760#discussion_r1811503866


##########
solr/core/src/java/org/apache/solr/cloud/ZkDistributedQueue.java:
##########
@@ -246,24 +246,19 @@ public byte[] remove() throws NoSuchElementException, 
KeeperException, Interrupt
 
   public void remove(Collection<String> paths) throws KeeperException, 
InterruptedException {
     if (paths.isEmpty()) return;
-    List<Op> ops = new ArrayList<>();
+    List<SolrZkClient.CuratorOpBuilder> ops = new ArrayList<>();
     for (String path : paths) {
-      ops.add(Op.delete(dir + "/" + path, -1));
+      ops.add(op -> op.delete().withVersion(-1).forPath(dir + "/" + path));
     }
     for (int from = 0; from < ops.size(); from += 1000) {
       int to = Math.min(from + 1000, ops.size());
       if (from < to) {
-        try {
-          zookeeper.multi(ops.subList(from, to), true);
-        } catch (KeeperException.NoNodeException e) {
-          // don't know which nodes are not exist, so try to delete one by one 
node
-          for (int j = from; j < to; j++) {
+        Collection<CuratorTransactionResult> results = 
zookeeper.multi(ops.subList(from, to));
+        for (CuratorTransactionResult result : results) {
+          if (result.getError() != 0) {
             try {
-              zookeeper.delete(ops.get(j).getPath(), -1, true);
-            } catch (KeeperException.NoNodeException e2) {
-              if (log.isDebugEnabled()) {
-                log.debug("Can not remove node which is not exist : {}", 
ops.get(j).getPath());

Review Comment:
   I guess I didn't see a real point to the debugging, it just means that there 
was weirdly a bad status in the transactionResult. Either way the node is gone.



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