[LevelDB 1.22] ERROR_UNABLE_TO_REMOVE_REPLACED 1175
- Dominant language
- C++
- Stars
- 39.4k
- Forks
- 8.2k
- PR merge metrics
- No merged PRs in 30d
Description
levelDB 1.22
windows 10 x64
levelDB is throwing above mentioned error.
We use a C# wrapper for a unity project, where this is the case nearly 100% of the time, but it can be reproduced by this code:
```c++
#include
#include
#include "leveldb/db.h"
#include "leveldb/env.h"
int main()
{
std::cout << "Hello World!\n";
for (int i = 0; i < 50; ++i) {
leveldb::DB* db;
leveldb::Options options;
options.create_if_missing = true;
leveldb::Status status = leveldb::DB::Open(options, "...somepath....\\TESTDIR", &db);
assert(status.ok());
std::string value;
status = db->Put(leveldb::WriteOptions(), "key123", "5");
assert(status.ok());
status = db->Get(leveldb::ReadOptions(), "key123", &value);
assert(status.ok());
assert(value.compare("5") == 0);
std::cout << value;
status = db->Delete(leveldb::WriteOptions(), "key123");
assert(status.ok());
delete db;
}
}
```
the error happens on `leveldb::DB::Open`
and a stacktrace would be:
`leveldb::DB::Open` > `VersionSet::LogAndApply` > `SetCurrentFile` > `env_windows.cc RenameFile`
line 542 `return WindowsError(src, replace_error);`
where the replace error with code 1175 is returned
src = TESTDIR/LOG
target = TESTDIR/LOG.old
___________
this is also the case for alternating folder names:
```c++
std::stringstream ss;
ss << "C:\\Users\\boliver\\Documents\\leveldb\\MyOwnTest\\TESTDIR";
ss << i;
leveldb::Status status = leveldb::DB::Open(options, ss.str(), &db);
```
the error also appears when running the benchmarks
Contributor guide
Assessment
This issue has not been assessed yet.