You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by br...@apache.org on 2023/01/05 15:25:17 UTC

[solr] branch branch_9x updated: SOLR-16438: do not attempt to rebalance leaders if the shard id is not set.

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

broustant 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 41ddde6bd90 SOLR-16438: do not attempt to rebalance leaders if the shard id is not set.
41ddde6bd90 is described below

commit 41ddde6bd908a444757985dc9814400724a0274c
Author: Bruno Roustant <br...@gmail.com>
AuthorDate: Thu Jan 5 16:19:38 2023 +0100

    SOLR-16438: do not attempt to rebalance leaders if the shard id is not set.
---
 .../java/org/apache/solr/handler/admin/CollectionsHandler.java    | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java
index 750a43b985a..e1c95d98f6d 100644
--- a/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java
@@ -1978,14 +1978,16 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission
     private static class SplitShardHelper {
       static final CollectionOpCombiner OP_COMBINER =
           (op, req, h) -> {
-            if (!req.getParams()
-                .getBool(SPLIT_SET_PREFERRED_LEADERS, Boolean.getBoolean(AUTO_PREFERRED_LEADERS))) {
+            String shardName = req.getParams().get(SHARD_ID_PROP);
+            if (shardName == null
+                || !req.getParams()
+                    .getBool(
+                        SPLIT_SET_PREFERRED_LEADERS, Boolean.getBoolean(AUTO_PREFERRED_LEADERS))) {
               return Collections.singletonList(op);
             }
             // The split.setPreferredLeader prop is true.
             List<CollectionOperation> opSequence = new ArrayList<>();
             String collectionName = req.getParams().get(COLLECTION_PROP);
-            String shardName = req.getParams().get(SHARD_ID_PROP);
             DocCollection collection =
                 h.coreContainer
                     .getZkController()