QMDB compaction scans for active entries and moves them to the log tip. The current move allowance, total_steps, is user_steps + 1, with the extra step accounting for the previous CommitFloor becoming inactive. This bounds the number of active entries moved, but scanning has no independent work budget: it can traverse a large inactive range before finding those entries, making a commit expensive.
I propose configurable budgets for both scanning and moving, plus an explicit compaction API separate from batch finalization. Callers could disable automatic compaction on commit and choose when to run zero, one, or multiple bounded compaction rounds, while preserving the current behavior as the default.
QMDB compaction scans for active entries and moves them to the log tip. The current move allowance,
total_steps, isuser_steps + 1, with the extra step accounting for the previousCommitFloorbecoming inactive. This bounds the number of active entries moved, but scanning has no independent work budget: it can traverse a large inactive range before finding those entries, making a commit expensive.I propose configurable budgets for both scanning and moving, plus an explicit compaction API separate from batch finalization. Callers could disable automatic compaction on commit and choose when to run zero, one, or multiple bounded compaction rounds, while preserving the current behavior as the default.