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

output: Add backup feature for bad chunks #1952

Merged
merged 4 commits into from
Apr 29, 2018
Merged

Conversation

repeatedly
Copy link
Member

@repeatedly repeatedly commented Apr 18, 2018

Fix #1856

Current implementation covers most bad chunk cases. I need feedback before writing test.

  • use root_dir parameter for backup directory when specified, /${root_dir}/backup/worker${worker_id}/${plugin_id}/${chunk_id}.log.
  • Call secondary directly when unrecoverable error happens

Signed-off-by: Masahiro Nakagawa [email protected]

@repeatedly repeatedly requested a review from mururu April 18, 2018 05:00
@repeatedly repeatedly self-assigned this Apr 18, 2018
@repeatedly repeatedly added feature request *Deprecated Label* Use enhancement label in general v1 labels Apr 18, 2018
@@ -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(/[ \/\\:]/, '_')
Copy link
Contributor

@cosmo0920 cosmo0920 Apr 23, 2018

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.

Copy link
Member Author

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.

@cosmo0920
Copy link
Contributor

I've added a comment about concerns on Windows environment.

Signed-off-by: Masahiro Nakagawa <[email protected]>
Signed-off-by: Masahiro Nakagawa <[email protected]>
@repeatedly repeatedly merged commit c765030 into master Apr 29, 2018
@JohnMealy23
Copy link

The usage of this feature is hard to track down. Can it be added to the docs?

@ganmacs ganmacs deleted the backup-for-chunks branch July 11, 2019 02:20
@ganmacs
Copy link
Member

ganmacs commented Dec 23, 2019

@repeatedly Could you add the document about it. or had you already added?

@repeatedly
Copy link
Member Author

Yes: https://docs.fluentd.org/buffer#handling-unrecoverable-errors

@jvshahid
Copy link

jvshahid commented Jul 2, 2020

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?

daipom added a commit to daipom/fluentd that referenced this pull request Jan 26, 2023
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request *Deprecated Label* Use enhancement label in general v1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output: Backup for bad chunk
5 participants