memtx secondary index uniqueness violation#7767
Merged
alyapunov merged 1 commit intotarantool:masterfrom Nov 9, 2022
Merged
Conversation
c9bc623 to
ceda851
Compare
drewdzzz
approved these changes
Oct 12, 2022
Contributor
drewdzzz
left a comment
There was a problem hiding this comment.
there can only be story chains in the primary index
Story chains are present in every index. Please elaborate.
If we find a newer story in the secondary index, the statement of which deletes a story added in the same transaction, there can be two cases: if the secondary index is not unique, then it is conflicted by primary index (since it's `cmp_def` is extended with the primary index's `key_def`, every history chain in the secondary index has a corresponding chain in the primary index). Otherwise, the prepared story must also conflict the newer one. Summarizing the above: remove the unnecessary check. Closes tarantool#7761 NO_DOC=bugfix
ceda851 to
24ba249
Compare
Member
Author
I had a wrong picture in my head: I thought there couldn't be any history chains in a secondary non-unique index (since there are no collisions), but actually every story chain in there has a corresponding story chain in the primary index (since a secondary non-unique index is basically the primary index extended by the parts of the secondary index). Reworded the commit message accordingly. |
alyapunov
approved these changes
Nov 8, 2022
Contributor
|
Cherry-picked to 2.10. |
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.
memtx: fix conflict handling of stories in secondary indexes
If we find a newer story in the secondary index, the statement of which
deletes a story added in the same transaction, there can be two cases: if
the secondary index is not unique, this is impossible (since it's
cmp_defis extended with the primary index's
key_defand there can only be storychains in the primary index). Otherwise, the prepared story conflicts the
newer one: remove the incorrect check.
Closes #7761