You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2021/03/10 09:56:11 UTC

[lucene] branch jira/solr-15130 created (now a96d8ba)

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

dweiss pushed a change to branch jira/solr-15130
in repository https://gitbox.apache.org/repos/asf/lucene.git.


      at a96d8ba  Merge branch 'master' into jira/solr-15130

This branch includes the following new commits:

     new 51aa6c3  SOLR-15130: WIP.
     new 2726b57  Merge branch 'jira/solr-15131' into jira/solr-15130
     new 9bd4c42  SOLR-15130: Support node_type per-collection node sets.
     new a96d8ba  Merge branch 'master' into jira/solr-15130

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[lucene] 03/04: SOLR-15130: Support node_type per-collection node sets.

Posted by dw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 9bd4c424323e7421de2ab091e12d7160eaa8947f
Author: Andrzej Bialecki <ab...@apache.org>
AuthorDate: Mon Feb 15 18:05:53 2021 +0100

    SOLR-15130: Support node_type per-collection node sets.
---
 .../cluster/placement/PlacementPluginConfig.java   |   2 +
 .../placement/plugins/AffinityPlacementConfig.java |  39 +++++++-
 .../plugins/AffinityPlacementFactory.java          |  46 ++-------
 .../apache/solr/cluster/placement/Builders.java    |   1 +
 .../plugins/AffinityPlacementFactoryTest.java      | 111 +++++++++++++++++++--
 5 files changed, 154 insertions(+), 45 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPluginConfig.java b/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPluginConfig.java
index fd5566d..758e5fe 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPluginConfig.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPluginConfig.java
@@ -25,4 +25,6 @@ import org.apache.solr.common.util.ReflectMapWriter;
  * annotated with {@link org.apache.solr.common.annotation.JsonProperty} if needed.
  */
 public interface PlacementPluginConfig extends ReflectMapWriter {
+
+    public static final String COLLECTION_PROPERTY_PREFIX = "placement.";
 }
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementConfig.java b/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementConfig.java
index eefd3f2..10eecd4 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementConfig.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementConfig.java
@@ -25,8 +25,43 @@ import org.apache.solr.common.annotation.JsonProperty;
  */
 public class AffinityPlacementConfig implements PlacementPluginConfig {
 
-  public static final String COLLECTION_NODE_TYPE_PROPERTY = "placement.affinity.node_type";
-  public static final String WITH_COLLECTION_PROPERTY = "placement.affinity.withCollection";
+  /**
+   * Collection property that defines a comma-separate list of required node types.
+   */
+  public static final String COLLECTION_NODE_TYPE_PROPERTY = COLLECTION_PROPERTY_PREFIX + "affinity.node_type";
+  /**
+   * Collection property that defines the secondary collection name to be co-located with
+   * this collection.
+   */
+  public static final String WITH_COLLECTION_PROPERTY = COLLECTION_PROPERTY_PREFIX + "affinity.withCollection";
+  /**
+   * <p>Name of the system property on a node indicating which (public cloud) Availability Zone that node is in. The value
+   * is any string, different strings denote different availability zones.
+   *
+   * <p>Nodes on which this system property is not defined are considered being in the same Availability Zone
+   * {@link #UNDEFINED_AVAILABILITY_ZONE} (hopefully the value of this constant is not the name of a real Availability Zone :).
+   */
+  public static final String AVAILABILITY_ZONE_SYSPROP = "availability_zone";
+  /**
+   * <p>Name of the system property on a node indicating the type of replicas allowed on that node.
+   * The value of that system property is a comma-separated list or a single string of value names of
+   * {@link org.apache.solr.cluster.Replica.ReplicaType} (case insensitive). If that property is not defined, that node is
+   * considered accepting all replica types (i.e. undefined is equivalent to {@code "NRT,Pull,tlog"}).
+   */
+  public static final String REPLICA_TYPE_SYSPROP = "replica_type";
+  /**
+   * Name of the system property on a node indicating the arbitrary "node type" (for example, a node
+   * more suitable for the indexing work load could be labeled as <code>node_type: indexing</code>).
+   * The value of this system property is a comma-separated list or a single label (labels must not
+   * contain commas), which represent a logical OR for the purpose of placement. Collections may
+   * indicate the required node types using the {@link AffinityPlacementConfig#COLLECTION_NODE_TYPE_PROPERTY},
+   * and replicas will be placed only on the nodes that match one of the types.
+   */
+  public static final String NODE_TYPE_SYSPROP = "node_type";
+  /**
+   * This is the "AZ" name for nodes that do not define an AZ. Should not match a real AZ name (I think we're safe)
+   */
+  public static final String UNDEFINED_AVAILABILITY_ZONE = "uNd3f1NeD";
 
   public static final long DEFAULT_MINIMAL_FREE_DISK_GB = 20L;
   public static final long DEFAULT_PRIORITIZED_FREE_DISK_GB = 100L;
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactory.java b/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactory.java
index 96ef754..fbcf70e 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactory.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactory.java
@@ -115,30 +115,6 @@ import java.util.stream.Collectors;
 public class AffinityPlacementFactory implements PlacementPluginFactory<AffinityPlacementConfig> {
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
-  /**
-   * <p>Name of the system property on a node indicating which (public cloud) Availability Zone that node is in. The value
-   * is any string, different strings denote different availability zones.
-   *
-   * <p>Nodes on which this system property is not defined are considered being in the same Availability Zone
-   * {@link #UNDEFINED_AVAILABILITY_ZONE} (hopefully the value of this constant is not the name of a real Availability Zone :).
-   */
-  public static final String AVAILABILITY_ZONE_SYSPROP = "availability_zone";
-
-  /**
-   * <p>Name of the system property on a node indicating the type of replicas allowed on that node.
-   * The value of that system property is a comma separated list or a single string of value names of
-   * {@link org.apache.solr.cluster.Replica.ReplicaType} (case insensitive). If that property is not defined, that node is
-   * considered accepting all replica types (i.e. undefined is equivalent to {@code "NRT,Pull,tlog"}).
-   */
-  public static final String REPLICA_TYPE_SYSPROP = "replica_type";
-
-  public static final String NODE_TYPE_SYSPROP = "node_type";
-
-  /**
-   * This is the "AZ" name for nodes that do not define an AZ. Should not match a real AZ name (I think we're safe)
-   */
-  public static final String UNDEFINED_AVAILABILITY_ZONE = "uNd3f1NeD";
-
   private AffinityPlacementConfig config = AffinityPlacementConfig.DEFAULT;
 
   /**
@@ -201,9 +177,9 @@ public class AffinityPlacementFactory implements PlacementPluginFactory<Affinity
       // Request all needed attributes
       AttributeFetcher attributeFetcher = placementContext.getAttributeFetcher();
       attributeFetcher
-          .requestNodeSystemProperty(AVAILABILITY_ZONE_SYSPROP)
-          .requestNodeSystemProperty(NODE_TYPE_SYSPROP)
-          .requestNodeSystemProperty(REPLICA_TYPE_SYSPROP);
+          .requestNodeSystemProperty(AffinityPlacementConfig.AVAILABILITY_ZONE_SYSPROP)
+          .requestNodeSystemProperty(AffinityPlacementConfig.NODE_TYPE_SYSPROP)
+          .requestNodeSystemProperty(AffinityPlacementConfig.REPLICA_TYPE_SYSPROP);
       attributeFetcher
           .requestNodeMetric(NodeMetricImpl.NUM_CORES)
           .requestNodeMetric(NodeMetricImpl.FREE_DISK_GB);
@@ -359,13 +335,13 @@ public class AffinityPlacementFactory implements PlacementPluginFactory<Affinity
     }
 
     /**
-     * Resolves the AZ of a node and takes care of nodes that have no defined AZ in system property {@link #AVAILABILITY_ZONE_SYSPROP}
-     * to then return {@link #UNDEFINED_AVAILABILITY_ZONE} as the AZ name.
+     * Resolves the AZ of a node and takes care of nodes that have no defined AZ in system property {@link AffinityPlacementConfig#AVAILABILITY_ZONE_SYSPROP}
+     * to then return {@link AffinityPlacementConfig#UNDEFINED_AVAILABILITY_ZONE} as the AZ name.
      */
     private String getNodeAZ(Node n, final AttributeValues attrValues) {
-      Optional<String> nodeAz = attrValues.getSystemProperty(n, AVAILABILITY_ZONE_SYSPROP);
+      Optional<String> nodeAz = attrValues.getSystemProperty(n, AffinityPlacementConfig.AVAILABILITY_ZONE_SYSPROP);
       // All nodes with undefined AZ will be considered part of the same AZ. This also works for deployments that do not care about AZ's
-      return nodeAz.orElse(UNDEFINED_AVAILABILITY_ZONE);
+      return nodeAz.orElse(AffinityPlacementConfig.UNDEFINED_AVAILABILITY_ZONE);
     }
 
     /**
@@ -399,7 +375,7 @@ public class AffinityPlacementFactory implements PlacementPluginFactory<Affinity
      * as it would not be possible to make any meaningful placement decisions.
      *
      * @param nodes      all nodes on which this plugin should compute placement
-     * @param attrValues attributes fetched for the nodes. This method uses system property {@link #REPLICA_TYPE_SYSPROP} as
+     * @param attrValues attributes fetched for the nodes. This method uses system property {@link AffinityPlacementConfig#REPLICA_TYPE_SYSPROP} as
      *                   well as the number of cores on each node.
      */
     private Pair<EnumMap<Replica.ReplicaType, Set<Node>>, Map<Node, Integer>> getNodesPerReplicaType(Set<Node> nodes, final AttributeValues attrValues) {
@@ -437,7 +413,7 @@ public class AffinityPlacementFactory implements PlacementPluginFactory<Affinity
         Integer coresCount = attrValues.getNodeMetric(node, NodeMetricImpl.NUM_CORES).get();
         coresOnNodes.put(node, coresCount);
 
-        String supportedReplicaTypes = attrValues.getSystemProperty(node, REPLICA_TYPE_SYSPROP).isPresent() ? attrValues.getSystemProperty(node, REPLICA_TYPE_SYSPROP).get() : null;
+        String supportedReplicaTypes = attrValues.getSystemProperty(node, AffinityPlacementConfig.REPLICA_TYPE_SYSPROP).isPresent() ? attrValues.getSystemProperty(node, AffinityPlacementConfig.REPLICA_TYPE_SYSPROP).get() : null;
         // If property not defined or is only whitespace on a node, assuming node can take any replica type
         if (supportedReplicaTypes == null || supportedReplicaTypes.isBlank()) {
           for (Replica.ReplicaType rt : Replica.ReplicaType.values()) {
@@ -667,11 +643,11 @@ public class AffinityPlacementFactory implements PlacementPluginFactory<Affinity
       Set<String> collNodeTypes = Set.copyOf(StrUtils.splitSmart(collProperty, ','));
       Set<Node> filteredNodes = initialNodes.stream()
           .filter(n -> {
-            Optional<String> nodePropOpt = attributeValues.getSystemProperty(n, AffinityPlacementConfig.COLLECTION_NODE_TYPE_PROPERTY);
+            Optional<String> nodePropOpt = attributeValues.getSystemProperty(n, AffinityPlacementConfig.NODE_TYPE_SYSPROP);
             if (!nodePropOpt.isPresent()) {
               return false;
             }
-            Set<String> nodeTypes = Set.copyOf(StrUtils.splitSmart(nodePropOpt.get(), ','));
+            Set<String> nodeTypes = new HashSet<>(StrUtils.splitSmart(nodePropOpt.get(), ','));
             nodeTypes.retainAll(collNodeTypes);
             return !nodeTypes.isEmpty();
           }).collect(Collectors.toSet());
diff --git a/solr/core/src/test/org/apache/solr/cluster/placement/Builders.java b/solr/core/src/test/org/apache/solr/cluster/placement/Builders.java
index 43de56e..d31ba45 100644
--- a/solr/core/src/test/org/apache/solr/cluster/placement/Builders.java
+++ b/solr/core/src/test/org/apache/solr/cluster/placement/Builders.java
@@ -55,6 +55,7 @@ public class Builders {
         NodeBuilder nodeBuilder = new NodeBuilder().setNodeName("node_" + n); // Default name, can be changed
         nodeBuilder.setTotalDiskGB(10000.0);
         nodeBuilder.setFreeDiskGB(5000.0);
+        nodeBuilder.setCoreCount(0);
         nodeBuilders.add(nodeBuilder);
       }
       return this;
diff --git a/solr/core/src/test/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactoryTest.java b/solr/core/src/test/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactoryTest.java
index 877f0d5..b421ea3 100644
--- a/solr/core/src/test/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactoryTest.java
+++ b/solr/core/src/test/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactoryTest.java
@@ -28,6 +28,7 @@ import org.apache.solr.cluster.placement.Builders;
 import org.apache.solr.cluster.placement.impl.ModificationRequestImpl;
 import org.apache.solr.cluster.placement.impl.PlacementRequestImpl;
 import org.apache.solr.common.util.Pair;
+import org.apache.solr.common.util.StrUtils;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -296,8 +297,8 @@ public class AffinityPlacementFactoryTest extends SolrTestCaseJ4 {
         acceptedReplicaType = NRT_REPLICA_TYPE;
       }
 
-      nodeBuilders.get(i).setSysprop(AffinityPlacementFactory.AVAILABILITY_ZONE_SYSPROP, az)
-          .setSysprop(AffinityPlacementFactory.REPLICA_TYPE_SYSPROP, acceptedReplicaType)
+      nodeBuilders.get(i).setSysprop(AffinityPlacementConfig.AVAILABILITY_ZONE_SYSPROP, az)
+          .setSysprop(AffinityPlacementConfig.REPLICA_TYPE_SYSPROP, acceptedReplicaType)
           .setCoreCount(numcores)
           .setFreeDiskGB(freedisk);
     }
@@ -348,7 +349,7 @@ public class AffinityPlacementFactoryTest extends SolrTestCaseJ4 {
     Builders.ClusterBuilder clusterBuilder = Builders.newClusterBuilder().initializeLiveNodes(9);
     LinkedList<Builders.NodeBuilder> nodeBuilders = clusterBuilder.getLiveNodeBuilders();
     for (int i = 0; i < 9; i++) {
-      nodeBuilders.get(i).setSysprop(AffinityPlacementFactory.AVAILABILITY_ZONE_SYSPROP, "AZ" + (i / 3))
+      nodeBuilders.get(i).setSysprop(AffinityPlacementConfig.AVAILABILITY_ZONE_SYSPROP, "AZ" + (i / 3))
           .setCoreCount(i)
           .setFreeDiskGB((double)(PRIORITIZED_FREE_DISK_GB + 10));
     }
@@ -498,9 +499,9 @@ public class AffinityPlacementFactoryTest extends SolrTestCaseJ4 {
       nodeBuilder.setCoreCount(0);
       nodeBuilder.setFreeDiskGB(100.0);
       if (i < NUM_NODES / 2) {
-        nodeBuilder.setSysprop(AffinityPlacementFactory.AVAILABILITY_ZONE_SYSPROP, "az1");
+        nodeBuilder.setSysprop(AffinityPlacementConfig.AVAILABILITY_ZONE_SYSPROP, "az1");
       } else {
-        nodeBuilder.setSysprop(AffinityPlacementFactory.AVAILABILITY_ZONE_SYSPROP, "az2");
+        nodeBuilder.setSysprop(AffinityPlacementConfig.AVAILABILITY_ZONE_SYSPROP, "az2");
       }
     }
 
@@ -525,7 +526,7 @@ public class AffinityPlacementFactoryTest extends SolrTestCaseJ4 {
     Map<Replica.ReplicaType, Map<String, Map<String, AtomicInteger>>> replicas = new HashMap<>();
     AttributeValues attributeValues = placementContext.getAttributeFetcher().fetchAttributes();
     for (ReplicaPlacement rp : pp.getReplicaPlacements()) {
-      Optional<String> azOptional = attributeValues.getSystemProperty(rp.getNode(), AffinityPlacementFactory.AVAILABILITY_ZONE_SYSPROP);
+      Optional<String> azOptional = attributeValues.getSystemProperty(rp.getNode(), AffinityPlacementConfig.AVAILABILITY_ZONE_SYSPROP);
       if (!azOptional.isPresent()) {
         fail("missing AZ sysprop for node " + rp.getNode());
       }
@@ -555,10 +556,10 @@ public class AffinityPlacementFactoryTest extends SolrTestCaseJ4 {
       nodeBuilder.setCoreCount(0);
       nodeBuilder.setFreeDiskGB(100.0);
       if (i < NUM_NODES / 3 * 2) {
-        nodeBuilder.setSysprop(AffinityPlacementFactory.REPLICA_TYPE_SYSPROP, "Nrt, TlOg");
+        nodeBuilder.setSysprop(AffinityPlacementConfig.REPLICA_TYPE_SYSPROP, "Nrt, TlOg");
         nodeBuilder.setSysprop("group", "one");
       } else {
-        nodeBuilder.setSysprop(AffinityPlacementFactory.REPLICA_TYPE_SYSPROP, "Pull,foobar");
+        nodeBuilder.setSysprop(AffinityPlacementConfig.REPLICA_TYPE_SYSPROP, "Pull,foobar");
         nodeBuilder.setSysprop("group", "two");
       }
     }
@@ -743,6 +744,100 @@ public class AffinityPlacementFactoryTest extends SolrTestCaseJ4 {
     }
   }
 
+  @Test
+  public void testNodeType() throws Exception {
+    Builders.ClusterBuilder clusterBuilder = Builders.newClusterBuilder().initializeLiveNodes(9);
+    LinkedList<Builders.NodeBuilder> nodeBuilders = clusterBuilder.getLiveNodeBuilders();
+    for (int i = 0; i < 9; i++) {
+      nodeBuilders.get(i).setSysprop(AffinityPlacementConfig.NODE_TYPE_SYSPROP, "type_" + (i % 3));
+    }
+
+    String collectionName = "nodeTypeCollection";
+    Builders.CollectionBuilder collectionBuilder = Builders.newCollectionBuilder(collectionName);
+    collectionBuilder.initializeShardsReplicas(1, 0, 0, 0, clusterBuilder.getLiveNodeBuilders());
+
+    // test single node type in collection
+    collectionBuilder.addCustomProperty(AffinityPlacementConfig.COLLECTION_NODE_TYPE_PROPERTY, "type_0");
+    clusterBuilder.addCollection(collectionBuilder);
+
+    PlacementContext placementContext = clusterBuilder.buildPlacementContext();
+    Map<String, Set<String>> nodeNamesByType = new HashMap<>();
+    Cluster cluster = placementContext.getCluster();
+    AttributeValues attributeValues = placementContext.getAttributeFetcher()
+            .requestNodeSystemProperty(AffinityPlacementConfig.NODE_TYPE_SYSPROP)
+            .fetchAttributes();
+    placementContext.getCluster().getLiveNodes().forEach(n ->
+            nodeNamesByType
+                    .computeIfAbsent(attributeValues.getSystemProperty(n, AffinityPlacementConfig.NODE_TYPE_SYSPROP).get(), type -> new HashSet<>())
+                    .add(n.getName())
+    );
+    SolrCollection collection = placementContext.getCluster().getCollection(collectionName);
+    PlacementRequestImpl placementRequest = new PlacementRequestImpl(collection,
+            Set.of("shard1"), placementContext.getCluster().getLiveNodes(), 3, 0, 0);
+
+    PlacementPlan pp = plugin.computePlacement(placementRequest, placementContext);
+    assertEquals("expected 3 placements: " + pp, 3, pp.getReplicaPlacements().size());
+    Set<String> type0nodes = nodeNamesByType.get("type_0");
+    Set<String> type1nodes = nodeNamesByType.get("type_1");
+    Set<String> type2nodes = nodeNamesByType.get("type_2");
+
+    for (ReplicaPlacement p : pp.getReplicaPlacements()) {
+      assertTrue(type0nodes.contains(p.getNode().getName()));
+    }
+
+    // test 2 node types in collection
+    collectionBuilder.addCustomProperty(AffinityPlacementConfig.COLLECTION_NODE_TYPE_PROPERTY, "type_0,type_1");
+    placementContext = clusterBuilder.buildPlacementContext();
+    collection = placementContext.getCluster().getCollection(collectionName);
+    placementRequest = new PlacementRequestImpl(collection,
+            Set.of("shard1"), placementContext.getCluster().getLiveNodes(), 6, 0, 0);
+
+    pp = plugin.computePlacement(placementRequest, placementContext);
+    assertEquals("expected 6 placements: " + pp, 6, pp.getReplicaPlacements().size());
+    for (ReplicaPlacement p : pp.getReplicaPlacements()) {
+      assertTrue(type0nodes.contains(p.getNode().getName()) ||
+              type1nodes.contains(p.getNode().getName()));
+    }
+
+    // test 2 node types in nodes
+    for (int i = 0; i < 9; i++) {
+      if (i < 3) {
+        nodeBuilders.get(i).setSysprop(AffinityPlacementConfig.NODE_TYPE_SYSPROP, "type_0,type_1");
+      } else if (i < 6) {
+        nodeBuilders.get(i).setSysprop(AffinityPlacementConfig.NODE_TYPE_SYSPROP, "type_1,type_2");
+      } else {
+        nodeBuilders.get(i).setSysprop(AffinityPlacementConfig.NODE_TYPE_SYSPROP, "type_2");
+      }
+    }
+    collectionBuilder.addCustomProperty(AffinityPlacementConfig.COLLECTION_NODE_TYPE_PROPERTY, "type_0,type_1");
+    placementContext = clusterBuilder.buildPlacementContext();
+    collection = placementContext.getCluster().getCollection(collectionName);
+    placementRequest = new PlacementRequestImpl(collection,
+            Set.of("shard1"), placementContext.getCluster().getLiveNodes(), 6, 0, 0);
+    pp = plugin.computePlacement(placementRequest, placementContext);
+    assertEquals("expected 6 placements: " + pp, 6, pp.getReplicaPlacements().size());
+    nodeNamesByType.clear();
+    AttributeValues attributeValues2 = placementContext.getAttributeFetcher()
+            .requestNodeSystemProperty(AffinityPlacementConfig.NODE_TYPE_SYSPROP)
+            .fetchAttributes();
+    placementContext.getCluster().getLiveNodes().forEach(n -> {
+      String nodeTypesStr = attributeValues2.getSystemProperty(n, AffinityPlacementConfig.NODE_TYPE_SYSPROP).get();
+      for (String nodeType : StrUtils.splitSmart(nodeTypesStr, ',')) {
+        nodeNamesByType
+                .computeIfAbsent(nodeType, type -> new HashSet<>())
+                .add(n.getName());
+      }
+    });
+    type0nodes = nodeNamesByType.get("type_0");
+    type1nodes = nodeNamesByType.get("type_1");
+
+    for (ReplicaPlacement p : pp.getReplicaPlacements()) {
+      assertTrue(type0nodes.contains(p.getNode().getName()) ||
+              type1nodes.contains(p.getNode().getName()));
+    }
+
+  }
+
   @Test @Slow
   public void testScalability() throws Exception {
     log.info("==== numNodes ====");


[lucene] 02/04: Merge branch 'jira/solr-15131' into jira/solr-15130

Posted by dw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 2726b5790205e47bf69a4dfca923fbfc269afe89
Merge: 51aa6c3 76c7057
Author: Andrzej Bialecki <ab...@apache.org>
AuthorDate: Wed Feb 10 16:32:31 2021 +0100

    Merge branch 'jira/solr-15131' into jira/solr-15130

 .../apache/lucene/missingdoclet/MissingDoclet.java |  13 +-
 lucene/CHANGES.txt                                 |   4 +-
 .../lucene/analysis/hunspell/Dictionary.java       | 143 ++++---
 .../analysis/hunspell/GeneratingSuggester.java     | 469 +++++++++++++++++++++
 .../analysis/hunspell/ModifyingSuggester.java      |  57 ++-
 .../lucene/analysis/hunspell/SpellChecker.java     | 106 +++--
 .../apache/lucene/analysis/hunspell/Stemmer.java   | 117 +++--
 .../lucene/analysis/hunspell/SpellCheckerTest.java |  12 +
 .../analysis/hunspell/TestAllDictionaries.java     |   4 +
 .../lucene/analysis/hunspell/TestDictionary.java   |   2 +-
 .../apache/lucene/analysis/hunspell/allcaps.sug    |   3 +
 .../apache/lucene/analysis/hunspell/base_utf.sug   |  13 +
 .../lucene/analysis/hunspell/checksharps.sug       |   1 +
 .../lucene/analysis/hunspell/forgivable-errors.aff |   8 +-
 .../lucene/analysis/hunspell/forgivable-errors.dic |   2 +
 .../org/apache/lucene/analysis/hunspell/i58202.aff |   4 +
 .../org/apache/lucene/analysis/hunspell/i58202.dic |   5 +
 .../apache/lucene/analysis/hunspell/i58202.good    |  10 +
 .../org/apache/lucene/analysis/hunspell/i58202.sug |  13 +
 .../apache/lucene/analysis/hunspell/i58202.wrong   |  13 +
 .../apache/lucene/analysis/hunspell/keepcase.sug   |   8 +
 .../org/apache/lucene/analysis/hunspell/oconv.aff  |  20 +
 .../org/apache/lucene/analysis/hunspell/oconv.dic  |   4 +
 .../org/apache/lucene/analysis/hunspell/oconv.good |   2 +
 .../org/apache/lucene/analysis/hunspell/oconv.sug  |   3 +
 .../apache/lucene/analysis/hunspell/oconv.wrong    |   3 +
 .../apache/lucene/analysis/hunspell/wordpair.aff   |   4 +
 .../apache/lucene/analysis/hunspell/wordpair.dic   |   4 +
 .../apache/lucene/analysis/hunspell/wordpair.good  |   3 +
 .../apache/lucene/analysis/hunspell/wordpair.wrong |   1 +
 .../lucene50/Lucene50CompoundFormat.java           |  56 +--
 .../lucene50/Lucene50CompoundReader.java           |   2 +-
 .../backward_codecs/lucene70/Lucene70Codec.java    |   4 +-
 .../backward_codecs/lucene80/Lucene80Codec.java    |   2 +-
 .../backward_codecs/lucene84/Lucene84Codec.java    |   4 +-
 .../backward_codecs/lucene86/Lucene86Codec.java    |   4 +-
 .../backward_codecs/lucene87/Lucene87Codec.java    |   4 +-
 .../backward_codecs/Lucene87/Lucene87RWCodec.java} |  16 +-
 .../lucene50/Lucene50RWCompoundFormat.java}        |   6 +-
 .../lucene50/TestLucene50CompoundFormat.java       |   8 +-
 .../backward_codecs/lucene70/Lucene70RWCodec.java  |   7 +
 .../backward_codecs/lucene84/Lucene84RWCodec.java  |   7 +
 .../backward_codecs/lucene86/Lucene86RWCodec.java  |   7 +
 .../lucene/codecs/lucene90/Lucene90Codec.java      |   3 +-
 .../Lucene90CompoundFormat.java}                   |  14 +-
 .../Lucene90CompoundReader.java}                   |  22 +-
 .../lucene/codecs/lucene90/package-info.java       |   2 +-
 .../TestLucene90CompoundFormat.java}               |   4 +-
 .../TestLucene90FieldInfosFormat.java}             |  10 +-
 .../apache/lucene/queries/intervals/Intervals.java |  10 +
 .../MinimumShouldMatchIntervalsSource.java         |   1 +
 .../queries/intervals/NoMatchIntervalsSource.java  |  75 ++++
 .../lucene/queries/intervals/TestIntervals.java    |  21 +
 .../queries/intervals/TestSimplifications.java     |   9 +
 solr/CHANGES.txt                                   |   4 +-
 .../solr/cloud/api/collections/BackupCmd.java      |   5 +
 .../cloud/api/collections/CreateCollectionCmd.java |   1 +
 .../org/apache/solr/cluster/SolrCollection.java    |   2 +-
 .../impl/SimpleClusterAbstractionsImpl.java        |  36 +-
 .../placement/plugins/AffinityPlacementConfig.java |  30 +-
 .../plugins/AffinityPlacementFactory.java          |  51 +--
 .../java/org/apache/solr/core/CoreContainer.java   |   4 +-
 .../repository/LocalFileSystemRepository.java      |  12 +
 .../java/org/apache/solr/handler/CatStream.java    |  11 +-
 .../java/org/apache/solr/handler/ClusterAPI.java   |  14 +-
 .../org/apache/solr/handler/CollectionsAPI.java    | 177 +++++++-
 .../solr/handler/admin/CollectionsHandler.java     |   3 +-
 .../org/apache/solr/servlet/QueryRateLimiter.java  |   8 +-
 .../cloud/api/collections/TestCollectionAPI.java   |   7 +-
 .../impl/PlacementPluginIntegrationTest.java       |   8 +-
 .../plugins/AffinityPlacementFactoryTest.java      |   5 +-
 .../solr/handler/TestIncrementalCoreBackup.java    |   2 +
 .../solr/handler/admin/TestCollectionAPIs.java     |   4 +-
 .../handler/admin/V2CollectionsAPIMappingTest.java | 293 +++++++++++++
 .../src/replica-placement-plugins.adoc             |  44 +-
 .../solrj/request/CollectionAdminRequest.java      |  51 +--
 .../client/solrj/request/CollectionApiMapping.java |  74 +---
 ...onfigInfo.java => BackupCollectionPayload.java} |  40 +-
 ...lusterPropInfo.java => ClusterPropPayload.java} |  10 +-
 .../solrj/request/beans/CreateAliasPayload.java    |  79 ++++
 ...ateConfigInfo.java => CreateConfigPayload.java} |   2 +-
 .../{ClusterPropInfo.java => CreatePayload.java}   |  54 ++-
 ...eateConfigInfo.java => DeleteAliasPayload.java} |  14 +-
 ...ateLimiterMeta.java => RateLimiterPayload.java} |  10 +-
 ...nfigInfo.java => RestoreCollectionPayload.java} |  39 +-
 ...onfigInfo.java => SetAliasPropertyPayload.java} |  19 +-
 .../client/solrj/request/beans/V2ApiConstants.java |  55 +++
 .../solr/common/params/CollectionAdminParams.java  |   5 +
 .../resources/apispec/collections.Commands.json    | 298 -------------
 .../solrj/io/stream/StreamExpressionTest.java      |  38 +-
 .../client/solrj/request/TestV1toV2ApiMapper.java  |  26 +-
 .../apache/solr/common/util/JsonValidatorTest.java |  52 +--
 92 files changed, 2008 insertions(+), 928 deletions(-)

diff --cc solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementConfig.java
index 062750a,bc660ea..eefd3f2
--- a/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementConfig.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementConfig.java
@@@ -29,7 -25,7 +25,8 @@@ import org.apache.solr.common.annotatio
   */
  public class AffinityPlacementConfig implements PlacementPluginConfig {
  
-   public static final String COLLECTION_NODE_TYPE_PROPERTY = CollectionAdminParams.PROPERTY_PREFIX + "placement.affinity.node_type";
++  public static final String COLLECTION_NODE_TYPE_PROPERTY = "placement.affinity.node_type";
+   public static final String WITH_COLLECTION_PROPERTY = "placement.affinity.withCollection";
  
    public static final long DEFAULT_MINIMAL_FREE_DISK_GB = 20L;
    public static final long DEFAULT_PRIORITIZED_FREE_DISK_GB = 100L;
diff --cc solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactory.java
index 64aa9d5,d129b5b..96ef754
--- a/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactory.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactory.java
@@@ -641,10 -623,10 +632,10 @@@ public class AffinityPlacementFactory i
        }
      }
  
 -    private Set<Node> filterNodesWithCollection(Cluster cluster, PlacementRequest request, Set<Node> initialNodes) throws PlacementException {
 +    private Set<Node> filterNodesWithCollection(Cluster cluster, PlacementRequest request, AttributeValues attributeValues, Set<Node> initialNodes) throws PlacementException {
        // if there's a `withCollection` constraint for this collection then remove nodes
        // that are not eligible
-       String withCollectionName = withCollections.get(request.getCollection().getName());
+       String withCollectionName = request.getCollection().getCustomProperty(AffinityPlacementConfig.WITH_COLLECTION_PROPERTY);
        if (withCollectionName == null) {
          return initialNodes;
        }


[lucene] 01/04: SOLR-15130: WIP.

Posted by dw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 51aa6c331e08d8d7e71b65c9baee17c2a3ba5638
Author: Andrzej Bialecki <ab...@apache.org>
AuthorDate: Mon Feb 8 15:25:28 2021 +0100

    SOLR-15130: WIP.
---
 .../placement/plugins/AffinityPlacementConfig.java |  3 ++
 .../plugins/AffinityPlacementFactory.java          | 40 +++++++++++++++++++---
 2 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementConfig.java b/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementConfig.java
index d9579bc..062750a 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementConfig.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementConfig.java
@@ -19,6 +19,7 @@ package org.apache.solr.cluster.placement.plugins;
 
 import org.apache.solr.cluster.placement.PlacementPluginConfig;
 import org.apache.solr.common.annotation.JsonProperty;
+import org.apache.solr.common.params.CollectionAdminParams;
 
 import java.util.Map;
 import java.util.Objects;
@@ -28,6 +29,8 @@ import java.util.Objects;
  */
 public class AffinityPlacementConfig implements PlacementPluginConfig {
 
+  public static final String COLLECTION_NODE_TYPE_PROPERTY = CollectionAdminParams.PROPERTY_PREFIX + "placement.affinity.node_type";
+
   public static final long DEFAULT_MINIMAL_FREE_DISK_GB = 20L;
   public static final long DEFAULT_PRIORITIZED_FREE_DISK_GB = 100L;
 
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactory.java b/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactory.java
index eaec4ab..64aa9d5 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactory.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactory.java
@@ -23,6 +23,7 @@ import org.apache.solr.cluster.*;
 import org.apache.solr.cluster.placement.*;
 import org.apache.solr.cluster.placement.impl.NodeMetricImpl;
 import org.apache.solr.common.util.Pair;
+import org.apache.solr.common.util.StrUtils;
 import org.apache.solr.common.util.SuppressForbidden;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -131,6 +132,8 @@ public class AffinityPlacementFactory implements PlacementPluginFactory<Affinity
    */
   public static final String REPLICA_TYPE_SYSPROP = "replica_type";
 
+  public static final String NODE_TYPE_SYSPROP = "node_type";
+
   /**
    * This is the "AZ" name for nodes that do not define an AZ. Should not match a real AZ name (I think we're safe)
    */
@@ -210,17 +213,23 @@ public class AffinityPlacementFactory implements PlacementPluginFactory<Affinity
       Set<Node> nodes = request.getTargetNodes();
       SolrCollection solrCollection = request.getCollection();
 
-      nodes = filterNodesWithCollection(placementContext.getCluster(), request, nodes);
-
       // Request all needed attributes
       AttributeFetcher attributeFetcher = placementContext.getAttributeFetcher();
-      attributeFetcher.requestNodeSystemProperty(AVAILABILITY_ZONE_SYSPROP).requestNodeSystemProperty(REPLICA_TYPE_SYSPROP);
+      attributeFetcher
+          .requestNodeSystemProperty(AVAILABILITY_ZONE_SYSPROP)
+          .requestNodeSystemProperty(NODE_TYPE_SYSPROP)
+          .requestNodeSystemProperty(REPLICA_TYPE_SYSPROP);
       attributeFetcher
           .requestNodeMetric(NodeMetricImpl.NUM_CORES)
           .requestNodeMetric(NodeMetricImpl.FREE_DISK_GB);
       attributeFetcher.fetchFrom(nodes);
       final AttributeValues attrValues = attributeFetcher.fetchAttributes();
 
+      // filter out nodes that don't meet the `withCollection` constraint
+      nodes = filterNodesWithCollection(placementContext.getCluster(), request, attrValues, nodes);
+      // filter out nodes that don't match the "node types" specified in the collection props
+      nodes = filterNodesByNodeType(placementContext.getCluster(), request, attrValues, nodes);
+
       // Split the set of nodes into 3 sets of nodes accepting each replica type (sets can overlap if nodes accept multiple replica types)
       // These subsets sets are actually maps, because we capture the number of cores (of any replica type) present on each node.
       // Also get the number of currently existing cores per node, so we can keep update as we place new cores to not end up
@@ -632,7 +641,7 @@ public class AffinityPlacementFactory implements PlacementPluginFactory<Affinity
       }
     }
 
-    private Set<Node> filterNodesWithCollection(Cluster cluster, PlacementRequest request, Set<Node> initialNodes) throws PlacementException {
+    private Set<Node> filterNodesWithCollection(Cluster cluster, PlacementRequest request, AttributeValues attributeValues, Set<Node> initialNodes) throws PlacementException {
       // if there's a `withCollection` constraint for this collection then remove nodes
       // that are not eligible
       String withCollectionName = withCollections.get(request.getCollection().getName());
@@ -658,6 +667,29 @@ public class AffinityPlacementFactory implements PlacementPluginFactory<Affinity
       return filteredNodes;
     }
 
+    private Set<Node> filterNodesByNodeType(Cluster cluster, PlacementRequest request, AttributeValues attributeValues, Set<Node> initialNodes) throws PlacementException {
+      String collProperty = request.getCollection().getCustomProperty(AffinityPlacementConfig.COLLECTION_NODE_TYPE_PROPERTY);
+      if (collProperty == null) {
+        // no filtering by node type
+        return initialNodes;
+      }
+      Set<String> collNodeTypes = Set.copyOf(StrUtils.splitSmart(collProperty, ','));
+      Set<Node> filteredNodes = initialNodes.stream()
+          .filter(n -> {
+            Optional<String> nodePropOpt = attributeValues.getSystemProperty(n, AffinityPlacementConfig.COLLECTION_NODE_TYPE_PROPERTY);
+            if (!nodePropOpt.isPresent()) {
+              return false;
+            }
+            Set<String> nodeTypes = Set.copyOf(StrUtils.splitSmart(nodePropOpt.get(), ','));
+            nodeTypes.retainAll(collNodeTypes);
+            return !nodeTypes.isEmpty();
+          }).collect(Collectors.toSet());
+      if (filteredNodes.isEmpty()) {
+        throw new PlacementException("There are no nodes with types: " + collNodeTypes + " expected by collection " + request.getCollection().getName());
+      }
+      return filteredNodes;
+    }
+
     /**
      * Comparator implementing the placement strategy based on free space and number of cores: we want to place new replicas
      * on nodes with the less number of cores, but only if they do have enough disk space (expressed as a threshold value).


[lucene] 04/04: Merge branch 'master' into jira/solr-15130

Posted by dw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit a96d8ba0dc70d89735de61d09dcc9a4edddaddf6
Merge: 9bd4c42 227ef3b
Author: Andrzej Bialecki <ab...@apache.org>
AuthorDate: Mon Feb 15 18:07:29 2021 +0100

    Merge branch 'master' into jira/solr-15130

 build.gradle                                       |   1 +
 gradle/ant-compat/folder-layout.gradle             |  20 +
 gradle/documentation/render-javadoc.gradle         |   2 -
 gradle/generation/icu.gradle                       | 210 ++++++
 gradle/validation/forbidden-apis.gradle            |  17 +
 gradle/validation/rat-sources.gradle               |  10 +-
 lucene/CHANGES.txt                                 |   4 +-
 .../lucene/analysis/hunspell/Dictionary.java       |  37 +-
 .../analysis/hunspell/GeneratingSuggester.java     |  61 +-
 .../hunspell/{SpellChecker.java => Hunspell.java}  | 106 ++-
 .../analysis/hunspell/ModifyingSuggester.java      |   4 +-
 .../org/apache/lucene/analysis/hunspell/Root.java} |  39 +-
 .../apache/lucene/analysis/hunspell/Stemmer.java   |  44 +-
 .../lucene/analysis/hunspell/package-info.java     |   6 +-
 .../analysis/hunspell/TestAllDictionaries.java     |  52 +-
 .../lucene/analysis/hunspell/TestDutchIJ.java      |   1 -
 .../hunspell/TestHunspellRepositoryTestCases.java  |   7 +-
 .../lucene/analysis/hunspell/TestPerformance.java  |   2 +-
 ...pellCheckerTest.java => TestSpellChecking.java} |  22 +-
 .../lucene/analysis/hunspell/forbiddenword.aff     |  11 +
 .../lucene/analysis/hunspell/forbiddenword.dic     |  11 +
 .../lucene/analysis/hunspell/forbiddenword.good    |   3 +
 .../lucene/analysis/hunspell/forbiddenword.wrong   |   4 +
 .../apache/lucene/analysis/hunspell/forceucase.sug |   2 +
 .../apache/lucene/analysis/hunspell/nosuggest.aff  |   5 +
 .../apache/lucene/analysis/hunspell/nosuggest.dic  |   3 +
 .../apache/lucene/analysis/hunspell/nosuggest.good |   3 +
 .../apache/lucene/analysis/hunspell/nosuggest.sug  |   0
 .../lucene/analysis/hunspell/nosuggest.wrong       |   3 +
 .../analysis/hunspell/opentaal_forbiddenword1.aff  |   9 +
 .../analysis/hunspell/opentaal_forbiddenword1.dic  |   5 +
 .../analysis/hunspell/opentaal_forbiddenword1.good |   3 +
 .../analysis/hunspell/opentaal_forbiddenword1.sug  |   1 +
 .../hunspell/opentaal_forbiddenword1.wrong         |   5 +
 .../analysis/hunspell/opentaal_forbiddenword2.aff  |   7 +
 .../analysis/hunspell/opentaal_forbiddenword2.dic  |   5 +
 .../analysis/hunspell/opentaal_forbiddenword2.good |   4 +
 .../analysis/hunspell/opentaal_forbiddenword2.sug  |   1 +
 .../hunspell/opentaal_forbiddenword2.wrong         |   5 +
 .../analysis/standard/GenerateJflexTLDMacros.java  |  16 +-
 .../analysis/icu/GenerateUTR30DataFiles.java       |  97 +--
 .../lucene/analysis/icu/RBBIRuleCompiler.java      |  51 +-
 .../codecs/lucene86/Lucene86PointsFormat.java      |   5 +-
 .../codecs/lucene90/Lucene90FieldInfosFormat.java  |   8 +-
 .../codecs/lucene90/Lucene90VectorWriter.java      |  15 +-
 .../java/org/apache/lucene/document/FieldType.java |   3 +-
 .../java/org/apache/lucene/index/CodecReader.java  |  15 +
 .../org/apache/lucene/index/ReadersAndUpdates.java |   4 +-
 .../codecs/lucene90/TestLucene90VectorFormat.java} |  19 +-
 .../lucene/index/BaseFieldInfoFormatTestCase.java  |  55 +-
 .../lucene/index/BaseVectorFormatTestCase.java}    | 150 ++--
 solr/CHANGES.txt                                   |  22 +-
 .../org/apache/solr/ltr/model/LTRScoringModel.java |   2 +-
 .../org/apache/solr/ltr/model/LinearModel.java     |   4 +-
 .../solr/ltr/store/rest/ManagedModelStore.java     |  17 +-
 .../linear-model_notExistentFeature.json           |  19 +
 .../linear-model_notExistentStore.json             |  46 ++
 ...ultipleadditivetreesmodel_notExistentStore.json |  39 +
 .../multipleadditivetreesmodel_unknownFeature.json |  38 +
 .../org/apache/solr/ltr/model/TestLinearModel.java |  47 ++
 .../ltr/model/TestMultipleAdditiveTreesModel.java  |  25 +
 .../solr/cloud/DistributedClusterStateUpdater.java | 822 +++++++++++++++++++++
 .../src/java/org/apache/solr/cloud/Overseer.java   |  88 ++-
 .../apache/solr/cloud/OverseerNodePrioritizer.java |  18 +-
 .../solr/cloud/RefreshCollectionMessage.java       |  50 ++
 .../solr/cloud/ShardLeaderElectionContext.java     |  15 +-
 .../solr/cloud/ShardLeaderElectionContextBase.java |   9 +-
 .../java/org/apache/solr/cloud/ZkController.java   |  82 +-
 .../solr/cloud/api/collections/AddReplicaCmd.java  |  18 +-
 .../solr/cloud/api/collections/AliasCmd.java       |   2 +-
 .../solr/cloud/api/collections/BackupCmd.java      |  53 +-
 .../cloud/api/collections/CreateCollectionCmd.java | 166 ++++-
 .../solr/cloud/api/collections/CreateShardCmd.java |  16 +-
 .../cloud/api/collections/DeleteBackupCmd.java     | 214 +++++-
 .../cloud/api/collections/DeleteCollectionCmd.java |  11 +-
 .../solr/cloud/api/collections/DeleteShardCmd.java |  22 +-
 .../solr/cloud/api/collections/MigrateCmd.java     |   8 +-
 .../OverseerCollectionMessageHandler.java          |  97 ++-
 .../cloud/api/collections/OverseerStatusCmd.java   |  10 +
 .../api/collections/ReindexCollectionCmd.java      |  29 +-
 .../solr/cloud/api/collections/RestoreCmd.java     |  52 +-
 .../solr/cloud/api/collections/SplitShardCmd.java  |  62 +-
 .../solr/cloud/overseer/CollectionMutator.java     |  23 +-
 .../apache/solr/cloud/overseer/NodeMutator.java    |  90 ++-
 .../apache/solr/cloud/overseer/SliceMutator.java   |   2 +-
 .../apache/solr/cloud/overseer/ZkStateWriter.java  |  31 +-
 .../apache/solr/cloud/overseer/ZkWriteCommand.java |  43 +-
 .../src/java/org/apache/solr/core/CloudConfig.java |  17 +-
 .../java/org/apache/solr/core/CoreContainer.java   |   3 +
 .../java/org/apache/solr/core/SolrXmlConfig.java   |   3 +
 .../apache/solr/core/backup/BackupProperties.java  |   2 +-
 .../repository/LocalFileSystemRepository.java      |  32 +-
 .../apache/solr/handler/CollectionBackupsAPI.java  |  70 ++
 .../org/apache/solr/handler/CollectionsAPI.java    |   1 -
 .../apache/solr/handler/admin/BackupCoreOp.java    |   2 +-
 .../solr/handler/admin/CollectionsHandler.java     | 146 +++-
 .../java/org/apache/solr/response/JSONWriter.java  |   8 +-
 .../org/apache/solr/search/MaxScoreCollector.java  |   7 +-
 .../processor/DistributedZkUpdateProcessor.java    |  12 +-
 .../conf/solrconfig-cache-enable-disable.xml       |  15 +-
 .../conf/solrconfig-memory-circuitbreaker.xml      |   8 +-
 .../solr/cloud/CreateCollectionCleanupTest.java    |   4 +-
 .../org/apache/solr/cloud/DeleteReplicaTest.java   |  34 +-
 .../org/apache/solr/cloud/DeleteShardTest.java     |  13 +-
 .../test/org/apache/solr/cloud/MockSolrSource.java |  15 +-
 .../OverseerCollectionConfigSetProcessorTest.java  | 266 +++++--
 .../org/apache/solr/cloud/OverseerRolesTest.java   |   7 +-
 .../org/apache/solr/cloud/OverseerStatusTest.java  |  35 +-
 .../test/org/apache/solr/cloud/OverseerTest.java   |  43 +-
 .../solr/cloud/TestRandomRequestDistribution.java  |  11 +-
 .../solr/cloud/TestSkipOverseerOperations.java     |  29 +-
 .../org/apache/solr/cloud/ZkControllerTest.java    |  21 +-
 .../BackupRestoreApiErrorConditionsTest.java       | 211 ++++++
 .../LocalFSCloudIncrementalBackupTest.java         |  13 +-
 .../solr/cloud/api/collections/PurgeGraphTest.java | 187 +++++
 .../apache/solr/core/DirectoryFactoriesTest.java   |   4 +-
 .../src/test/org/apache/solr/core/TestConfig.java  |  18 +-
 .../solr/handler/TestIncrementalCoreBackup.java    |  76 +-
 .../solr/handler/TestStressIncrementalBackup.java  |  22 +-
 .../solr/handler/TestStressThreadBackup.java       |   5 +-
 .../solr/handler/admin/AdminHandlersProxyTest.java |  33 -
 .../admin/V2CollectionBackupsAPIMappingTest.java   | 136 ++++
 solr/server/solr/solr.xml                          |   1 +
 solr/solr-ref-guide/src/_layouts/default.html      |   2 +-
 solr/solr-ref-guide/src/_layouts/home.html         |   2 +-
 solr/solr-ref-guide/src/collection-management.adoc | 205 +++++
 solr/solr-ref-guide/src/format-of-solr-xml.adoc    |   4 +
 .../src/major-changes-in-solr-9.adoc               |   9 +
 .../src/making-and-restoring-backups.adoc          |   4 +-
 .../solr-ref-guide/src/parallel-sql-interface.adoc |   2 +-
 solr/solr-ref-guide/src/solr-upgrade-notes.adoc    |  10 +
 .../client/solrj/io/graph/GatherNodesStream.java   | 108 ++-
 .../apache/solr/client/solrj/io/graph/Node.java    |   2 +-
 .../solrj/request/CollectionAdminRequest.java      | 202 ++++-
 .../solrj/request/beans/DeleteBackupPayload.java   |  36 +-
 .../solrj/request/beans/ListBackupPayload.java     |  24 +-
 .../apache/solr/common/cloud/PerReplicaStates.java |  13 +
 .../solr/common/cloud/PerReplicaStatesOps.java     |  58 +-
 .../org/apache/solr/common/cloud/ZkNodeProps.java  |  25 +-
 .../apache/solr/common/cloud/ZkStateReader.java    |  12 +-
 .../apache/solr/common/params/CoreAdminParams.java |   5 +
 .../client/solrj/impl/CloudSolrClientTest.java     |   8 +
 .../client/solrj/io/graph/GraphExpressionTest.java |  72 +-
 .../apache/solr/cloud/MiniSolrCloudCluster.java    |   1 +
 .../org/apache/solr/cloud/SolrCloudTestCase.java   |  54 ++
 .../collections/AbstractIncrementalBackupTest.java |  74 +-
 146 files changed, 4813 insertions(+), 1094 deletions(-)