Skip to content

[backport 3.4] memtx: use index definition's key_def for point hole comparisons#11484

Merged
sergepetrenko merged 8 commits intorelease/3.4from
backport/release/3.4/11388
May 14, 2025
Merged

[backport 3.4] memtx: use index definition's key_def for point hole comparisons#11484
sergepetrenko merged 8 commits intorelease/3.4from
backport/release/3.4/11388

Conversation

@TarantoolBot
Copy link
Collaborator

@TarantoolBot TarantoolBot commented May 10, 2025

(This PR is a backport of #11388 to release/3.4 to a future 3.4.1 release.)


This patchset fixes the incorrect assumption that point hole equivalence classes are defined by
their keys' binary (MsgPack) representation.

Closes #10159
Closes #11292

MVCC storages are supposed to be empty by the time MVCC is freed — let's
add assertions to check this assumption.

Needed for #10159
Needed for #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 #10159
Needed for #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 #10159
Needed for #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 #10159
Needed for #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 #10159
Needed for #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 #10159
Closes #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 #10159
Folows-up #11292

NO_CHANGELOG=<refactoring>
NO_DOC=<refactoring>
NO_TEST=<refactoring>

(cherry picked from commit f76d3f9)
Folows-up #10159
Folows-up #11292

NO_CHANGELOG=<optimization>
NO_DOC=<optimization>

(cherry picked from commit 76b114e)
@TarantoolBot TarantoolBot added the full-ci Enables all tests for a pull request label May 10, 2025
@TarantoolBot TarantoolBot requested a review from a team as a code owner May 10, 2025 13:39
@TarantoolBot TarantoolBot added the full-ci Enables all tests for a pull request label May 10, 2025
@TarantoolBot TarantoolBot changed the title [Backport release/3.4] memtx: use index definition's key_def for point hole comparisons [backport 3.4] memtx: use index definition's key_def for point hole comparisons May 10, 2025
@coveralls
Copy link

Coverage Status

coverage: 87.52% (+0.02%) from 87.5%
when pulling ec8f548 on backport/release/3.4/11388
into ff2e3fb
on release/3.4
.

@sergepetrenko sergepetrenko merged commit 312b258 into release/3.4 May 14, 2025
44 of 63 checks passed
@sergepetrenko sergepetrenko deleted the backport/release/3.4/11388 branch May 14, 2025 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Enables all tests for a pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants