-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
118722: sql: don't parallelize *any* FK and unique checks containing locking r=yuzefovich a=michae2 **sql, execbuilder: move plan flags from planTop to planComponents** Execbuild produces a `sql.planComponents` containing the main query plan, plus plans for any subqueries, checks, and cascades. In the normal SQL code path (`sql.(*optPlanningCtx).runExecBuilder`) we copy this planComponents into a `sql.planTop`, which then is decorated with extra information gathered from the Builder. However, there are other users of execbuild that only work with the planComponents, and don't have a planTop. In the next commit, one such user, `PlanAndRunCascadesAndChecks`, needs to see some of the plan flags set when building FK check plans, but doesn't have access to the Builder which gathered those plans. To solve this, this commit moves plan flags from the planTop to planComponents, and then refactors the execbuilder and exec factory to set some of these flags when creating the planComponents. Informs: #118720 Epic: None Release note: None --- **sql: don't parallelize *any* FK and unique checks containing locking** In #111896 we disallowed parallel execution of FK and unique checks that contain locking, to avoid usage of LeafTxns. But #111896 only considered checks built during planning of the main query, and overlooked checks built during planning of FK cascades. This commit also considers checks built during planning of FK cascades. Fixes: #118720 Epic: None Release note (bug fix): This commit fixes an internal error with message like: "LeafTxn ... incompatible with locking request" that occurs when performing an update under read committed isolation which cascades to a table with multiple other foreign keys. --- **sql: rename \*ContainsNonDefaultKeyLocking to \*ContainsLocking** "Default" locking here simply means no locking. I find this convention of saying "non-default key locking" a little verbose and confusing. Epic: None Release note: None Co-authored-by: Michael Erickson <michae2@cockroachlabs.com>
- Loading branch information
Showing
18 changed files
with
198 additions
and
111 deletions.
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
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
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
Oops, something went wrong.