-
Notifications
You must be signed in to change notification settings - Fork 1.4k
buffer: add feature to evacuate chunk files when retry limit #4986
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
Merged
daipom
merged 1 commit into
fluent:master
from
daipom:buffer-add-feature-to-evacuate-chunk-files-when-retry-limit
Jun 4, 2025
Merged
buffer: add feature to evacuate chunk files when retry limit #4986
daipom
merged 1 commit into
fluent:master
from
daipom:buffer-add-feature-to-evacuate-chunk-files-when-retry-limit
Jun 4, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ashie
reviewed
Jun 2, 2025
d835716
to
6250640
Compare
Signed-off-by: Daijiro Fukuda <[email protected]>
6250640
to
365697e
Compare
Watson1978
reviewed
Jun 3, 2025
Watson1978
reviewed
Jun 3, 2025
Watson1978
approved these changes
Jun 4, 2025
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.
👍🏻
Thanks for your review! |
daipom
pushed a commit
that referenced
this pull request
Jun 27, 2025
#5012) **Which issue(s) this PR fixes**: Fixes # **What this PR does / why we need it**: Enable Security & Performance check with RuboCop. Guard code regression such as follows: ``` Offenses: test/plugin/test_buf_file.rb:26:29: C: [Correctable] Performance/StringIdentifierArgument: Use :@Write instead of "@Write". instance_variable_set("@Write", block) ^^^^^^^^ test/plugin/test_buf_file_single.rb:43:29: C: [Correctable] Performance/StringIdentifierArgument: Use :@Write instead of "@Write". instance_variable_set("@Write", block) ^^^^^^^^ ``` Above trivial regression was introduced via #4986 **Docs Changes**: N/A **Release Note**: N/A Signed-off-by: Kentaro Hayashi <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which issue(s) this PR fixes:
None.
What this PR does / why we need it:
Add feature to evacuate chunk files when retry limit.
When reached the retry limit,
buf_file
andbuf_file_single
evacuates all the chunk files (and the meta files) in the queue to the following dir before purging.(root_dir)/buffer/(plugin-id)/
root_dir
issystem_config.root_dir
if it is configured.Otherwise,
DEFAULT_BACKUP_DIR
is applied.(
/tmp/fluent
. We can change this by env varFLUENT_BACKUP_DIR
)There is no separate directory for each worker because the IDs of each chunk are entirely unique.
This makes recovery easier.
After the problem with the flush (such as a network issue) is resolved, we can put back the files and restart Fluentd to flush them again.
Difference from the
backup
feature:The
backup
feature is for unrecoverable errors, mainly for bad chunks.On the other hand, this feature is for normal chunks.
The main motivation for this feature is to enable recovery by evacuating buffer files
when the retry limit is reached due to external factors such as network issues.
Difference from the
secondary
feature:The
secondary
feature is not suitable for recovery.It can be difficult to recover files made by
out_secondary_file
because the metadata is lost.For file buffers, the easiest way for recovery is to evacuate the chunk files as is.
Once the issue is recovered, we can put back the chunk files, and restart Fluentd to load them.
This feature enables it.
Docs Changes:
fluent/fluentd-docs-gitbook#583
Release Note:
Same as the title.