Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/storage/backend/rocksdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ impl RocksDBBackend {
cf_opts.set_min_write_buffer_number_to_merge(2);
cf_opts.set_target_file_size_base(256 * 1024 * 1024); // 256MB
cf_opts.set_memtable_prefix_bloom_ratio(0.2); // Bloom filter
cf_opts.set_unordered_write(true);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 unordered_write is a DB-level option, not a CF-level option — this is a no-op

unordered_write belongs to DBOptions in RocksDB, not ColumnFamilyOptions. When it is set on the Options object passed to a ColumnFamilyDescriptor, the flag is silently ignored during CF-open because RocksDB only reads the DB-level portion of the options from the primary DB-open call, not from individual CF descriptors (confirmed by the RocksDB blog, which shows it set exclusively on DBOptions).

To actually take effect, set_unordered_write(true) must be called on the top-level opts object (line 32). However, doing so makes it a DB-wide setting — RocksDB has no mechanism to enable unordered writes selectively per column family. Additionally, enabling it at DB level would need verification against enable_pipelined_write(true) (line 60) and the PointInTime WAL recovery mode (line 54), which may require configuration adjustments.

Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/storage/backend/rocksdb.rs
Line: 133

Comment:
**`unordered_write` is a DB-level option, not a CF-level option — this is a no-op**

`unordered_write` belongs to `DBOptions` in RocksDB, not `ColumnFamilyOptions`. When it is set on the `Options` object passed to a `ColumnFamilyDescriptor`, the flag is silently ignored during CF-open because RocksDB only reads the DB-level portion of the options from the primary DB-open call, not from individual CF descriptors (confirmed by the [RocksDB blog](http://rocksdb.org/blog/2019/08/15/unordered-write.html), which shows it set exclusively on `DBOptions`).

To actually take effect, `set_unordered_write(true)` must be called on the top-level `opts` object (line 32). However, doing so makes it a DB-wide setting — RocksDB has no mechanism to enable unordered writes selectively per column family. Additionally, enabling it at DB level would need verification against `enable_pipelined_write(true)` (line 60) and the `PointInTime` WAL recovery mode (line 54), which may require configuration adjustments.

How can I resolve this? If you propose a fix, please make it concise.


let mut block_opts = BlockBasedOptions::default();
block_opts.set_block_size(16 * 1024); // 16KB
Expand Down
Loading