From 533950b0f58c44e86a38980685e267643a4be1a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B8gh=20K=C3=B6ster?= Date: Thu, 22 Feb 2024 13:15:22 +0100 Subject: [PATCH] Add possibility to supply a custom commitPollInterval A supplied `commitPollInterval` in `updateHandler` this has precendence over one calculated from hard/soft commit settings --- .../org/apache/solr/cloud/ReplicateFromLeader.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/cloud/ReplicateFromLeader.java b/solr/core/src/java/org/apache/solr/cloud/ReplicateFromLeader.java index 7abe46fe0c3..e7f6cbcf5e8 100644 --- a/solr/core/src/java/org/apache/solr/cloud/ReplicateFromLeader.java +++ b/solr/core/src/java/org/apache/solr/cloud/ReplicateFromLeader.java @@ -75,14 +75,18 @@ public void startReplication(boolean switchTransactionLog) { "SolrCore not found:" + coreName + " in " + CloudUtil.getLoadedCoreNamesAsString(cc)); } } + SolrConfig.UpdateHandlerInfo uinfo = core.getSolrConfig().getUpdateHandlerInfo(); + String customPollInterval = + core.getSolrConfig().get("updateHandler").get("commitPollInterval").txt(); String pollIntervalStr = "00:00:03"; + String calculatedPollIntervalString = determinePollInterval(uinfo); + if (System.getProperty("jetty.testMode") != null) { pollIntervalStr = "00:00:01"; - } - - String calculatedPollIntervalString = determinePollInterval(uinfo); - if (calculatedPollIntervalString != null) { + } else if (customPollInterval != null) { + pollIntervalStr = customPollInterval; + } else if (calculatedPollIntervalString != null) { pollIntervalStr = calculatedPollIntervalString; } log.info("Will start replication from leader with poll interval: {}", pollIntervalStr);