-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DeleteRange causes put then iterate to fail on WBWI #5260
Comments
What you're doing looks right. We should've returned |
@ajkr Thank you for your quick response :-) We would need At the moment for our transactions, each has a WBWI and Snapshot, we perform all read operations using either We developed our transactions before RocksDB provided any built-in transaction support. We could migrate to RocksDB's I wonder if it would be possible to implement How does something like that sound? |
@adamretter, right, the problem looks similar to pessimistic transactions, where this also isn't supported. Perhaps it's harder in transactions due to conflict prevention / checking. One question I had about your proposal is can it handle reverse iteration? In that case we wouldn't see the range tombstone until we've already passed over keys potentially deleted by it. I wouldn't have any problem with indexing the range tombstones in a completely separate data structure (could be just a vector to start, or a map sorted on begin key) and checking all of them during a get or scan. The case of having many range tombstones in a single |
@ajkr Interesting. I hadn't considered reverse iteration... probably because I don't personally use it ;-). Okay... is this something you are planning to work on, or should I try and implement something? |
My 2 cents: the current |
@adamretter I'm not available to do it right now but will keep thinking about it. Feel free to take it up if you're interested! I'm also curious to hear @siying's thoughts on this and the potential redesign. In the meantime though we should probably make |
@siying What do you think of the above mentioned idea to use a regular iterator that treats the write batch as the newest level in the LSM, rather than |
Summary: As discovered in facebook#5260 and facebook#5392, reads on the indexed batch do not account for range tombstones. So, return `Status::NotSupported` from `WriteBatchWithIndex::DeleteRange` until we properly support it. Test Plan: added unit test
Summary: As discovered in #5260 and #5392, reads on the indexed batch do not account for range tombstones. So, return `Status::NotSupported` from `WriteBatchWithIndex::DeleteRange` until we properly support it. Pull Request resolved: #5393 Test Plan: added unit test Differential Revision: D19912360 Pulled By: ajkr fbshipit-source-id: 0bbfc978ea015d64516ca708fce2429abba524cb
) Summary: As discovered in facebook#5260 and facebook#5392, reads on the indexed batch do not account for range tombstones. So, return `Status::NotSupported` from `WriteBatchWithIndex::DeleteRange` until we properly support it. Pull Request resolved: facebook#5393 Test Plan: added unit test Differential Revision: D19912360 Pulled By: ajkr fbshipit-source-id: 0bbfc978ea015d64516ca708fce2429abba524cb
) Summary: As discovered in facebook#5260 and facebook#5392, reads on the indexed batch do not account for range tombstones. So, return `Status::NotSupported` from `WriteBatchWithIndex::DeleteRange` until we properly support it. Pull Request resolved: facebook#5393 Test Plan: added unit test Differential Revision: D19912360 Pulled By: ajkr fbshipit-source-id: 0bbfc978ea015d64516ca708fce2429abba524cb
Putting the following 3 key/value pairs into a
WBWI
(WriteBatchWithIndex
), i.e.:With respect to
batch.NewIteratorWithBase
, iterating returns just those 3 key/value pairs correctly. So far so good!However, if I call
batch.DeleteRange("a", "b")
before putting the values into the WBWI, then subsequently iterating the WBWI incorrectly returns 4 key/value pairs and not 3, i.e. the following code appears to cause false data to appear:The first key/value pair returned by
NewIteratorWithBase
seems to be an error as its key has the valuea
, yet we never stored any such key!I have created a reproducible test case showing the problem that fits into
utilities/write_batch_with_index/write_batch_with_index_test.cc
:Commenting out the
batch.DeleteRange(&cf1, "a", "b");
above causes the test to pass, but I don't think it should actually have an impact on the iterator produced fromWriteBatchWithIndex::NewIteratorWithBase
.Can someone please confirm that this is indeed an issue... and that I am not doing something blindly stupid ;-)
The text was updated successfully, but these errors were encountered: