Skip to content

Commit

Permalink
Add possibility to supply a custom commitPollInterval
Browse files Browse the repository at this point in the history
A supplied `commitPollInterval` in `updateHandler` this has precendence over one calculated from hard/soft commit settings
  • Loading branch information
tboeghk committed Feb 28, 2024
1 parent c169ff0 commit 533950b
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 533950b

Please sign in to comment.