mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-24 21:24:05 -08:00
Don't crash on an unknown tombstone ref. (#604)
Fixes https://github.com/prometheus/prometheus/issues/5562 Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
This commit is contained in:
parent
63d9c2ab18
commit
30d0ea59d7
4
head.go
4
head.go
|
@ -421,6 +421,10 @@ func (h *Head) loadWAL(r *wal.Reader) error {
|
||||||
if itv.Maxt < h.minValidTime {
|
if itv.Maxt < h.minValidTime {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if m := h.series.getByID(s.ref); m == nil {
|
||||||
|
unknownRefs++
|
||||||
|
continue
|
||||||
|
}
|
||||||
allStones.addInterval(s.ref, itv)
|
allStones.addInterval(s.ref, itv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,6 +114,9 @@ func TestHead_ReadWAL(t *testing.T) {
|
||||||
{Ref: 10, T: 101, V: 5},
|
{Ref: 10, T: 101, V: 5},
|
||||||
{Ref: 50, T: 101, V: 6},
|
{Ref: 50, T: 101, V: 6},
|
||||||
},
|
},
|
||||||
|
[]Stone{
|
||||||
|
{ref: 0, intervals: []Interval{{Mint: 99, Maxt: 101}}},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
dir, err := ioutil.TempDir("", "test_read_wal")
|
dir, err := ioutil.TempDir("", "test_read_wal")
|
||||||
testutil.Ok(t, err)
|
testutil.Ok(t, err)
|
||||||
|
|
Loading…
Reference in a new issue