rust-rocksdb / rust-rocksdb/rust-rocksdb

No function to allow_compaction for FifoCompactOptions

Open
#758 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2.2k
Forks
874
PR merge metrics
No merged PRs in 30d

Description

When creating a new rocksdb database with FIFO compactions, I believe it is necessary to have compactions enabled to be able to actually delete old table files. In my OPTIONS file I can see that the allow_compactions paramater is by default set to false (see below).

compaction_options_fifo={allow_compaction=false;age_for_warm=0;max_table_files_size=20480;}

After looking through this codebase I do not see a public function to be able to set allow_compaction equal to true, meaning FIFO compactions don't work. i.e. old sst files are never deleted once set_max_table_files_size is reached. I tested this out by setting a low max_table_files_size size (20KB), and seeing that even with manual flushes/compactions happening in code the total_sst_files_size grows well beyond the 20KB and no sst files are ever deleted.

Is there a workaround to get FIFO compactions working in rocksdb crate?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with FifoCompactOptions and the compaction_options_fifo OPTIONS entry, then trace how allow_compaction and set_max_table_files_size are exposed. Done means a public way to enable allow_compaction and verification that old SST files are deleted when a low table-size limit is reached.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
database
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.