mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-13 14:57:40 -08:00
Don't do anything if MemPostings are empty
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
This commit is contained in:
parent
9c417aa710
commit
ccd0308abc
|
@ -293,10 +293,12 @@ func (p *MemPostings) EnsureOrder(numberOfConcurrentProcesses int) {
|
|||
func (p *MemPostings) Delete(deleted map[storage.SeriesRef]struct{}, affected map[labels.Label]struct{}) {
|
||||
p.mtx.Lock()
|
||||
defer p.mtx.Unlock()
|
||||
if len(p.m) == 0 || len(deleted) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
// Deleting label names mutates p.m map, so it should be done from a single goroutine after nobody else is reading it.
|
||||
// Adding +1 to length to account for allPostingsKey processing when MemPostings is empty.
|
||||
deleteLabelNames := make(chan string, len(p.m)+1)
|
||||
deleteLabelNames := make(chan string, len(p.m))
|
||||
|
||||
process := func(l labels.Label) {
|
||||
orig := p.m[l.Name][l.Value]
|
||||
|
|
Loading…
Reference in a new issue