Skip to content
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

BlobStoreCacheMaintenanceService.PeriodicMaintenanceTask should not hold a reference to a SearchResponse #103245

Closed
original-brownbear opened this issue Dec 10, 2023 · 2 comments
Labels
:Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs Team:Distributed Meta label for distributed team >tech debt

Comments

@original-brownbear
Copy link
Member

From the discussion in #103118 and motivated by the fact that SearchResponse will be ref-counted soon. BlobStoreCacheMaintenanceService.PeriodicMaintenanceTask currently holds a reference to a SearchResponse in a field.
This seems unnecessary and can be refactored to make it so that the search response is only held in a local variable, removing the need for tricky ref-counting on it -> remove that reference to resolve this issue.

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@elasticsearchmachine elasticsearchmachine added the Team:Distributed Meta label for distributed team label Dec 10, 2023
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this issue Dec 13, 2023
Today the `PeriodicMaintenanceTask` includes several mutable fields
whose values determine what stage of the computation is currently
active, so that the task can re-invoke itself to run each stage. This is
pretty confusing and doesn't play very nicely with refcounting the
search responses. With this commit we rework the task to avoid these
mutable fields and clarify how it executes.

Relates elastic#103245
elasticsearchmachine pushed a commit that referenced this issue Dec 14, 2023
Today the `PeriodicMaintenanceTask` includes several mutable fields
whose values determine what stage of the computation is currently
active, so that the task can re-invoke itself to run each stage. This is
pretty confusing and doesn't play very nicely with refcounting the
search responses. With this commit we rework the task to avoid these
mutable fields and clarify how it executes.

Relates #103245
@DaveCTurner
Copy link
Contributor

#103383 resolves this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs Team:Distributed Meta label for distributed team >tech debt
Projects
None yet
Development

No branches or pull requests

3 participants