mirror of
https://github.com/prometheus/prometheus.git
synced 2026-07-14 11:41:03 -04:00
This will allow the simplification of the directIOWriter. PR #7573 introduced a .tmp file + rename pattern in cutSegmentFile to prevent mmap from seeing empty files after a crash. However, without an fsync on the file itself, a crash could still leave the renamed file with zero content or sth else. PR #8061 added repairLastChunkFile as the real fix, extended in PR #11338 to detect zero magic numbers. The .tmp indirection is redundant, both callers have crash safety: - Head chunks: repairLastChunkFile removes corrupt last files on startup. No intermediary broken file can exist (handleChunkWriteError panics, so the corrupt file is always the last one). - Compaction: files live in a .tmp-for-creation block directory, cleaned up entirely on failure or restart. Remove the pattern for fewer syscalls and a simpler write path. Signed-off-by: Ayoub Mrini <ayoubmrini424@gmail.com> |
||
|---|---|---|
| .. | ||
| chunk_write_queue.go | ||
| chunk_write_queue_test.go | ||
| chunks.go | ||
| chunks_test.go | ||
| head_chunks.go | ||
| head_chunks_other.go | ||
| head_chunks_test.go | ||
| head_chunks_windows.go | ||
| queue.go | ||
| queue_test.go | ||
| samples.go | ||