-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
51253: sql: allow drops on tables/sequences that have invalid ownership states r=solongordon a=arulajmani Previously, when dropping a sequence or a table that had an ownership relationship, we would lookup corresponding table descriptors to unlink the relationship. In the case of tables, the owned sequence needed to be dropped as well, so we would lookup the sequence descriptor. If the corresponding descriptor was not found/had already been dropped, it would result in an error -- thereby making it impossible to drop the object. This wasn't an issue, because you don't expect descriptors to be dropped/not found if an ownership relationship still exists. However, this integrity constraint was violated by a couple of sequence ownership bugs. See #51170 for more details. It should be possible to drop tables/sequences that have descriptors in such invalid state. This PR adds support for this by swallowing specific errors that users may find themselves in due to invalid descriptors. It also adds tests to simulate these invalid states users may find themselves in. closes #51170 Release note (bug fix): Previously users who found themselves with descriptors in an invalid state due to the ownership issues linked in that contained them. This is now fixed. Co-authored-by: arulajmani <[email protected]>
- Loading branch information
Showing
4 changed files
with
242 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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