mirror of
https://github.com/prometheus/prometheus
synced 2024-12-26 00:23:18 +00:00
tsdb/chunks: preallocate at least some space on non-Windows systems (#9581)
To avoid potential chunk corruption read, which I am not sure why is happening. Closes #9561. Signed-off-by: Mateusz Gozdek <mgozdekof@gmail.com>
This commit is contained in:
parent
c564984daa
commit
b319b14431
@ -17,5 +17,6 @@
|
|||||||
package chunks
|
package chunks
|
||||||
|
|
||||||
// HeadChunkFilePreallocationSize is the size to which the m-map file should be preallocated when a new file is cut.
|
// HeadChunkFilePreallocationSize is the size to which the m-map file should be preallocated when a new file is cut.
|
||||||
// Windows needs pre-allocations while the other OS does not.
|
// Windows needs pre-allocations while the other OS does not. But we observed that a 0 pre-allocation causes unit tests to flake.
|
||||||
var HeadChunkFilePreallocationSize int64
|
// This small allocation for non-Windows OSes removes the flake.
|
||||||
|
var HeadChunkFilePreallocationSize int64 = MinWriteBufferSize * 2
|
||||||
|
Loading…
Reference in New Issue
Block a user