You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
when using the in_tail position file compaction via pos_file_compaction_interval the position files become corrupted
To Reproduce
Reproduced on a kubernetes cluster running compaction every 24 seconds and several pods in crashloop backoff so there was stuff to compact.
that call is performed outside of the lock but it reads the file, this means it can read file currently being modified by another thread and the writes of the position file are not atomic on the filesystem level.
this could either to move the fetch into the mutex lock or make the position file writes atomic via `rename´
The text was updated successfully, but these errors were encountered:
Describe the bug
when using the in_tail position file compaction via
pos_file_compaction_interval
the position files become corruptedTo Reproduce
Reproduced on a kubernetes cluster running compaction every 24 seconds and several pods in crashloop backoff so there was stuff to compact.
Expected behavior
no corruption
Your Environment
Your Configuration
standard in_tail configuration with
pos_file_compaction_interval 24
Your Error Log
The corrupted position file looks like this, note the
ffffffffffffffff
part with the missing spacethere are actually lots of null bytes added in the problematic spot
The problem is likely caused by a race condition in
try_compact
during thefetch_compacted_entries
callhttps://github.com/fluent/fluentd/blob/master/lib/fluent/plugin/in_tail/position_file.rb#L90
that call is performed outside of the lock but it reads the file, this means it can read file currently being modified by another thread and the writes of the position file are not atomic on the filesystem level.
this could either to move the fetch into the mutex lock or make the position file writes atomic via `rename´
The text was updated successfully, but these errors were encountered: