-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
output: Add backup feature for bad chunks #1952
Conversation
Signed-off-by: Masahiro Nakagawa <[email protected]>
lib/fluent/plugin/output.rb
Outdated
@@ -1115,6 +1149,21 @@ def try_flush | |||
end | |||
end | |||
|
|||
def backup_chunk(chunk, using_secondary, delayed_commit) | |||
unique_id = dump_unique_id_hex(chunk.unique_id) | |||
safe_plugin_id = plugin_id.gsub(/[ \/\\:]/, '_') |
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.
This feature assumes to work on Windows?
If so, we should add more prohibiting to use characters:
/ > < ? : " \ * | ;
are not permitted to use for filename on NTFS.
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.
Ah, good catch! Will add more characters.
I've added a comment about concerns on Windows environment. |
Signed-off-by: Masahiro Nakagawa <[email protected]>
Signed-off-by: Masahiro Nakagawa <[email protected]>
Signed-off-by: Masahiro Nakagawa <[email protected]>
The usage of this feature is hard to track down. Can it be added to the docs? |
@repeatedly Could you add the document about it. or had you already added? |
I Apologize for replying to an old issue. I am curious if there is a way to monitor the number of bad chunks, e.g., using Prometheus? |
Backup feature was implemented in fluent#1952, but it didn't support handling broken file chunks found in resuming buffer. This extends the backup feature to support it. Signed-off-by: Daijiro Fukuda <[email protected]>
Fix #1856
Current implementation covers most bad chunk cases. I need feedback before writing test.
root_dir
parameter for backup directory when specified,/${root_dir}/backup/worker${worker_id}/${plugin_id}/${chunk_id}.log
.Signed-off-by: Masahiro Nakagawa [email protected]