apache / apache/kvrocks

Question about `Storage::CreateColumnFamilies()`

Open
#3,143 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
4.4k
Forks
658
Avg merge
1d 20h
Merged PRs (30d)
10

Description

### Search before asking

- [x] I had searched in the [issues](https://github.com/apache/kvrocks/issues) and found no similar issues.

### Motivation

Since we have already set `create_missing_column_families` to `true` when opening db,
https://github.com/apache/kvrocks/blob/9446fbde325767f7b64896c4539035402d0f8f7a/src/storage/storage.cc#L162

is there any special reason to call `Storage::CreateColumnFamilies()` and create column families explicitly?
https://github.com/apache/kvrocks/blob/9446fbde325767f7b64896c4539035402d0f8f7a/src/storage/storage.cc#L293-L297

It seems that this causes kvrocks to open rocksdb twice upon startup.

### Solution

Remove the call to `Storage::CreateColumnFamilies()` and let rocksdb create missing column families automatically.

### Are you willing to submit a PR?

- [x] I'm willing to submit a PR!

Contributor guide

No contributing guide indexed for this repository

Research direction

Read src/storage/storage.cc around the linked lines, including the create_missing_column_families setting and the call to Storage::CreateColumnFamilies(). Confirm the startup behavior and whether removing the explicit call avoids opening RocksDB twice; done means missing column families are still created automatically without that call.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
databases
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.