Documentation is unclear on if lost writes are always ordered and not random
- Dominant language
- C++
- Stars
- 39.4k
- Forks
- 8.2k
- PR merge metrics
- No merged PRs in 30d
Description
Let's say I do 2 writes and nothing else:
db->Put(leveldb::WriteOptions(), key1, value1);
db->Put(leveldb::WriteOptions(), key2, value2);
Now the database crashes. When I restart, can I assume "key1" exists if "key2" is present?
Basically, are writes ordered?
I assume this is the case since writes are all put sequentially in a log file, but it's possible to imagine an implementation using multiple log files where writes are flushed in parallel.
The documentation vaguely implies this is the case ("a crash of the machine may cause *the last* few updates to be lost"), but it's not exactly clear. Note that this property (ordered writes) are different from the "atomic"/"batch" property.
Contributor guide
Assessment
This issue has not been assessed yet.