torvalds-dev / solr

Apache Solr open-source search software
https://solr.apache.org/
Apache License 2.0
0 stars 0 forks source link

Global Circuit Breakers #23

Open 0xDTE opened 11 months ago

0xDTE commented 11 months ago

Currently Circuit Breakers are configured per core in solrconfig.xml. However, cores/collections do not live in isolation, and it could be that a cluster administrator would like to enforce circuit breakers for the entire cluster.

I'm not clear as to whether we need both cluster level and a core level pluggability. And would core-level breakers add to any cluster-level ones or override them for that core?

A potential design is to add this as a new plugin in solr.xml, and have them added in a new static context of CircuitBreakerRegistry. Then the isTripped logic would consult both the per-core list and the static/global list of breakers.

torvalds-dev commented 11 months ago

torvalds.dev is analyzing the ticket

torvalds-dev commented 11 months ago

The issue you're dealing with is related to the configuration of Circuit Breakers in Solr. Currently, Circuit Breakers are configured per core in solrconfig.xml. However, cores/collections do not live in isolation, and a cluster administrator might want to enforce circuit breakers for the entire cluster.

The question raised is whether both cluster level and a core level pluggability are needed. And if core-level breakers would add to any cluster-level ones or override them for that core.

A potential design is to add this as a new plugin in solr.xml, and have them added in a new static context of CircuitBreakerRegistry. Then the isTripped logic would consult both the per-core list and the static/global list of breakers.

The files relevant to this issue are:

  1. TestGlobalCircuitBreaker.java: This file contains tests for the pluggable circuit breaker implementation. It tests if the global circuit breaker is registered and if indexing trips the load average circuit breaker.

  2. CircuitBreakerRegistry.java: This file contains the implementation of the CircuitBreakerRegistry. It keeps track of all registered circuit breaker instances for various request types. It is responsible for a holistic view of whether a circuit breaker has tripped or not. Circuit breakers may be registered globally and/or per-core.

Based on the information provided, here are some potential actions:

  1. Review the current implementation of Circuit Breakers in Solr, specifically how they are configured per core and how they function.

  2. Investigate the possibility of implementing cluster-level Circuit Breakers. This would involve understanding the implications of having both core-level and cluster-level Circuit Breakers.

  3. Consider the design suggestion of adding a new plugin in solr.xml for Circuit Breakers and adding them to a new static context of CircuitBreakerRegistry.

  4. Review the code in TestGlobalCircuitBreaker.java and CircuitBreakerRegistry.java to understand the current implementation and tests for Circuit Breakers.

  5. If the design suggestion seems viable, plan out the steps for implementation and testing.

Remember to consider the potential impact on existing functionality and ensure that any changes are thoroughly tested.

0xDTE commented 11 months ago

nice. matches actual commits in the pull request: https://github.com/apache/solr/pull/1919/files