-
Notifications
You must be signed in to change notification settings - Fork 681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SOLR-15474 Make Circuit breakers pluggable (take 2) #1725
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to see this effort continue!
solr/core/src/java/org/apache/solr/util/circuitbreaker/CPUCircuitBreaker.java
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/util/circuitbreaker/CPUCircuitBreaker.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/util/circuitbreaker/CircuitBreaker.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/util/circuitbreaker/CircuitBreakerManager.java
Outdated
Show resolved
Hide resolved
solr/core/src/test-files/solr/collection1/conf/solrconfig-memory-circuitbreaker.xml
Outdated
Show resolved
Hide resolved
solr/core/src/test-files/solr/collection1/conf/solrconfig-memory-circuitbreaker.xml
Outdated
Show resolved
Hide resolved
solr/core/src/test-files/solr/collection1/conf/solrconfig-memory-circuitbreaker.xml
Outdated
Show resolved
Hide resolved
solr/solr-ref-guide/modules/deployment-guide/pages/circuit-breakers.adoc
Outdated
Show resolved
Hide resolved
In the last commits I re-introduced backward compatibility for configuring the legacy "CircuitBreakerManager" as a single plugin. I did this by renaming I'll probably not pursue converting to cluster-plugin in this PR since it will be a 10.0 only thing. But I want to achieve separating between update and query breakers. |
solr/core/src/java/org/apache/solr/util/circuitbreaker/CircuitBreakerManager.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
16 / 18 files viewed -- only partly looked at the test changes so far.
And deprecating CircuitBreakerManager via morphing into a wrapper of two circuit breakers is a neat way to maintain backwards compatibility, very nice.
solr/core/src/java/org/apache/solr/util/circuitbreaker/MemoryCircuitBreaker.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/util/circuitbreaker/CircuitBreakerRegistry.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/util/circuitbreaker/CircuitBreakerRegistry.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/util/circuitbreaker/CircuitBreakerRegistry.java
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/util/circuitbreaker/CircuitBreakerRegistry.java
Outdated
Show resolved
Hide resolved
solr/solr-ref-guide/modules/deployment-guide/pages/circuit-breakers.adoc
Outdated
Show resolved
Hide resolved
solr/solr-ref-guide/modules/deployment-guide/pages/circuit-breakers.adoc
Outdated
Show resolved
Hide resolved
solr/solr-ref-guide/modules/deployment-guide/pages/circuit-breakers.adoc
Outdated
Show resolved
Hide resolved
solr/solr-ref-guide/modules/deployment-guide/pages/circuit-breakers.adoc
Outdated
Show resolved
Hide resolved
solr/solr-ref-guide/modules/deployment-guide/pages/circuit-breakers.adoc
Outdated
Show resolved
Hide resolved
Thanks for reviewing @cpoerschke. Last bit of polish and then I hope to wrap up. Then this is a nice foundation to build |
Will likely need to squash and force-push in order for Crave.io to do its job... Anyone have a problem with that? |
solr/solr-ref-guide/modules/deployment-guide/pages/circuit-breakers.adoc
Outdated
Show resolved
Hide resolved
Co-authored-by: Christine Poerschke <[email protected]> Signed-off-by: Jan Høydahl <[email protected]>
4050b9d
to
c6ef934
Compare
…BreakerManager.java Co-authored-by: Christine Poerschke <[email protected]>
…BreakerManager.java Co-authored-by: Christine Poerschke <[email protected]>
Signed-off-by: Jan Høydahl <[email protected]>
@janhoy this deals with code where I have no knowledge. I wouldn't know how to tell whether the change is good or not. |
My colleagues have done some custom Circuit Breaking stuff in Solr... I'm hoping one of them might weigh-in here so please don't merge too quickly. |
This is not really touching the existing breaker logic itself, but the pluggability of them in solrconfig.xml. I'd also like to (in another issue) consider moving CB from core-level to node or cluster level and thus deprecate this solrconfig plugin altogether, but we need to stay back compat for now. |
When you said "Then this is a nice foundation to build /update circuit breaking on top of.", I this caught my interest as this is what we're doing with Solr where I work. If this PR doesn't actually have to do with that, and is only about configuration, then merge away! |
Sure, this is just making CBs pluggable for real, so you could create a |
Looking for at least one "+1" before I proceed with the merge. |
I took a look and it looks good to me. |
Signed-off-by: Jan Høydahl <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
if (memEnabled) { | ||
sb.append(memCB.getDebugInfo()).append("\n"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (memEnabled) { | |
sb.append(memCB.getDebugInfo()).append("\n"); | |
} | |
if (memEnabled) { | |
sb.append(memCB.getDebugInfo()); | |
} | |
if (memEnabled && cpuEnabled) { | |
sb.append("\n"); | |
} |
</query> | ||
|
||
<circuitBreaker class="solr.MemoryCircuitBreaker"> | ||
<int name="threshold">75</int> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<int name="threshold">75</int> | |
<double name="threshold">75</double> |
List<CircuitBreaker> registeredCircuitBreakers = | ||
h.getCore().getCircuitBreakerRegistry().getRegisteredCircuitBreakers(); | ||
|
||
registeredCircuitBreakers.clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could deregisterAll
be used here instead (and then getRegisteredCircuitBreakers()
could be removed)?
List<CircuitBreaker> registeredCircuitBreakers = | |
h.getCore().getCircuitBreakerRegistry().getRegisteredCircuitBreakers(); | |
registeredCircuitBreakers.clear(); | |
h.getCore().getCircuitBreakerRegistry().deregisterAll(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cpoerschke Seems we had a race condition with your latest suggestions and my merge. Sorry for that, I could swear I saw some of those comments earlier, don't know how they got closed without merge.
I'll backport the initial commit. Would you mind filing a new PR with these latest changes? The commit message can reference same JIRA.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem! #1870 for the follow-up bits. Would you mind including it in the back port?
edit: never mind, back port already happened. I can back port after merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was my thought, probably easier to correlate later..
* SOLR-15474 Make Circuit breakers pluggable Co-authored-by: Christine Poerschke <[email protected]> Co-authored-by: Atri Sharma <[email protected]> Signed-off-by: Jan Høydahl <[email protected]> (cherry picked from commit 4100049) Signed-off-by: Jan Høydahl <[email protected]>
* SOLR-15474 Make Circuit breakers pluggable Co-authored-by: Christine Poerschke <[email protected]> Co-authored-by: Atri Sharma <[email protected]> Signed-off-by: Jan Høydahl <[email protected]> (cherry picked from commit 4100049) Signed-off-by: Jan Høydahl <[email protected]>
* SOLR-15474 Make Circuit breakers pluggable Co-authored-by: Christine Poerschke <[email protected]> Co-authored-by: Atri Sharma <[email protected]> Signed-off-by: Jan Høydahl <[email protected]> (cherry picked from commit 4100049) Signed-off-by: Jan Høydahl <[email protected]>
* SOLR-15474 Make Circuit breakers pluggable Co-authored-by: Christine Poerschke <[email protected]> Co-authored-by: Atri Sharma <[email protected]> Signed-off-by: Jan Høydahl <[email protected]> (cherry picked from commit 4100049) Signed-off-by: Jan Høydahl <[email protected]>
https://issues.apache.org/jira/browse/SOLR-15474
This is a continuation of the effort from PR #193 which had grown out of date by almost 2 years and no activity.
Thus I updated that branch to main and squashed as one commit to kickstart this PR. I intend to bring it to mergable state.
To do before committable
<circuitBreaker class="solr.CircuitBreakerManager">
with all params for back compat