From 3866e22a639c3321a10fc72ead6023cd66a8dfc5 Mon Sep 17 00:00:00 2001
From: Edward Welch <edward.welch@grafana.com>
Date: Fri, 3 May 2019 15:39:07 -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.

---
 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