This is an automated email from the ASF dual-hosted git repository.
krisden pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new 8ffabd73d12 SOLR-16647: Fix circuit breaker examples in solrconfig.xml
(#1333)
8ffabd73d12 is described below
commit 8ffabd73d12a52d2986e91a81794e41da0cc3f55
Author: Colvin Cowie <[email protected]>
AuthorDate: Mon Feb 6 15:38:50 2023 +0000
SOLR-16647: Fix circuit breaker examples in solrconfig.xml (#1333)
---
solr/CHANGES.txt | 2 +
.../util/circuitbreaker/MemoryCircuitBreaker.java | 2 +-
.../solr/configsets/_default/conf/solrconfig.xml | 77 +++++++++-------------
.../conf/solrconfig.xml | 55 ++++++++--------
.../configuration-guide/pages/config-api.adoc | 4 +-
.../deployment-guide/pages/circuit-breakers.adoc | 2 +-
6 files changed, 67 insertions(+), 75 deletions(-)
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 695e5f1312e..56b31def973 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -163,6 +163,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.java
index 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.xml
index 123c93d168c..5f601cde223 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 for
circuit breakers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-
- <!-- Circuit Breakers
-
- Circuit breakers are designed to allow stability and predictable query
+ <!-- Circuit breakers are designed to allow stability and predictable query
execution. They prevent operations that can take down the node and cause
noisy 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 Dispatcher
diff --git
a/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
b/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
index 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 for
circuit breakers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <circuitBreaker>
- <!-- Enable Circuit Breakers
-
- Circuit breakers are designed to allow stability and predictable query
+ <!-- Circuit breakers are designed to allow stability and predictable query
execution. They prevent operations that can take down the node and cause
noisy 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 Dispatcher
This section contains instructions for how the SolrDispatchFilter
diff --git
a/solr/solr-ref-guide/modules/configuration-guide/pages/config-api.adoc
b/solr/solr-ref-guide/modules/configuration-guide/pages/config-api.adoc
index 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.adoc
index 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.