[Remove] CircuitBreaker Accounting (#2056)
RAM Accounting of segments is removed so remove the associated Accounting circuit breaker. Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
This commit is contained in:
parent
ee9e5ba579
commit
8288c9010c
|
@ -102,8 +102,6 @@ public class CircuitBreakerServiceIT extends OpenSearchIntegTestCase {
|
|||
HierarchyCircuitBreakerService.FIELDDATA_CIRCUIT_BREAKER_OVERHEAD_SETTING,
|
||||
HierarchyCircuitBreakerService.REQUEST_CIRCUIT_BREAKER_LIMIT_SETTING,
|
||||
HierarchyCircuitBreakerService.REQUEST_CIRCUIT_BREAKER_OVERHEAD_SETTING,
|
||||
HierarchyCircuitBreakerService.ACCOUNTING_CIRCUIT_BREAKER_LIMIT_SETTING,
|
||||
HierarchyCircuitBreakerService.ACCOUNTING_CIRCUIT_BREAKER_OVERHEAD_SETTING,
|
||||
HierarchyCircuitBreakerService.IN_FLIGHT_REQUESTS_CIRCUIT_BREAKER_LIMIT_SETTING,
|
||||
HierarchyCircuitBreakerService.IN_FLIGHT_REQUESTS_CIRCUIT_BREAKER_OVERHEAD_SETTING,
|
||||
HierarchyCircuitBreakerService.TOTAL_CIRCUIT_BREAKER_LIMIT_SETTING
|
||||
|
|
|
@ -66,12 +66,6 @@ public interface CircuitBreaker {
|
|||
* writing requests on the network layer.
|
||||
*/
|
||||
String IN_FLIGHT_REQUESTS = "in_flight_requests";
|
||||
/**
|
||||
* The accounting breaker tracks things held in memory that is independent
|
||||
* of the request lifecycle. This includes memory used by Lucene for
|
||||
* segments.
|
||||
*/
|
||||
String ACCOUNTING = "accounting";
|
||||
|
||||
enum Type {
|
||||
// A regular or ChildMemoryCircuitBreaker
|
||||
|
|
|
@ -329,8 +329,6 @@ public final class ClusterSettings extends AbstractScopedSettings {
|
|||
HierarchyCircuitBreakerService.IN_FLIGHT_REQUESTS_CIRCUIT_BREAKER_OVERHEAD_SETTING,
|
||||
HierarchyCircuitBreakerService.REQUEST_CIRCUIT_BREAKER_LIMIT_SETTING,
|
||||
HierarchyCircuitBreakerService.REQUEST_CIRCUIT_BREAKER_OVERHEAD_SETTING,
|
||||
HierarchyCircuitBreakerService.ACCOUNTING_CIRCUIT_BREAKER_LIMIT_SETTING,
|
||||
HierarchyCircuitBreakerService.ACCOUNTING_CIRCUIT_BREAKER_OVERHEAD_SETTING,
|
||||
IndexModule.NODE_STORE_ALLOW_MMAP,
|
||||
ClusterApplierService.CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING,
|
||||
ClusterService.USER_DEFINED_METADATA,
|
||||
|
|
|
@ -140,26 +140,6 @@ public class HierarchyCircuitBreakerService extends CircuitBreakerService {
|
|||
Property.NodeScope
|
||||
);
|
||||
|
||||
public static final Setting<ByteSizeValue> ACCOUNTING_CIRCUIT_BREAKER_LIMIT_SETTING = Setting.memorySizeSetting(
|
||||
"indices.breaker.accounting.limit",
|
||||
"100%",
|
||||
Property.Dynamic,
|
||||
Property.NodeScope
|
||||
);
|
||||
public static final Setting<Double> ACCOUNTING_CIRCUIT_BREAKER_OVERHEAD_SETTING = Setting.doubleSetting(
|
||||
"indices.breaker.accounting.overhead",
|
||||
1.0d,
|
||||
0.0d,
|
||||
Property.Dynamic,
|
||||
Property.NodeScope
|
||||
);
|
||||
public static final Setting<CircuitBreaker.Type> ACCOUNTING_CIRCUIT_BREAKER_TYPE_SETTING = new Setting<>(
|
||||
"indices.breaker.accounting.type",
|
||||
"memory",
|
||||
CircuitBreaker.Type::parseValue,
|
||||
Property.NodeScope
|
||||
);
|
||||
|
||||
public static final Setting<ByteSizeValue> IN_FLIGHT_REQUESTS_CIRCUIT_BREAKER_LIMIT_SETTING = Setting.memorySizeSetting(
|
||||
"network.breaker.inflight_requests.limit",
|
||||
"100%",
|
||||
|
@ -236,18 +216,6 @@ public class HierarchyCircuitBreakerService extends CircuitBreakerService {
|
|||
)
|
||||
)
|
||||
);
|
||||
childCircuitBreakers.put(
|
||||
CircuitBreaker.ACCOUNTING,
|
||||
validateAndCreateBreaker(
|
||||
new BreakerSettings(
|
||||
CircuitBreaker.ACCOUNTING,
|
||||
ACCOUNTING_CIRCUIT_BREAKER_LIMIT_SETTING.get(settings).getBytes(),
|
||||
ACCOUNTING_CIRCUIT_BREAKER_OVERHEAD_SETTING.get(settings),
|
||||
ACCOUNTING_CIRCUIT_BREAKER_TYPE_SETTING.get(settings),
|
||||
CircuitBreaker.Durability.PERMANENT
|
||||
)
|
||||
)
|
||||
);
|
||||
for (BreakerSettings breakerSettings : customBreakers) {
|
||||
if (childCircuitBreakers.containsKey(breakerSettings.getName())) {
|
||||
throw new IllegalArgumentException(
|
||||
|
@ -290,11 +258,6 @@ public class HierarchyCircuitBreakerService extends CircuitBreakerService {
|
|||
REQUEST_CIRCUIT_BREAKER_OVERHEAD_SETTING,
|
||||
(limit, overhead) -> updateCircuitBreakerSettings(CircuitBreaker.REQUEST, limit, overhead)
|
||||
);
|
||||
clusterSettings.addSettingsUpdateConsumer(
|
||||
ACCOUNTING_CIRCUIT_BREAKER_LIMIT_SETTING,
|
||||
ACCOUNTING_CIRCUIT_BREAKER_OVERHEAD_SETTING,
|
||||
(limit, overhead) -> updateCircuitBreakerSettings(CircuitBreaker.ACCOUNTING, limit, overhead)
|
||||
);
|
||||
clusterSettings.addAffixUpdateConsumer(
|
||||
CIRCUIT_BREAKER_LIMIT_SETTING,
|
||||
CIRCUIT_BREAKER_OVERHEAD_SETTING,
|
||||
|
|
|
@ -275,7 +275,7 @@ public class HierarchyCircuitBreakerServiceTests extends OpenSearchTestCase {
|
|||
assertThat(exception.getMessage(), containsString("which is larger than the limit of [209715200/200mb]"));
|
||||
assertThat(
|
||||
exception.getMessage(),
|
||||
containsString("usages [request=157286400/150mb, fielddata=54001664/51.5mb, in_flight_requests=0/0b, accounting=0/0b]")
|
||||
containsString("usages [request=157286400/150mb, fielddata=54001664/51.5mb, in_flight_requests=0/0b]")
|
||||
);
|
||||
assertThat(exception.getDurability(), equalTo(CircuitBreaker.Durability.TRANSIENT));
|
||||
}
|
||||
|
@ -341,7 +341,7 @@ public class HierarchyCircuitBreakerServiceTests extends OpenSearchTestCase {
|
|||
+ requestCircuitBreakerUsed
|
||||
+ "/"
|
||||
+ new ByteSizeValue(requestCircuitBreakerUsed)
|
||||
+ ", fielddata=0/0b, in_flight_requests=0/0b, accounting=0/0b]"
|
||||
+ ", fielddata=0/0b, in_flight_requests=0/0b]"
|
||||
)
|
||||
);
|
||||
assertThat(exception.getDurability(), equalTo(CircuitBreaker.Durability.TRANSIENT));
|
||||
|
|
|
@ -71,7 +71,6 @@ import org.opensearch.common.CheckedBiFunction;
|
|||
import org.opensearch.common.Nullable;
|
||||
import org.opensearch.common.Randomness;
|
||||
import org.opensearch.common.Strings;
|
||||
import org.opensearch.common.breaker.CircuitBreaker;
|
||||
import org.opensearch.common.bytes.BytesArray;
|
||||
import org.opensearch.common.bytes.BytesReference;
|
||||
import org.opensearch.common.compress.CompressedXContent;
|
||||
|
@ -345,8 +344,6 @@ public abstract class EngineTestCase extends OpenSearchTestCase {
|
|||
assertMaxSeqNoInCommitUserData(replicaEngine);
|
||||
assertAtMostOneLuceneDocumentPerSequenceNumber(replicaEngine);
|
||||
}
|
||||
assertThat(engine.config().getCircuitBreakerService().getBreaker(CircuitBreaker.ACCOUNTING).getUsed(), equalTo(0L));
|
||||
assertThat(replicaEngine.config().getCircuitBreakerService().getBreaker(CircuitBreaker.ACCOUNTING).getUsed(), equalTo(0L));
|
||||
} finally {
|
||||
IOUtils.close(replicaEngine, storeReplica, engine, store, () -> terminate(threadPool));
|
||||
}
|
||||
|
|
|
@ -2401,19 +2401,6 @@ public final class InternalTestCluster extends TestCluster {
|
|||
CircuitBreaker fdBreaker = breakerService.getBreaker(CircuitBreaker.FIELDDATA);
|
||||
assertThat("Fielddata breaker not reset to 0 on node: " + name, fdBreaker.getUsed(), equalTo(0L));
|
||||
|
||||
try {
|
||||
assertBusy(() -> {
|
||||
CircuitBreaker acctBreaker = breakerService.getBreaker(CircuitBreaker.ACCOUNTING);
|
||||
assertThat(
|
||||
"Accounting breaker not reset to 0 on node: " + name + ", are there still Lucene indices around?",
|
||||
acctBreaker.getUsed(),
|
||||
equalTo(0L)
|
||||
);
|
||||
});
|
||||
} catch (Exception e) {
|
||||
throw new AssertionError("Exception during check for accounting breaker reset to 0", e);
|
||||
}
|
||||
|
||||
// Anything that uses transport or HTTP can increase the
|
||||
// request breaker (because they use bigarrays), because of
|
||||
// that the breaker can sometimes be incremented from ping
|
||||
|
|
Loading…
Reference in New Issue