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

remove method actually deletes the current implementation #36057

Closed
wants to merge 1 commit into from

Conversation

MrTbag
Copy link

@MrTbag MrTbag commented Jul 13, 2023

  • Enhancement

What does this PR do?

In this updated version of the remove function, instead of updating the TTL of the resource to 0, we directly remove the resource from the ephemeralStore using its Remove method. This should fix the issue and properly delete the resource from memory.

Why is it important?

The original implementation set the TTL of the resource to 0, which retained the resource’s state in memory and made another set operation record in the registry log. This might have been done to optimize the deletion process and delay it until some kind of garbage collection. However, when files are deleted, their states are retained in memory and another set operation record is made in the registry log, which is much larger than the delete operation line. This could potentially cause issues with memory usage and registry log size.
The updated code I provided directly removes the resource from the ephemeralStore using its Remove method. This should properly delete the resource from memory and avoid making another set operation record in the registry log.

Checklist

  • My code follows the style guidelines of this project
    [ ] I have commented my code, particularly in hard-to-understand areas
    [ ] I have made corresponding changes to the documentation
    [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

@MrTbag MrTbag requested a review from a team as a code owner July 13, 2023 14:37
@cla-checker-service
Copy link

❌ Author of the following commits did not sign a Contributor Agreement:
7a9cd3e

Please, read and sign the above mentioned agreement if you want to contribute to this project

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 13, 2023
@botelastic
Copy link

botelastic bot commented Jul 13, 2023

This pull request doesn't have a Team:<team> label.

@mergify mergify bot assigned MrTbag Jul 13, 2023
@mergify
Copy link
Contributor

mergify bot commented Jul 13, 2023

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @MrTbag? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@MrTbag MrTbag closed this Jul 13, 2023
@elasticmachine
Copy link
Collaborator

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants