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 #27

Open torvalds-dev opened 10 months ago

torvalds-dev commented 10 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 10 months ago

torvalds.dev is analyzing the ticket

torvalds-dev commented 10 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.

You're unsure whether both cluster level and core level pluggability are needed. You're also unsure whether 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 relevant files to this issue are:

  1. solr/core/src/java/org/apache/solr/util/circuitbreaker/CircuitBreakerRegistry.java: This file contains the implementation of the CircuitBreakerRegistry class, which 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.

  2. solr/core/src/test/org/apache/solr/util/TestGlobalCircuitBreaker.java: This file contains the tests for the pluggable circuit breaker implementation.

Based on the information provided, here are the actions that should be taken:

  1. Understand the current implementation of circuit breakers in Solr by reviewing the CircuitBreakerRegistry.java file.

  2. Analyze the potential design of adding a new plugin in solr.xml and having them added in a new static context of CircuitBreakerRegistry.

  3. Determine whether both cluster level and core level pluggability are needed, and how core-level breakers would interact with cluster-level ones.

  4. Write tests for the new implementation in TestGlobalCircuitBreaker.java.

  5. Implement the new design if it is determined to be the best course of action.

  6. Test the new implementation thoroughly to ensure it works as expected.

  7. Document the changes and the reasons behind them for future reference.