diff --git a/lib/logstorage/pipe_stats.go b/lib/logstorage/pipe_stats.go index b42d1031b..4c38c28b8 100644 --- a/lib/logstorage/pipe_stats.go +++ b/lib/logstorage/pipe_stats.go @@ -296,6 +296,7 @@ func (spp *pipeStatsProcessor) flush() error { var values []string var br blockResult + zeroTimestamps := []int64{0} for key, spg := range m { // m may be quite big, so this loop can take a lot of time and CPU. // Stop processing data as soon as stopCh is closed without wasting additional CPU time. @@ -321,6 +322,7 @@ func (spp *pipeStatsProcessor) flush() error { } br.reset() + br.timestamps = zeroTimestamps // construct columns for byFields for i, f := range byFields { diff --git a/lib/logstorage/storage_search.go b/lib/logstorage/storage_search.go index 1cb3ebb41..5abadecbc 100644 --- a/lib/logstorage/storage_search.go +++ b/lib/logstorage/storage_search.go @@ -68,7 +68,8 @@ func (s *Storage) RunQuery(ctx context.Context, tenantIDs []TenantID, q *Query, csDst := brs.cs csSrc := br.getColumns() - for _, c := range csSrc { + for i := range csSrc { + c := &csSrc[i] values := c.getValues(br) csDst = append(csDst, BlockColumn{ Name: c.name,