-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[bug][filestream] - Fix filebeat GC cleanup bug #40258
[bug][filestream] - Fix filebeat GC cleanup bug #40258
Conversation
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just some requests for comments before merge
@@ -130,5 +130,5 @@ func checkCleanResource(started, now time.Time, resource *resource) bool { | |||
reference = started | |||
} | |||
|
|||
return reference.Add(ttl).Before(now) && resource.stored | |||
return (ttl >= 0 && reference.Add(ttl).Before(now)) && resource.stored |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment here too, something like "If ttl is negative we never delete it, otherwise check how much time is elapsed."
Nit: the extra parentheses aren't needed since it's just an && of three conditions. Optionally you could also do an immediate if ttl < 0 { return }
above so the extra clause isn't needed here.
@faec Thanks for your quick review! and please let me know if it looks good. |
@kilfoyle the docs-build-pr run is now green according to https://buildkite.com/elastic/docs-build-pr/builds/112412 but it looks like the check is not updated yet, is that a known issue? |
run docs-build |
@jlind23 this is now green. |
* chore: initial commit * chore: remove default 30mins * fix: set -1 for default * fix: typo * fix: remove validator * fix: typo * chore: update reference.yml * chore: add changelog * fix: update reference.yml * fix: address review comments * fix: typo (cherry picked from commit 1ca6e2f)
…ug (#40277) * [bug][filestream] - Fix filebeat GC cleanup bug (#40258) * chore: initial commit * chore: remove default 30mins * fix: set -1 for default * fix: typo * fix: remove validator * fix: typo * chore: update reference.yml * chore: add changelog * fix: update reference.yml * fix: address review comments * fix: typo (cherry picked from commit 1ca6e2f) * Update CHANGELOG.next.asciidoc --------- Co-authored-by: VihasMakwana <[email protected]> Co-authored-by: Pierre HILBERT <[email protected]>
Type
Proposed commit message
From #40178,
Fix this behaviour by adding a check to disable
gcClean
ifttl == -1
clean_interval
is changed to-1
clean_inactive: 0
will clean states right after the file is closedChecklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Disruptive User Impact
clean_inactive: -1
Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs