From b1ae906517852c0b4a249fe55901fc8096eecbbe Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Thu, 9 Dec 2021 18:59:42 +0000 Subject: [PATCH] ingester: use consistent set of instances (#4904) --- CHANGELOG.md | 2 +- pkg/ingester/checkpoint.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b207721281..6ad855baf1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ * [4875](https://github.com/grafana/loki/pull/4875) **trevorwhitney**: Loki: fix bug where common replication factor wasn't always getting applied * [4892](https://github.com/grafana/loki/pull/4892) **cristaloleg**: Loki: upgrade cristalhq/hedgedhttp from v0.6.0 to v0.7.0 * [4902](https://github.com/grafana/loki/pull/4902) **cyriltovena**: Fixes 500 when query is outside of max_query_lookback. - +* [4904](https://github.com/grafana/loki/pull/4904) **bboreham**: Fixes rare race condition that could crash an ingester. # 2.4.1 (2021/11/07) diff --git a/pkg/ingester/checkpoint.go b/pkg/ingester/checkpoint.go index 9b62980932..7e15ff543a 100644 --- a/pkg/ingester/checkpoint.go +++ b/pkg/ingester/checkpoint.go @@ -207,7 +207,7 @@ type streamIterator struct { func newStreamsIterator(ing ingesterInstances) *streamIterator { instances := ing.getInstances() streamInstances := make([]streamInstance, len(instances)) - for i, inst := range ing.getInstances() { + for i, inst := range instances { inst.streamsMtx.RLock() streams := make([]*stream, 0, len(inst.streams)) inst.streamsMtx.RUnlock()