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

File states never get deleted from the filestream registry #36056

Closed
rdner opened this issue Jul 13, 2023 · 3 comments · Fixed by #38488
Closed

File states never get deleted from the filestream registry #36056

rdner opened this issue Jul 13, 2023 · 3 comments · Fixed by #38488
Assignees
Labels
enhancement Filebeat Filebeat Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Comments

@rdner
Copy link
Member

rdner commented Jul 13, 2023

Instead of using the delete operation the current implementation sets TTL to 0 instead.

func (s *store) remove(key string) error {
resource := s.ephemeralStore.Find(key, false)
if resource == nil {
return fmt.Errorf("resource '%s' not found", key)
}
s.UpdateTTL(resource, 0)
return nil
}

I suppose the intention was to optimise the deletion process and delay it until some kind of garbage collection.

However when we delete files:

  1. We retain their states in-memory (might be even until next restart)
  2. We make another set operation record in the registry log, which is much larger than the delete operation line
@rdner rdner added enhancement Filebeat Filebeat Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team labels Jul 13, 2023
@rdner rdner self-assigned this Jul 13, 2023
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@belimawr
Copy link
Contributor

belimawr commented Oct 5, 2023

I was looking into a similar issue, but from another perspective and ended up opening #36761. The TTL might not be the issue here. Anyway because they could be different, I ended up opening the new issue.

@rdner
Copy link
Member Author

rdner commented Mar 27, 2024

Re-assigning to @belimawr since he already has a fixing PR open.

@rdner rdner assigned belimawr and unassigned rdner Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Filebeat Filebeat Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants