prometheus/tsdb/index
Oleg Zaytsev b1e4052682
MemPostings.Delete(): make pauses to unlock and let the readers read (#15242)
This introduces back some unlocking that was removed in #13286 but in a
more balanced way, as suggested by @pracucci.

For TSDBs with a lot of churn, Delete() can take a couple of seconds,
and while it's holding the mutex, reads and writes are blocked waiting
for that mutex, increasing the number of connections handled and memory
usage.

This implementation pauses every 4K labels processed (note that also
compared to #13286 we're not processing all the label-values anymore,
but only the affected ones, because of #14307), makes sure that it's
possible to get the read lock, and waits for a few milliseconds more.

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Co-authored-by: Marco Pracucci <marco@pracucci.com>
2024-11-05 12:59:57 +01:00
..
index.go log last series labelset when hitting OOO series labels during compaction 2024-10-24 09:27:15 -07:00
index_test.go add unit test 2024-06-16 12:09:42 -07:00
postings.go MemPostings.Delete(): make pauses to unlock and let the readers read (#15242) 2024-11-05 12:59:57 +01:00
postings_test.go Revert "Fix MemPostings.Add and MemPostings.Get data race (#15141)" 2024-11-03 12:30:34 +00:00
postingsstats.go Move from golang.org/x/exp/slices into slices now that we only support Go >= 1.21 2024-02-28 14:54:53 +01:00
postingsstats_test.go Upgrade golangci-lint to v1.60.1 2024-08-18 12:13:25 +02:00