You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by er...@apache.org on 2020/07/16 01:17:31 UTC

[lucene-solr] branch master updated: SOLR-13939: Extract any non-gradle related patches (deprecations, URL fixes, etc.) from gradle effort. Attmept to fix Windows disk full issues

This is an automated email from the ASF dual-hosted git repository.

erick pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/master by this push:
     new 9c2e781  SOLR-13939: Extract any non-gradle related patches (deprecations, URL fixes, etc.) from gradle effort. Attmept to fix Windows disk full issues
9c2e781 is described below

commit 9c2e7819eecca48230ba623ab34cb9baf64901f5
Author: Erick Erickson <Er...@gmail.com>
AuthorDate: Wed Jul 15 21:03:01 2020 -0400

    SOLR-13939: Extract any non-gradle related patches (deprecations, URL fixes, etc.) from gradle effort. Attmept to fix Windows disk full issues
---
 .../apache/solr/cloud/ShardLeaderElectionContextBase.java    | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/cloud/ShardLeaderElectionContextBase.java b/solr/core/src/java/org/apache/solr/cloud/ShardLeaderElectionContextBase.java
index a9da3de..c97e4cf 100644
--- a/solr/core/src/java/org/apache/solr/cloud/ShardLeaderElectionContextBase.java
+++ b/solr/core/src/java/org/apache/solr/cloud/ShardLeaderElectionContextBase.java
@@ -19,10 +19,11 @@ package org.apache.solr.cloud;
 
 import java.io.IOException;
 import java.lang.invoke.MethodHandles;
-import java.nio.file.Paths;
 import java.util.List;
 import java.util.ArrayList;
 
+// DO NOT SUBSTITUTE java nio Path here, see SOLR-13939
+import org.apache.hadoop.fs.Path;
 import org.apache.solr.cloud.overseer.OverseerAction;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.SolrException.ErrorCode;
@@ -71,7 +72,8 @@ class ShardLeaderElectionContextBase extends ElectionContext {
     this.shardId = shardId;
     this.collection = collection;
 
-    String parent = Paths.get(leaderPath).getParent().toString();
+    // Fails on Windows if you use nio Paths.get here
+    String parent = new Path(leaderPath).getParent().toString();
     ZkCmdExecutor zcmd = new ZkCmdExecutor(30000);
     // only if /collections/{collection} exists already do we succeed in creating this path
     log.info("make sure parent is created {}", parent);
@@ -99,7 +101,8 @@ class ShardLeaderElectionContextBase extends ElectionContext {
           // version whenever a leader registers.
           log.debug("Removing leader registration node on cancel: {} {}", leaderPath, leaderZkNodeParentVersion);
           List<Op> ops = new ArrayList<>(2);
-          ops.add(Op.check(Paths.get(leaderPath).getParent().toString(), leaderZkNodeParentVersion));
+          // Fails on Windows if you use nio Paths.get here
+          ops.add(Op.check(new Path(leaderPath).getParent().toString(), leaderZkNodeParentVersion));
           ops.add(Op.delete(leaderPath, -1));
           zkClient.multi(ops, true);
         } catch (InterruptedException e) {
@@ -119,7 +122,8 @@ class ShardLeaderElectionContextBase extends ElectionContext {
       throws KeeperException, InterruptedException, IOException {
     // register as leader - if an ephemeral is already there, wait to see if it goes away
 
-    String parent = Paths.get(leaderPath).getParent().toString();
+    // Fails on Windows if you use nio Paths.get here
+    String parent = new Path(leaderPath).getParent().toString();
     try {
       RetryUtil.retryOnThrowable(NodeExistsException.class, 60000, 5000, () -> {
         synchronized (lock) {