Apache Lucene open-source search software
SOLR-8500: Allow the number of threads ConcurrentUpdateSolrClient StreamingSolrClients configurable by a system property
Erick Erickson3e7fe7867f64
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 348cf017373..e93c45aebdd 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -144,6 +144,10 @@ New Features* SOLR-8285: Ensure the /export handler works with NULL field values (Joel Bernstein)+* SOLR-8500: Allow the number of threads ConcurrentUpdateSolrClient StreamingSolrClients configurable by a+ system property. NOTE: this is an expert option and can result in more often needing to do full index replication+ for recovery, the sweet spot for using this is very high volume, leader-only indexing. (Tim Potter, Erick Erickson)+Bug Fixes----------------------* SOLR-8386: Add field option in the new admin UI schema page loads up even when no schemaFactory has beendiff --git a/solr/core/src/java/org/apache/solr/update/StreamingSolrClients.java b/solr/core/src/java/org/apache/solr/update/StreamingSolrClients.javaindex 0ca814999da..ecc2a2bb29e 100644--- a/solr/core/src/java/org/apache/solr/update/StreamingSolrClients.java+++ b/solr/core/src/java/org/apache/solr/update/StreamingSolrClients.java@@ -41,6 +41,8 @@ import java.util.concurrent.ExecutorService;public class StreamingSolrClients {private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());++ private final int runnerCount = Integer.getInteger("solr.cloud.replication.runners", 1);private HttpClient httpClient;@@ -70,7 +72,7 @@ public class StreamingSolrClients {// NOTE: increasing to more than 1 threadCount for the client could cause updates to be reordered// on a greater scale since the current behavior is to only increase the number of connections/Runners when// the queue is more than half full.- client = new ConcurrentUpdateSolrClient(url, httpClient, 100, 1, updateExecutor, true) {+ client = new ConcurrentUpdateSolrClient(url, httpClient, 100, runnerCount, updateExecutor, true) {@Overridepublic void handleError(Throwable ex) {req.trackRequestResult(null, false);