memtx: track index:random reads and clarify result#7683
Merged
alyapunov merged 1 commit intotarantool:masterfrom Sep 23, 2022
Merged
Conversation
9edb664 to
28366e3
Compare
drewdzzz
requested changes
Sep 20, 2022
210c7ad to
3c428ee
Compare
3c428ee to
5575144
Compare
alyapunov
suggested changes
Sep 22, 2022
src/box/memtx_hash.cc
Outdated
| } | ||
|
|
||
| do { | ||
| uint32_t k = light_index_random(hash_table, rnd); |
Contributor
There was a problem hiding this comment.
You must increment rnd each time, otherwise you'll get the same k each time.
Member
Author
There was a problem hiding this comment.
Yeah, missed that, my test was broken and it didn't catch this out, sorry.
Thanks for pointing this out!
drewdzzz
requested changes
Sep 22, 2022
drewdzzz
requested changes
Sep 22, 2022
test/box-luatest/gh_7670_memtx_tx_manager_idx_rand_inconsistency_test.lua
Outdated
Show resolved
Hide resolved
TREE (HASH) index implements `random` method: if the space is empty from
the transaction's perspective, which means we have to return nothing, add
gap tracking of whole range (full scan
tracking), since this result is equivalent to `index:select{}`, otherwise
repeatedly call `random` and clarify result, until we get a non-empty one.
We do not care about performance here, since all operations in context of
transaction management currently have O(number of dirty tuples)
complexity.
Closes tarantool#7670
NO_DOC=bugfix
5575144 to
ca79e14
Compare
drewdzzz
approved these changes
Sep 23, 2022
alyapunov
approved these changes
Sep 23, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TREE (HASH) index implements
randommethod: ifrandomreturns nothing, i.e. the space is empty, add gap tracking of whole range (full scan tracking), since this result is equivalent toindex:select{}, otherwise clarify result.Closes #7670