mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-13 06:47:28 -08:00
Merge branch 'panic-fix2' of https://github.com/Gouthamve/tsdb into Gouthamve-panic-fix2
This commit is contained in:
commit
291137781b
4
head.go
4
head.go
|
@ -574,6 +574,8 @@ func (h *headBlock) create(hash uint64, lset labels.Labels) *memSeries {
|
||||||
lset: lset,
|
lset: lset,
|
||||||
ref: uint32(len(h.series)),
|
ref: uint32(len(h.series)),
|
||||||
}
|
}
|
||||||
|
// create the initial chunk and appender
|
||||||
|
s.cut()
|
||||||
|
|
||||||
// Allocate empty space until we can insert at the given index.
|
// Allocate empty space until we can insert at the given index.
|
||||||
h.series = append(h.series, s)
|
h.series = append(h.series, s)
|
||||||
|
@ -636,7 +638,7 @@ func (s *memSeries) append(t int64, v float64) bool {
|
||||||
|
|
||||||
var c *memChunk
|
var c *memChunk
|
||||||
|
|
||||||
if s.app == nil || s.head().samples > 130 {
|
if s.head().samples > 130 {
|
||||||
c = s.cut()
|
c = s.cut()
|
||||||
c.minTime = t
|
c.minTime = t
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue