Skip to content

Revert "merge MemPostings: keep a map of label values slices (#15426)" - #3

Open
yuchen-db wants to merge 3 commits into
db_mainfrom
yuchen-db/db_main
Open

Revert "merge MemPostings: keep a map of label values slices (#15426)"#3
yuchen-db wants to merge 3 commits into
db_mainfrom
yuchen-db/db_main

Conversation

@yuchen-db

Copy link
Copy Markdown
Owner

This reverts commit 21fd618.

colega and others added 3 commits April 30, 2025 13:32
…rometheus#15242)

This introduces back some unlocking that was removed in prometheus#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 prometheus#13286 we're not processing all the label-values anymore,
but only the affected ones, because of prometheus#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>
Signed-off-by: Yuchen Wang <yuchen.wang@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants