Skip to content

[RFC] Remove Circuit Breaker check from File Cache #19137

@Gagan6164

Description

@Gagan6164

Is your feature request related to a problem? Please describe

Background:
Currently, the File Cache implementation includes a circuit breaker check in both the Put and Compute operations. Before adding any entry to the file cache, the system checks if the parent circuit breaker (which monitors total memory usage) has been tripped.

Problem:
This circuit breaker check was originally added as a preventative measure to limit the maximum number of entries in the file cache. However, as noted in issue #6227, file cache entries consume minimal memory and their impact on overall memory usage is not significant.

Describe the solution you'd like

Solution:
Provide a no-operation (Noop) circuit breaker specifically for file cache operations in the constructor.

Pros:

  1. Minimal code changes required
  2. Maintains existing interface contracts
  3. No performance overhead from circuit breaker checks

Cons:

  1. Could be confusing for future developers

Rationale:

  • File cache entries have negligible memory footprint, making the current circuit breaker check ineffective for its intended purpose
  • Dedicated file cache guardrails (PR Addition of fileCache activeUsage evaluator to DiskThresholdMonitor #19071) provide better control mechanisms
  • In high JVM memory situations, admission control and search back pressure mechanisms should already be rejecting requests upstream, making this additional check redundant

This change simplifies the file cache logic while maintaining appropriate safeguards through more targeted mechanisms.

Related component

Search:Searchable Snapshots

Describe alternatives you've considered

Alternate Approaches
Remove Circuit Breaker from the File Cache Interface entirely.
Pros:

  1. More cleaner solution

Cons:

  1. Requires lot more changes in multiple files
  2. Will need to introduce additional constructor and keep the existing constructor as well as it is part of public api.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Search:Searchable SnapshotsStorageIssues and PRs relating to data and metadata storageStorage:ResiliencyIssues and PRs related to the storage resiliencyenhancementEnhancement or improvement to existing feature or request

    Type

    No type

    Projects

    Status

    ✅ Done

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions