-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql: fix bug dropping shard column which is not the last column #55766
sql: fix bug dropping shard column which is not the last column #55766
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r1.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner)
pkg/sql/logictest/testdata/logic_test/hash_sharded_index, line 572 at r1 (raw file):
# This is a regression test for a bug whereby the dropping of a hash column # could result in an invalid descriptor and would fail. The underlying bug was # due to a column descriptor pointer to a slice being clobbered.
Would you mind referring to this PR now that it's been opened?
1896902
to
9208988
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @lucy-zhang)
pkg/sql/logictest/testdata/logic_test/hash_sharded_index, line 572 at r1 (raw file):
Previously, lucy-zhang (Lucy Zhang) wrote…
Would you mind referring to this PR now that it's been opened?
Done.
The bug was due to the fact that we were passing around the column descriptor as a pointer to an entry in the `Columns` slice. When we overwrote that slice we'd clobber the descriptor and, in the process, muck up the mutation which pointed to it. We should look for more bugs like this. Prior to this change the added logic test would fail with the below error: ``` testdata/logic_test/hash_sharded_index:589: expected success, but found (XXUUU) family "fam_1_k_j" contains unknown column "4" ``` Release note (bug fix): Fixed a bug which would prevent the dropping of hash sharded indexes if they were added prior to other columns.
9208988
to
cb548f9
Compare
bors r=lucy-zhang |
Build succeeded: |
The bug was due to the fact that we were passing around the column descriptor
as a pointer to an entry in the
Columns
slice. When we overwrote that slicewe'd clobber the descriptor and, in the process, muck up the mutation which
pointed to it. We should look for more bugs like this. Prior to this change
the added logic test would fail with the below error:
Release note (bug fix): Fixed a bug which would prevent the dropping of hash
sharded indexes if they were added prior to other columns.