You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Idea: add a mode where Prometheus will do head compaction/WAL truncation before starting scraping #11306
would it be possible to run a compaction/WAL cleanup as soon as the replay has been completed? That would help us avoid the crash-loop we find ourselves in, whereby a pod restart causes WAL replay to happen, but then they never get cleaned up, so when the OOM-killer comes along the same WALs get replayed on the next restart and on and on we go in circles until we resign ourselves to removing the WALs and thereby losing data.
I found myself wanting this today.
I will add, I think it is important that we not start scraping until after this head compaction has finished, to keep memory usage down and avoid making the WAL any bigger, because if Prometheus OOMs again it will restart with a worse problem.
It could be a CLI flag to Prometheus, like --force-head-compaction-at-start.
Reacted by maxwell-gregory, Paolo Filippelli, nir950, Zoltán Reegn, Mark Summers, Daniel Martins, WeiCheng Fang, Laurent Godet, Agalin, Per Hermansson and 1 more
Sounds good to me, but what would be the effect if someone uses this routinely? Would it still create non overlapping aligned blocks or would that create new blocks every time?
During research for #12286 I realised that doing WAL checkpoint and truncation to the end of the last real block, before doing anything else, will be a benefit.
Perhaps also scan the WAL to see which series have samples after that time, so that the checkpoint can be built with the minimum set of series.
changed the title [-]Idea: add a mode where Prometheus will do a head compaction before starting scraping[/-][+]Idea: add a mode where Prometheus will do head compaction/WAL truncation before starting scraping[/+]on Sep 20, 2023
Activity
bboreham commentedon Sep 14, 2022
Related idea: #7575, #7939.
roidelapluie commentedon Jan 23, 2023
Sounds good to me, but what would be the effect if someone uses this routinely? Would it still create non overlapping aligned blocks or would that create new blocks every time?
bboreham commentedon Apr 23, 2023
During research for #12286 I realised that doing WAL checkpoint and truncation to the end of the last real block, before doing anything else, will be a benefit.
Perhaps also scan the WAL to see which series have samples after that time, so that the checkpoint can be built with the minimum set of series.
[-]Idea: add a mode where Prometheus will do a head compaction before starting scraping[/-][+]Idea: add a mode where Prometheus will do head compaction/WAL truncation before starting scraping[/+]alexgreenbank commentedon Oct 8, 2024
Hello from the bug scrub.
We assume this is still relevant. Bryan please let us know if not.