Skip to content

Improve manual compaction status logging (#13688) #13689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Ryan4253
Copy link
Contributor

Summary

  1. RunManualCompaction notifies the user what level is currently being compacted
  2. RunManualCompaction and CompactRange logs the result of a compaction (scheduled, cancelled, skipped, can't be scheduled etc.)

Verification

Tried writing to the database then triggering manual compaction

This is the original output:

2025/04/04-10:47:23.391220 42848 [db/db_impl/db_impl_compaction_flush.cc:2176] [metadatal Manual compaction starting
<some more logs>
2025/04/04-10:47:26.003890 42848 [db/db_impl/db_impl_compaction_flush.cc:2176] [metadatal Manual compaction starting

This is the improved output:

2025/06/12-16:32:45.238721 107286 [db/db_impl/db_impl_compaction_flush.cc:2077] [metadata] Running manual compaction from level 0 to level -2
2025/06/12-16:32:45.238894 107286  [db/db_impl/db_impl_compaction_flush.cc:2181] [metadata] Scheduling compaction from level 0 to level -2
2025/06/12-16:32:45.239073 107128  [db/db_impl/db_impl_compaction_flush.cc:3639] [metadata] Manual compaction from level-0 to level-6 from (begin) .. (end); will stop at (end)
[2025-06-12T16:32:45.239716-04:00][I][event_listener.cc:92] [event_listener/compaction_begin] column family: metadata, job_id: 4, compaction reason: ManualCompaction, output compression type: no, base input level(files): 0(1), output level(files): 6(0), input bytes: 1507, output bytes: 0, is_manual_compaction: yes
<some more logs>
2025/06/12-16:32:45.255405 107286 [db/db_impl/db_impl_compaction_flush.cc:2077] [metadata] Running manual compaction from level 6 to level 6
2025/06/12-16:32:45.255418 107286 [db/compaction/compaction_picker.cc:807] [metadata] No files to compact at bottom level 6 since every file was created from a previous compaction, skipping

@Ryan4253 Ryan4253 force-pushed the twocompaction branch 3 times, most recently from 387abf9 to d692a29 Compare June 13, 2025 15:14
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.

2 participants