facebook / facebook/rocksdb

When I use db_paths ops, rocksdb write data to db_paths[0] & db_paths[3] path only

Open
#10,841 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
32.1k
Forks
6.9k
Avg merge
32m
Merged PRs (30d)
1

Description

rocks options
```
options_.db_paths = {{"/mnt/rocksdb/a", 1000 * 1000 * 1000},
{"/mnt/rocksdb/b", 1000 * 1000 * 1000},
{"/mnt/rocksdb/c", 1000 * 1000 * 1000},
{"/mnt/rocksdb/d", 1000 * 1000 * 1000}};
```
After put some data, /mnt/rocksdb/a & /mnt/rocksdb/d will be writed sst file, but /mnt/rocksdb/a & /mnt/rocksdb/d is empty
```
du -h /mnt/rocksdb/
4.0K /mnt/rocksdb/b
4.0K /mnt/rocksdb/c
958M /mnt/rocksdb/a
944M /mnt/rocksdb/d
1.9G /mnt/rocksdb/
```

### Expected behavior
According to the document description https://github.com/facebook/rocksdb/blob/main/include/rocksdb/options.h#L672
I think rocksdb will write sst file to /mnt/rocksdb/a => /mnt/rocksdb/b => /mnt/rocksdb/c => /mnt/rocksdb/d

### Actual behavior
rocksdb write sst file /mnt/rocksdb/a => /mnt/rocksdb/d,and /mnt/rocksdb/b & /mnt/rocksdb/c be skipped

### Steps to reproduce the behavior

```
// 1. set db_paths
options_.db_paths = {{"/mnt/rocksdb/a", 1000 * 1000 * 1000},
{"/mnt/rocksdb/b", 1000 * 1000 * 1000},
{"/mnt/rocksdb/c", 1000 * 1000 * 1000},
{"/mnt/rocksdb/d", 1000 * 1000 * 1000}};
// 2. opendb
rocksdb::DB::Open(options_, name, column_families, &cf_handles_, &db_);

// 3. put kv
db_->Put(rocksdb::WriteOptions(), key, value);
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.