You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ja...@apache.org on 2024/04/30 16:52:08 UTC

(solr) branch branch_9x updated: SOLR-6572 Trim whitespace for shards.tolerant and leaderUrl (#2311)

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

janhoy pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 8b4f57a4a6a SOLR-6572 Trim whitespace for shards.tolerant and leaderUrl (#2311)
8b4f57a4a6a is described below

commit 8b4f57a4a6a5cd67abb3408db2a2dc2860e36c54
Author: Jan Høydahl <ja...@apache.org>
AuthorDate: Tue Apr 30 18:48:55 2024 +0200

    SOLR-6572 Trim whitespace for shards.tolerant and leaderUrl (#2311)
    
    (cherry picked from commit 033be0fc1317b48992fb756aac7f8bd55731fc3b)
---
 solr/core/src/java/org/apache/solr/handler/IndexFetcher.java       | 1 +
 solr/solrj/src/java/org/apache/solr/common/params/ShardParams.java | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java b/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
index b06353fcaeb..b347565450a 100644
--- a/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
+++ b/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
@@ -328,6 +328,7 @@ public class IndexFetcher {
 
   private void setLeaderCoreUrl(String leaderCoreUrl) {
     if (leaderCoreUrl != null) {
+      leaderCoreUrl = leaderCoreUrl.trim();
       ClusterState clusterState =
           solrCore.getCoreContainer().getZkController() == null
               ? null
diff --git a/solr/solrj/src/java/org/apache/solr/common/params/ShardParams.java b/solr/solrj/src/java/org/apache/solr/common/params/ShardParams.java
index 8a6b87577ec..875b17c87fe 100644
--- a/solr/solrj/src/java/org/apache/solr/common/params/ShardParams.java
+++ b/solr/solrj/src/java/org/apache/solr/common/params/ShardParams.java
@@ -123,7 +123,7 @@ public interface ShardParams {
     if (null == shardsTolerantValue || shardsTolerantValue.equals(REQUIRE_ZK_CONNECTED)) {
       return false;
     } else {
-      return StrUtils.parseBool(shardsTolerantValue); // throw an exception if non-boolean
+      return StrUtils.parseBool(shardsTolerantValue.trim()); // throw an exception if non-boolean
     }
   }
 }