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
db: edit default heuristic determining levels eligible for compaction
When deciding whether a level is even eligible for compaction picking, we
consider the 'compensated fill factor': a statistic about the size of a level
plus its garbage relative to the level's ideal size given the level multiplier
and database size. Previously, we considered a level eligible to be the input
level of a compaction if the compensated fill factor is >= 1.0 AND the
compensated fill factor divided by the next level's fill factor is also > 1.0.
We've preserved this behavior for historical consistency but have no clear
justification for it. Experimentally, we've observed instances where the LSM is
known to contain significant garbage (>14%) but no compactions are pursued
because most of the data is in L6 and L6's fill factor is positive (see
cockroachdb/cockroach#151633).
This commit adjusts the default behavior to only require a compensated score >=
1.0 for L0. Other levels only require a 'compensated fill factor' >= 1.0 to be
eligible for compaction.
A new experimental UseDeprecatedCompensatedScore Option is introduced to allow
opting out of the new behavior at runtime. This option is intended as an escape
hatch if we observe unintended side effects in production. Otherwise, it'll
ultimately be removed.
0 commit comments