From fe53924ff8ce46ed85d8b815d7e0da4ae4e9e3a9 Mon Sep 17 00:00:00 2001
From: Ed <edward.welch@grafana.com>
Date: Sun, 5 May 2019 07:18:19 -0400
Subject: [PATCH] using the timestamp from the log file might lead to undesired
 behavior as it could be way in the past or future depending on the clock for
 the source system generating the logs.  Given that it's compared to the
 servers time.Now() when looking for idle chunks it's probably best to use the
 server time when setting the value. (#546)

---
 pkg/ingester/stream.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/ingester/stream.go b/pkg/ingester/stream.go
index 71f49587..88ea0166 100644
--- a/pkg/ingester/stream.go
+++ b/pkg/ingester/stream.go
@@ -94,7 +94,7 @@ func (s *stream) Push(_ context.Context, entries []logproto.Entry) error {
 		if err := chunk.chunk.Append(&entries[i]); err != nil {
 			appendErr = err
 		}
-		chunk.lastUpdated = entries[i].Timestamp
+		chunk.lastUpdated = time.Now()
 	}
 
 	if appendErr == chunkenc.ErrOutOfOrder {
-- 
GitLab