Skip to content

sql: fix bug in ALTER INDEX ... PARTITION BY#79561

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
ajwerner:ajwerner/properly-resolve-table-descriptor-when-looking-for-index
Apr 7, 2022
Merged

sql: fix bug in ALTER INDEX ... PARTITION BY#79561
craig[bot] merged 1 commit intocockroachdb:masterfrom
ajwerner:ajwerner/properly-resolve-table-descriptor-when-looking-for-index

Conversation

@ajwerner
Copy link
Copy Markdown
Contributor

@ajwerner ajwerner commented Apr 7, 2022

There was a subtle bug here whereby we'd increment the version an
extra time when running ALTER INDEX ... PARTITION BY in the same
transaction as a previous DDL to the same table. It's not exactly
clear what the implications here would be. They are subtle.

Release note: None

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

There was a subtle bug here whereby we'd increment the version an
extra time when running ALTER INDEX ... PARTITION BY in the same
transaction as a previous DDL to the same table. It's not exactly
clear what the implications here would be. They are subtle.

Release note: None
@ajwerner ajwerner force-pushed the ajwerner/properly-resolve-table-descriptor-when-looking-for-index branch from ee64220 to 9351707 Compare April 7, 2022 04:58
@ajwerner ajwerner requested a review from a team April 7, 2022 04:58
@ajwerner ajwerner requested a review from a team as a code owner April 7, 2022 04:58
@ajwerner
Copy link
Copy Markdown
Contributor Author

ajwerner commented Apr 7, 2022

TFTR!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Apr 7, 2022

This PR was included in a batch that was canceled, it will be automatically retried

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Apr 7, 2022

Build succeeded:

@craig craig bot merged commit b038da1 into cockroachdb:master Apr 7, 2022
craig bot pushed a commit that referenced this pull request Apr 8, 2022
79580: sql/catalog/descs: enforce invariant that OriginalVersion does not ch… r=ajwerner a=ajwerner

…ange

It's a bug any time we increment a version more than once in the context
of a single descriptor collection. Let's enforce it. This would have prevented bugs
like the one fixed in #79561.

Release note: None

Co-authored-by: Andrew Werner <awerner32@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants