You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been reading the LevelDB source code a bit, and got to one corner case that I couldn't find implemented -- turns out, it isn't :-) This case is looking up an entry that did not exist at a given snapshot within that snapshot. It should not be found, but it is found using Get().
The documentation says Snapshots provide consistent read-only views over the entire state of the key-value store. This is correct for iterators; db_iter.cc:179 has a condition that skips "too new" entries. But in the Get() path, the tag of the key is cut off before looking up the key in either MemTable or Table/TableCache.
The nested comparators (KeyComparator -> InternalKeyComparator -> User provided comparator) with InternalKeyComparator providing the required ordering prevents this bug, and my PoC program was flawed, too.
When stopping a timer, the current time is subtracted
from the start time. However, when the times are identical,
or sufficiently close together, the subtraction can result
in a negative number.
For some reason MinGW is the only platform where this problem
manifests. I suspect it's due to MinGW specific behavior in either
the CPU timing code, floating point model, or printf formatting.
Either way, the fix for MinGW should be correct across all platforms.
I've been reading the LevelDB source code a bit, and got to one corner case that I couldn't find implemented -- turns out, it isn't :-) This case is looking up an entry that did not exist at a given snapshot within that snapshot. It should not be found, but it is found using
Get()
.The documentation says Snapshots provide consistent read-only views over the entire state of the key-value store. This is correct for iterators;
db_iter.cc:179
has a condition that skips "too new" entries. But in theGet()
path, the tag of the key is cut off before looking up the key in eitherMemTable
orTable
/TableCache
.Short example:
There are essentially two solutions to this IMO -
Get()
from the existing clause (in case this behaviour is WAI)The text was updated successfully, but these errors were encountered: