Closed GoogleCodeExporter closed 9 years ago
The problem seems to be that when changing the iteration direction from reverse
to forward, a simple iter_->Next() is done to compensate the fact that the
iterator always points to the previous item when moving backwards. That does
not work so well if that next item happens to be either deleted or newer than
the current snapshot. In that case FindNextUserEntry() will find the same item
where the saved_key_ used to point, eg, the same entry as before.
The attached patch uses iter_->Seek() to position the iterator to saved_key_.
Original comment by ti...@litl.com
on 26 Aug 2013 at 9:06
Attachments:
I suggest using the fix I provided on the mailing list on Friday. It seems
that email replies don't show up here.
The route we chose was to conditionally call "SaveKey". I think this may be
more efficient than calling "Seek", except in cases where the iterator needs to
skip lots of data. Our patch is here:
https://github.com/rescrv/HyperLevelDB/commit/e19fc0c34690be79dbf9f6102e9987c561
25905f
Original comment by res...@gmail.com
on 26 Aug 2013 at 12:37
Hi Johann and Robert,
Thanks for the test and fix.
Would both of you mind e-signing the contributor license agreement so I can
incorporate your fix into leveldb? The agreement is pretty simple:
http://code.google.com/legal/individual-cla-v1.0.html
If you sign it, just drop a note to sanjay@google.com (or reply on this issue)
saying you have done so and I can take it from there. If you can't we will
figure out some alternate way to fix the problem.
Thanks.
Original comment by san...@google.com
on 26 Aug 2013 at 4:15
Fixed in 1.14.0
Original comment by dgrogan@chromium.org
on 19 Sep 2013 at 8:55
Original issue reported on code.google.com by
johan.bi...@gmail.com
on 23 Aug 2013 at 9:39Attachments: