Skip to content

Refresh time-based compaction trigger after option changes - #15427

Open
saikeerthan-14 wants to merge 1 commit into
facebook:mainfrom
saikeerthan-14:codex/fix-dynamic-compaction-trigger
Open

saikeerthan-14 wants to merge 1 commit into
facebook:mainfrom
saikeerthan-14:codex/fix-dynamic-compaction-trigger

Conversation

@saikeerthan-14

@saikeerthan-14 saikeerthan-14 commented Oct 18, 2026 •

Copy link
Copy Markdown

When an idle DB enables ttl or periodic_compaction_seconds through SetOptions, its compaction trigger keeps the period calculated at open. With the default wakeup cap that can delay the first check by 12 hours. Changing the DB wakeup cap through SetDBOptions, or adding or dropping a column family with a shorter time-based interval, has the same problem.

Refresh the existing kTriggerCompaction scheduler task after DB/CF option changes and CF creation or deletion. The scheduler already replaces a task only when its period changes, so unrelated updates leave the timer schedule intact. A multi-CF SetOptions call can apply an earlier CF change before a later one fails; the trigger is refreshed in that case too. This changes wakeup cadence only. It does not change compaction eligibility, public APIs, ABI, or on-disk formats.

The regressions use the scheduler's mock clock and registration callback to verify that the period follows SetOptions, SetDBOptions, CF creation and deletion, including increases when a short interval is removed and a partial multi-CF update. The existing scheduler test is updated to expect rescheduling when stats periods change. A one-line release note is included.

Closes #15251.

Validation

  • All 7 periodic_task_scheduler_test tests pass with ASSERT_STATUS_CHECKED=1 on macOS/Apple Clang. The prior version of the patch also passed all 6 scheduler tests in a normal build; the final change adds one checked-status regression and a partial-failure refresh.
  • The three trigger-period tests pass 100 repetitions in the checked-status build.
  • make check-sources, make check-format, and git diff --check pass.
  • A full checked-status make check run on the final production code passed its format gate and reported no failures through 645 of 1,889 shards. I stopped it because the unrelated external-SST test shards were taking a long time; it was not completed. The partial-update regression was added afterward and passed the focused checked-status run.

@meta-cla meta-cla Bot added the CLA Signed label Oct 18, 2026
@saikeerthan-14
saikeerthan-14 force-pushed the codex/fix-dynamic-compaction-trigger branch from 08b122d to f8943eb Compare October 18, 2026 21:06
@saikeerthan-14
saikeerthan-14 force-pushed the codex/fix-dynamic-compaction-trigger branch from f8943eb to 3dc42f9 Compare October 18, 2026 21:24
@saikeerthan-14
saikeerthan-14 marked this pull request as ready for review October 18, 2026 21:25

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kTriggerCompaction is never re-registered, so time-based compaction set via SetOptions never fires on an idle DB

1 participant