Apache Solr open-source search software
SOLR-16647: Fix circuit breaker examples in solrconfig.xml (#1333)
Colvin Cowie277f000bb936
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex d4c049f22f0..be3eaeb9a56 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -189,6 +189,8 @@ Bug Fixes* SOLR-16631: solr.allowUrls (former solr.shardsWhitelist) should treat hostnames in case insensitive way. (Paul Blanchaert via Eric Pugh)+* SOLR-16647: Fix circuit breaker examples in solrconfig.xml (Colvin Cowie via Kevin Risden)+Build---------------------* Upgrade forbiddenapis to 3.4 (Uwe Schindler)diff --git a/solr/core/src/java/org/apache/solr/util/circuitbreaker/MemoryCircuitBreaker.java b/solr/core/src/java/org/apache/solr/util/circuitbreaker/MemoryCircuitBreaker.javaindex 8a756d9182b..129ea94579f 100644--- a/solr/core/src/java/org/apache/solr/util/circuitbreaker/MemoryCircuitBreaker.java+++ b/solr/core/src/java/org/apache/solr/util/circuitbreaker/MemoryCircuitBreaker.java@@ -30,7 +30,7 @@ import org.slf4j.LoggerFactory;* usage goes below the threshold, it will start allowing queries again.** <p>The memory threshold is defined as a percentage of the maximum memory allocated -- see- * memoryCircuitBreakerThresholdPct in solrconfig.xml.+ * memThreshold in solrconfig.xml.*/public class MemoryCircuitBreaker extends CircuitBreaker {private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());diff --git a/solr/server/solr/configsets/_default/conf/solrconfig.xml b/solr/server/solr/configsets/_default/conf/solrconfig.xmlindex a2e7caac41f..ca69ee01e65 100644--- a/solr/server/solr/configsets/_default/conf/solrconfig.xml+++ b/solr/server/solr/configsets/_default/conf/solrconfig.xml@@ -563,60 +563,47 @@Circuit Breaker Section - This section consists of configurations forcircuit breakers~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->-- <!-- Circuit Breakers-- Circuit breakers are designed to allow stability and predictable query+ <!-- Circuit breakers are designed to allow stability and predictable queryexecution. They prevent operations that can take down the node and causenoisy neighbour issues.- This flag is the uber control switch which controls the activation/deactivation of all circuit- breakers. If a circuit breaker wishes to be independently configurable,- they are free to add their specific configuration but need to ensure that this flag is always- respected - this should have veto over all independent configuration flags.- -->- <circuitBreakers enabled="true">-- <!-- Memory Circuit Breaker Configuration-- Specific configuration for max JVM heap usage circuit breaker. This configuration defines whether- the circuit breaker is enabled and the threshold percentage of maximum heap allocated beyond which queries will be rejected until the- current JVM usage goes below the threshold. The valid value range for this value is 50-95.-- Consider a scenario where the max heap allocated is 4 GB and memoryCircuitBreakerThreshold is- defined as 75. Threshold JVM usage will be 4 * 0.75 = 3 GB. Its generally a good idea to keep this value between 75 - 80% of maximum heap- allocated.-- If, at any point, the current JVM heap usage goes above 3 GB, queries will be rejected until the heap usage goes below 3 GB again.- If you see queries getting rejected with 503 error code, check for "Circuit Breakers tripped"- in logs and the corresponding error message should tell you what transpired (if the failure- was caused by tripped circuit breakers).-- If, at any point, the current JVM heap usage goes above 3 GB, queries will be rejected until the heap usage goes below 3 GB again.- If you see queries getting rejected with 503 error code, check for "Circuit Breakers tripped"- in logs and the corresponding error message should tell you what transpired (if the failure- was caused by tripped circuit breakers).+ The CircuitBreakerManager is the default manager for all circuit breakers.+ The enabled flag here controls the activation/deactivation of all circuit+ breakers specified within.+ -->+ <circuitBreaker class="solr.CircuitBreakerManager" enabled="true">+ <!-- Memory Circuit Breaker++ Specific configuration for max JVM heap usage circuit breaker. This configuration defines+ whether the circuit breaker is enabled and the threshold percentage of maximum heap allocated+ beyond which queries will be rejected until the current JVM usage goes below the threshold.+ The valid value for this range is 50-95.++ Consider a scenario where the max heap allocated is 4 GB and memThreshold is defined as 75.+ Threshold JVM usage will be 4 * 0.75 = 3 GB. Its generally a good idea to keep this value+ between 75 - 80% of maximum heap allocated.++ If, at any point, the current JVM heap usage goes above 3 GB, queries will be rejected until+ the heap usage goes below 3 GB again. If you see queries getting rejected with 503 error code,+ check for "Circuit Breakers tripped" in logs and the corresponding error message should tell+ you what transpired (if the failure was caused by tripped circuit breakers).--><!--- <memBreaker enabled="true" threshold="75"/>+ <str name="memEnabled">true</str>+ <str name="memThreshold">75</str>-->- <!-- CPU Circuit Breaker Configuration-- Specific configuration for CPU utilization based circuit breaker. This configuration defines whether the circuit breaker is enabled- and the average load over the last minute at which the circuit breaker should start rejecting queries.+ <!-- CPU Circuit Breaker Configuration- Consider a scenario where the max heap allocated is 4 GB and memoryCircuitBreakerThreshold is- defined as 75. Threshold JVM usage will be 4 * 0.75 = 3 GB. Its generally a good idea to keep this value between 75 - 80% of maximum heap- allocated.+ Specific configuration for CPU utilization based circuit breaker. This configuration defines+ whether the circuit breaker is enabled and the average load over the last minute at which the+ circuit breaker should start rejecting queries.-->-- <!--- <cpuBreaker enabled="true" threshold="75"/>- -->-- </circuitBreakers>-+ <!--+ <str name="cpuEnabled">true</str>+ <str name="cpuThreshold">75</str>+ -->+ </circuitBreaker><!-- Request Dispatcherdiff --git a/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml b/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xmlindex d7cc03b8803..82b74f054ad 100644--- a/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml+++ b/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml@@ -583,45 +583,48 @@Circuit Breaker Section - This section consists of configurations forcircuit breakers~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->- <circuitBreaker>- <!-- Enable Circuit Breakers-- Circuit breakers are designed to allow stability and predictable query+ <!-- Circuit breakers are designed to allow stability and predictable queryexecution. They prevent operations that can take down the node and causenoisy neighbour issues.- This flag is the uber control switch which controls the activation/deactivation of all circuit- breakers. At the moment, the only circuit breaker (max JVM circuit breaker) does not have its- own specific configuration. However, if a circuit breaker wishes to be independently configurable,- they are free to add their specific configuration but need to ensure that this flag is always- respected - this should have veto over all independent configuration flags.+ The CircuitBreakerManager is the default manager for all circuit breakers.+ The enabled flag here controls the activation/deactivation of all circuit+ breakers specified within.+ -->+ <circuitBreaker class="solr.CircuitBreakerManager" enabled="true">+ <!-- Memory Circuit Breaker++ Specific configuration for max JVM heap usage circuit breaker. This configuration defines+ whether the circuit breaker is enabled and the threshold percentage of maximum heap allocated+ beyond which queries will be rejected until the current JVM usage goes below the threshold.+ The valid value for this range is 50-95.++ Consider a scenario where the max heap allocated is 4 GB and memThreshold is defined as 75.+ Threshold JVM usage will be 4 * 0.75 = 3 GB. Its generally a good idea to keep this value+ between 75 - 80% of maximum heap allocated.++ If, at any point, the current JVM heap usage goes above 3 GB, queries will be rejected until+ the heap usage goes below 3 GB again. If you see queries getting rejected with 503 error code,+ check for "Circuit Breakers tripped" in logs and the corresponding error message should tell+ you what transpired (if the failure was caused by tripped circuit breakers).--><!--- <useCircuitBreakers>true</useCircuitBreakers>+ <str name="memEnabled">true</str>+ <str name="memThreshold">75</str>-->- <!-- Memory Circuit Breaker Threshold In Percentage-- Specific configuration for max JVM heap usage circuit breaker. This configuration defines the- threshold percentage of maximum heap allocated beyond which queries will be rejected until the- current JVM usage goes below the threshold. The valid value for this range is 50-95.+ <!-- CPU Circuit Breaker Configuration- Consider a scenario where the max heap allocated is 4 GB and memoryCircuitBreakerThresholdPct is- defined as 75. Threshold JVM usage will be 4 * 0.75 = 3 GB. Its generally a good idea to keep this value between 75 - 80% of maximum heap- allocated.-- If, at any point, the current JVM heap usage goes above 3 GB, queries will be rejected until the heap usage goes below 3 GB again.- If you see queries getting rejected with 503 error code, check for "Circuit Breakers tripped"- in logs and the corresponding error message should tell you what transpired (if the failure- was caused by tripped circuit breakers).+ Specific configuration for CPU utilization based circuit breaker. This configuration defines+ whether the circuit breaker is enabled and the average load over the last minute at which the+ circuit breaker should start rejecting queries.--><!--- <memoryCircuitBreakerThresholdPct>100</memoryCircuitBreakerThresholdPct>+ <str name="cpuEnabled">true</str>+ <str name="cpuThreshold">75</str>-->-</circuitBreaker>-<!-- Request DispatcherThis section contains instructions for how the SolrDispatchFilterdiff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/config-api.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/config-api.adocindex c9e2f90f47e..be7fee07718 100644--- a/solr/solr-ref-guide/modules/configuration-guide/pages/config-api.adoc+++ b/solr/solr-ref-guide/modules/configuration-guide/pages/config-api.adoc@@ -219,8 +219,8 @@ _Query Circuit Breakers_See xref:deployment-guide:circuit-breakers.adoc[] for more details-* `query.useCircuitBreakers`-* `query.memoryCircuitBreakerThresholdPct`+* `query.memEnabled`+* `query.memThreshold`*RequestDispatcher Settings*diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/circuit-breakers.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/circuit-breakers.adocindex 83fa418cdee..5b29b4acd9c 100644--- a/solr/solr-ref-guide/modules/deployment-guide/pages/circuit-breakers.adoc+++ b/solr/solr-ref-guide/modules/deployment-guide/pages/circuit-breakers.adoc@@ -74,7 +74,7 @@ Hence, the range of valid values for this parameter is [50, 95], both inclusive.Consider the following example:-JVM has been allocated a maximum heap of 5GB (-Xmx) and `memoryCircuitBreakerThresholdPct` is set to `75`.+JVM has been allocated a maximum heap of 5GB (-Xmx) and `memThreshold` is set to `75`.In this scenario, the heap usage at which the circuit breaker will trip is 3.75GB.