Level / leveldown

Pure C++ Node.js LevelDB binding. An abstract-leveldown compliant store.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`db.get()` doesn't read from a snapshot

vweevers opened this issue · comments

We don't set the LevelDB snapshot option for database_->Get(), so rather than reading from a snapshot created at the time that db.get() was called, it will read from an implicit snapshot (i.e. latest state) at the time the async worker runs:

SetStatus(database_->Get(options_, key_, value_));

For comparison, see db.getMany() where we do set the snapshot option:

options_.snapshot = database->NewSnapshot();

This may have been the case for a long time and I've personally not found this to be a problem in real-world apps. Putting this in the backlog until there are upvotes.

Tracked in Level/community#118. It won't be fixed in leveldown, only its successor classic-level.