[backport 3.3] memtx: use index definition's key_def for point hole comparisons#11485
Merged
sergepetrenko merged 8 commits intotarantool:release/3.3from May 14, 2025
Conversation
aa10e9b to
25c65bc
Compare
25c65bc to
72c1a76
Compare
MVCC storages are supposed to be empty by the time MVCC is freed — let's add assertions to check this assumption. Needed for tarantool#10159 Needed for tarantool#11292 NO_CHANGELOG=<refactoring> NO_DOC=<refactoring> NO_TEST=<refactoring> (cherry picked from commit 0a02acb)
We combine the index and tuple hash for point holes in a non-trivial way in more than one place — let's encapsulate the combination logic in a separate function for future changes. Needed for tarantool#10159 Needed for tarantool#11292 NO_CHANGELOG=<refactoring> NO_DOC=<refactoring> NO_TEST=<refactoring> (cherry picked from commit b6cabab)
It is safe to remove an object from its list, even if the list is empty — let's always remove point holes from their rings to simplify the code. We will use this to further separate the point hole storage deletion from the point hole item deletion. Needed for tarantool#10159 Needed for tarantool#11292 NO_CHANGELOG=<refactoring> NO_DOC=<refactoring> NO_TEST=<refactoring> (cherry picked from commit 171412a)
We delete point item separately in more than one place — let's encapsulate this logic in a separate function for further changes. Needed for tarantool#10159 Needed for tarantool#11292 NO_CHANGELOG=<refactoring> NO_DOC=<refactoring> NO_TEST=<refactoring> (cherry picked from commit 674d75e)
Globally unique index identifiers are redundant, since indexes can be uniquely identified by pointers — let's use the pointer to the index for this purpose. Needed for tarantool#10159 Needed for tarantool#11292 NO_CHANGELOG=<refactoring> NO_DOC=<refactoring> NO_TEST=<refactoring> (cherry picked from commit 19ac49a)
Currently, we assume that point hole equivalence classes are defined by their keys' binary (MsgPack) representation, and use `memcmp` for comparison. However, this is not true in the case of numeric key definitions and collations. To fix this, let's use the corresponding index's key definition for comparison. Storing the key length then becomes redundant, so let's drop it. Closes tarantool#10159 Closes tarantool#11292 NO_DOC=<bugfix> (cherry picked from commit b2fc501)
The `space_id` field has become redundant after we started saving the `index` to point holes — let's drop it to simplify the code. Folows-up tarantool#10159 Folows-up tarantool#11292 NO_CHANGELOG=<refactoring> NO_DOC=<refactoring> NO_TEST=<refactoring> (cherry picked from commit f76d3f9)
Folows-up tarantool#10159 Folows-up tarantool#11292 NO_CHANGELOG=<optimization> NO_DOC=<optimization> (cherry picked from commit 76b114e)
72c1a76 to
020fa4f
Compare
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.
(This PR is a backport of #11388 to
release/3.3to a future3.3.3release.)This patchset fixes the incorrect assumption that point hole equivalence classes are defined by
their keys' binary (MsgPack) representation.
Closes #10159
Closes #11292