mirror of
https://github.com/prometheus/prometheus.git
synced 2026-05-13 16:46:46 +02:00
POC for compacting earlier than 1.5x of block size
Signed-off-by: Ganesh Vernekar <ganesh.vernekar@reddit.com>
This commit is contained in:
parent
9e73fb43b3
commit
ca9688131b
@ -62,6 +62,8 @@ var (
|
||||
defaultIsolationDisabled = false
|
||||
|
||||
defaultWALReplayConcurrency = runtime.GOMAXPROCS(0)
|
||||
|
||||
compactibleRatio = 1.1
|
||||
)
|
||||
|
||||
// Head handles reads and writes of time series data within a time window.
|
||||
@ -1700,7 +1702,7 @@ func (h *Head) compactable() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
return h.MaxTime()-h.MinTime() > h.chunkRange.Load()/2*3
|
||||
return h.MaxTime()-h.MinTime() > int64(float64(h.chunkRange.Load())*compactibleRatio)
|
||||
}
|
||||
|
||||
// Close flushes the WAL and closes the head.
|
||||
|
||||
@ -194,7 +194,7 @@ func (h *Head) appender() *headAppender {
|
||||
func (h *Head) appendableMinValidTime() int64 {
|
||||
// This boundary ensures that no samples will be added to the compaction window.
|
||||
// This allows race-free, concurrent appending and compaction.
|
||||
cwEnd := h.MaxTime() - h.chunkRange.Load()/2
|
||||
cwEnd := h.MaxTime() - int64(float64(h.chunkRange.Load())*(compactibleRatio-1))
|
||||
|
||||
// This boundary ensures that we avoid overlapping timeframes from one block to the next.
|
||||
// While not necessary for correctness, it means we're not required to use vertical compaction.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user