box: disallow alter of primary index with dependent secondary#11536
Merged
locker merged 1 commit intotarantool:masterfrom May 30, 2025
Merged
box: disallow alter of primary index with dependent secondary#11536locker merged 1 commit intotarantool:masterfrom
locker merged 1 commit intotarantool:masterfrom
Conversation
dc865dd to
36af048
Compare
locker
reviewed
May 28, 2025
nshy
requested changes
May 28, 2025
test/engine-luatest/gh_10951_memtx_alter_pk_with_dependent_sk_test.lua
Outdated
Show resolved
Hide resolved
test/engine-luatest/gh_10951_memtx_alter_pk_with_dependent_sk_test.lua
Outdated
Show resolved
Hide resolved
773072b to
9af1696
Compare
Contributor
Author
|
Note that I use |
locker
approved these changes
May 28, 2025
nshy
approved these changes
May 29, 2025
Rebuild of several indexes in one statement is broken because we need to maintain consistency of built indexes while building the next ones, and we don't do that. Such rebuilds can happen only when primary index is altered and all non-unique and nullable indexes need to be rebuilt as well. Let's simply forbid such alters. We could forbid any alter of primary index, and the patch would be even a bit simpler, but let's allow to alter primary in a space without dependent secondary indexes - it seems to work fine, and people would use it, at least someone reported this problem, hence, someone actually tried to alter primary. Closes tarantool#10951 NO_DOC=bugfix
maryiaLichko
approved these changes
May 29, 2025
Member
|
Cherry-picked to 3.2, 3.3, 3.4. |
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.
Rebuild of several indexes in one statement is broken because we need to maintain consistency of built indexes while building the next ones, and we don't do that. Such rebuilds can happen only when primary index is altered and all non-unique and nullable indexes need to be rebuilt as well. Let's simply forbid such alters.
We could forbid any alter of primary index, and the patch would be even a bit simpler, but let's allow to alter primary in a space without dependent secondary indexes - it seems to work fine, and people would use it, at least someone reported this problem, hence, someone actually tried to alter primary.
Closes #10951