Browse Source

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>
pull/9591/head
Mateusz Gozdek 3 years ago committed by GitHub
parent
commit
b319b14431
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      tsdb/chunks/head_chunks_other.go

5
tsdb/chunks/head_chunks_other.go

@ -17,5 +17,6 @@
package chunks
// 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.
var HeadChunkFilePreallocationSize int64
// Windows needs pre-allocations while the other OS does not. But we observed that a 0 pre-allocation causes unit tests to flake.
// This small allocation for non-Windows OSes removes the flake.
var HeadChunkFilePreallocationSize int64 = MinWriteBufferSize * 2

Loading…
Cancel
Save