mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-02 08:31:11 -08:00
Check last time in head chunk for head chunk timeout, not first.
This commit is contained in:
parent
db49fd965f
commit
dbc22b972c
|
@ -915,7 +915,7 @@ func (s *memorySeriesStorage) maintainMemorySeries(fp clientmodel.Fingerprint, b
|
|||
// If we are here, the series is not archived, so check for chunkDesc
|
||||
// eviction next and then if the head chunk needs to be persisted.
|
||||
series.evictChunkDescs(iOldestNotEvicted)
|
||||
if !series.headChunkPersisted && time.Now().Sub(series.head().firstTime().Time()) > headChunkTimeout {
|
||||
if !series.headChunkPersisted && time.Now().Sub(series.head().lastTime().Time()) > headChunkTimeout {
|
||||
series.headChunkPersisted = true
|
||||
// Since we cannot modify the head chunk from now on, we
|
||||
// don't need to bother with cloning anymore.
|
||||
|
|
Loading…
Reference in a new issue