From 244a65fb293573cad7b80407ff0e14ff96297ec4 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Sun, 5 Feb 2017 02:25:09 +0100 Subject: [PATCH] storage: Increase persist watermark before calling append The append call may reuse cds, and thus change its len. (In practice, this wouldn't happen as cds should have len==cap. Still, the previous order of lines was problematic.) --- storage/local/series.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/local/series.go b/storage/local/series.go index 63e4a0e2a..ba8898a59 100644 --- a/storage/local/series.go +++ b/storage/local/series.go @@ -464,9 +464,9 @@ func (s *memorySeries) preloadChunksForRange( fp, s.chunkDescsOffset, len(cds), ) } + s.persistWatermark += len(cds) s.chunkDescs = append(cds, s.chunkDescs...) s.chunkDescsOffset = 0 - s.persistWatermark += len(cds) if len(s.chunkDescs) > 0 { firstChunkDescTime = s.chunkDescs[0].FirstTime() }