prometheus/tsdb/wal
Sunil Thaha a484a83d4a
fix: panic when checkpoint directory is empty (#9687)
Calling `wal.NewSegmentBufReader()` without any segments would cause a
`panic` resulting in prometheus crashing. This patch fixes the panic by
making segmentBufReader return a EOF if there are not segments.

This also means an empty checkpoint directory which should never be the
case unless it has been tampered with (or has issues due to the
underlying filesystem e.g. NFS) would be ignored by Prometheus and would
continue to run instead of the current behaviour which is to panic.

Fixes: https://github.com/prometheus/prometheus/issues/9605

Signed-off-by: Sunil Thaha <sthaha@redhat.com>
2021-11-17 16:39:04 +05:30
..
checkpoint.go TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
checkpoint_test.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
live_reader.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
reader.go
reader_test.go tsdb/wal: fix flaky TestReaderFuzz* tests 2021-11-09 14:32:20 +01:00
wal.go fix: panic when checkpoint directory is empty (#9687) 2021-11-17 16:39:04 +05:30
wal_test.go Format Go source files using 'gofumpt -w -s -extra' 2021-11-02 19:52:34 +01:00
watcher.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
watcher_test.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00