google / google/leveldb

CompactRange(): Try to remove non existing ldb files

Open
#573 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
39.4k
Forks
8.2k
PR merge metrics
No merged PRs in 30d

Description

Hi !

When running a strace on my project, I observed that LevelDB try to delete ldb files that doesn't exists each time I use CompactRange().

Here is a sample of code that trigger the issue.
```c++
#include
#include "leveldb/db.h"

int main(void) {
leveldb::DB* db;
leveldb::Options options;
options.create_if_missing = true;
leveldb::Status status = leveldb::DB::Open(options, "/tmp/testdb", &db);
assert(status.ok());
db->CompactRange(NULL, NULL);
}
```
When running it with "strace -f" I catch this line:
```
...
[pid 31575] unlink("/tmp/testdb/000005.ldb") = -1 ENOENT (No such file or directory)
...
```
I mainly wanted to know if it is a wanted/normal behaviour of a compaction, as it doesn't seems to happen when it is a not forced compaction.

Cheers !

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.