Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-16438: do not attempt to rebalance leaders if the shard id is not set.

Bruno Roustant57e73e4f9066
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 e986fa85f89..b7f23cf02c6 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
@@ -1972,14 +1972,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()