-
Notifications
You must be signed in to change notification settings - Fork 5
Disable auto compaction at the 1st place to make sure purger blocking… #92
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -607,6 +607,9 @@ bool RocksDBCloudDataStore::OpenCloudDB( | |||||||||||||||||||||||||||||||||||||||
| options.compaction_filter = | ||||||||||||||||||||||||||||||||||||||||
| static_cast<rocksdb::CompactionFilter *>(ttl_compaction_filter_.get()); | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| // Disable auto compactions before blocking purger | ||||||||||||||||||||||||||||||||||||||||
| options.disable_auto_compactions = true; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| auto start = std::chrono::system_clock::now(); | ||||||||||||||||||||||||||||||||||||||||
| std::unique_lock<std::shared_mutex> db_lk(db_mux_); | ||||||||||||||||||||||||||||||||||||||||
| rocksdb::Status status; | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -684,6 +687,9 @@ bool RocksDBCloudDataStore::OpenCloudDB( | |||||||||||||||||||||||||||||||||||||||
| // Resume background work | ||||||||||||||||||||||||||||||||||||||||
| db_->ContinueBackgroundWork(); | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| // Enable auto compactions after blocking purger | ||||||||||||||||||||||||||||||||||||||||
| status = db_->SetOptions({{"disable_auto_compactions", "false"}}); | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
687
to
+692
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: compactions may remain disabled — wrong SetOptions overload and ordering
Apply this fix: - // Resume background work
- db_->ContinueBackgroundWork();
-
- // Enable auto compactions after blocking purger
- status = db_->SetOptions({{"disable_auto_compactions", "false"}});
+ // Enable auto compactions after blocking purger (default column family)
+ status = db_->SetOptions(
+ db_->DefaultColumnFamily(),
+ {{"disable_auto_compactions", "false"}});
+ if (!status.ok())
+ {
+ LOG(ERROR) << "Fail to enable auto compactions, error: "
+ << status.ToString();
+ // Avoid leaving background work paused; resume and fail fast.
+ db_->ContinueBackgroundWork();
+ return false;
+ }
+ // Resume background work
+ db_->ContinueBackgroundWork();📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||
| if (cloud_config_.warm_up_thread_num_ != 0) | ||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||
| db_->WarmUp(cloud_config_.warm_up_thread_num_); | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify scope: disable_auto_compactions here affects only default CF
disable_auto_compactions is a ColumnFamily option. Setting it on Options before open typically covers only the default CF; existing CFs opened from manifest may keep their own settings. If multiple CFs exist, auto compactions may still run for them until PauseBackgroundWork executes.
Consider:
Run this to locate CF usage and confirm single-CF assumption:
🏁 Script executed:
Length of output: 148
🏁 Script executed:
Length of output: 21574
Apply disable_auto_compactions per-column-family (Options covers only default CF)
disable_auto_compactions is a ColumnFamily option — setting options.disable_auto_compactions before DB::Open only affects the default CF. This repo manages multiple CFs (rocksdb_handler.cpp), so other CFs can still perform compactions between Open and PauseBackgroundWork.
Action: either open with ColumnFamilyDescriptor(s) that set disable_auto_compactions=true for every CF, or immediately after Open and before ContinueBackgroundWork call SetOptions on every ColumnFamilyHandle to disable compactions (and re-enable later).
Locations: eloq_data_store_service/rocksdb_cloud_data_store.cpp (disable true ~line 611; SetOptions(false) ~line 691). Inspect rocksdb_handler.cpp for CF creation/listing.
🤖 Prompt for AI Agents