memtx: use index definition's key_def for point hole comparisons#11388
Conversation
533e59a to
159a713
Compare
60f3c7e to
fd37217
Compare
mkostoevr
left a comment
There was a problem hiding this comment.
Nice to see the MVCC subsystem getting cleaner.
drewdzzz
left a comment
There was a problem hiding this comment.
Thanks for the patch!
We've fixed this old minor problem finally 😄
Also, it's nice to see that MVCC code becomes a little more tidy.
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>
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>
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>
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>
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>
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>
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>
fd37217 to
70a5fc4
Compare
|
@mkostoevr @drewdzzz I added a small follow-up patch that reuses the |
Please, move |
6da1e5d to
254b56a
Compare
Folows-up tarantool#10159 Folows-up tarantool#11292 NO_CHANGELOG=<optimization> NO_DOC=<optimization>
254b56a to
298599e
Compare
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin release/2.11
git worktree add -d .worktree/backport/release/2.11/11388 origin/release/2.11
cd .worktree/backport/release/2.11/11388
git switch --create backport/release/2.11/11388
git cherry-pick -x 0a02acb72c9dd4b6eb80cea881f346b71dad2323 b6cababf1883b05e77e894212f9234c965007cd9 171412abf7fbc93abe2bfde141bf21a421948c1f 674d75e4aa82d00b114404bdea9055182fcc0deb 19ac49a76fdb9b4309539817689fc401d35034e4 b2fc50179c6ca09288e116a5760b5791a38e026a f76d3f901ab177b9778aac2070ca0600bfadfec4 76b114e9ad9ea04868cc05235dde7075cc669a54 |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin release/3.2
git worktree add -d .worktree/backport/release/3.2/11388 origin/release/3.2
cd .worktree/backport/release/3.2/11388
git switch --create backport/release/3.2/11388
git cherry-pick -x 0a02acb72c9dd4b6eb80cea881f346b71dad2323 b6cababf1883b05e77e894212f9234c965007cd9 171412abf7fbc93abe2bfde141bf21a421948c1f 674d75e4aa82d00b114404bdea9055182fcc0deb 19ac49a76fdb9b4309539817689fc401d35034e4 b2fc50179c6ca09288e116a5760b5791a38e026a f76d3f901ab177b9778aac2070ca0600bfadfec4 76b114e9ad9ea04868cc05235dde7075cc669a54 |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin release/3.3
git worktree add -d .worktree/backport/release/3.3/11388 origin/release/3.3
cd .worktree/backport/release/3.3/11388
git switch --create backport/release/3.3/11388
git cherry-pick -x 0a02acb72c9dd4b6eb80cea881f346b71dad2323 b6cababf1883b05e77e894212f9234c965007cd9 171412abf7fbc93abe2bfde141bf21a421948c1f 674d75e4aa82d00b114404bdea9055182fcc0deb 19ac49a76fdb9b4309539817689fc401d35034e4 b2fc50179c6ca09288e116a5760b5791a38e026a f76d3f901ab177b9778aac2070ca0600bfadfec4 76b114e9ad9ea04868cc05235dde7075cc669a54 |
|
@CuriousGeorgiy, please, prepare the backports to all the relevant branches. |
|
/backport 3.4 |
|
Successfully created backport PR for |
Backport summary
|
This patchset fixes the incorrect assumption that point hole equivalence classes are defined by
their keys' binary (MsgPack) representation.
Closes #10159
Closes #11292