Skip to content
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

schemachanger: better concurrency testing #107223

Closed
postamar opened this issue Jul 19, 2023 · 0 comments · Fixed by #108451
Closed

schemachanger: better concurrency testing #107223

postamar opened this issue Jul 19, 2023 · 0 comments · Fixed by #108451
Assignees
Labels
A-schema-changes A-testing Testing tools and infrastructure C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) db-cy-23 quality-friday A good issue to work on on Quality Friday T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@postamar
Copy link
Contributor

postamar commented Jul 19, 2023

When interpreting DDL statements, the declarative schema changer checks that there are no concurrent schema changes on the affected descriptors. This effectively acquires an exclusive lock on those descriptors.

We've had bugs like #106487 for which it has been difficult to validate the fix other than by running a workload, which is unfortunate. We should instead have an integration test in the form of a go test, in which a bunch of various schema changes fire up concurrently on the same limited set of descriptors.

For example:

  1. for each table, one thread in which we sequentially rename a table by cycling through a bunch of names,
  2. for each table, one thread in which we sequentially create and drop secondary indexes,
  3. for each schema and for each database, cycle through a bunch of names
  4. etc.

The fully qualified names of the tables can be retrieved in each transaction and fmt.Sprint-ed into the DDL statement by looking up the descriptors by ID because the IDs don't change.

This is just a general idea, we haven't implemented RENAME TO statements in the declarative schema changer as of yet.

Jira issue: CRDB-29951

@postamar postamar added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-schema-changes labels Jul 19, 2023
@rafiss rafiss added the T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) label Jul 20, 2023
@rafiss rafiss added db-cy-23 A-testing Testing tools and infrastructure labels Jul 20, 2023
@rafiss rafiss added the quality-friday A good issue to work on on Quality Friday label Aug 1, 2023
@craig craig bot closed this as completed in #108451 Aug 10, 2023
@craig craig bot closed this as completed in f194f92 Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-schema-changes A-testing Testing tools and infrastructure C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) db-cy-23 quality-friday A good issue to work on on Quality Friday T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants