tsdb/index/postings: fix missing lock unlock

Followup to #14096

Unfortunately the previous PR introduced this bug by not releasing the
lock before returning.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
pull/14103/head
György Krajcsovits 7 months ago
parent fdaafdb041
commit b215a41be4

@ -419,6 +419,7 @@ func (p *MemPostings) PostingsForLabelMatching(ctx context.Context, name string,
count := 1 count := 1
for _, v := range vals { for _, v := range vals {
if count%checkContextEveryNIterations == 0 && ctx.Err() != nil { if count%checkContextEveryNIterations == 0 && ctx.Err() != nil {
p.mtx.RUnlock()
return ErrPostings(ctx.Err()) return ErrPostings(ctx.Err())
} }
count++ count++

Loading…
Cancel
Save