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: add checkNoRegionChangeUnderway checks #136320

Open
annrpom opened this issue Nov 27, 2024 · 1 comment
Open

schemachanger: add checkNoRegionChangeUnderway checks #136320

annrpom opened this issue Nov 27, 2024 · 1 comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@annrpom
Copy link
Contributor

annrpom commented Nov 27, 2024

In TestRegionChangeRacingRegionalByRowChange, we ensure that firing off an ADD/DROP REGION whilst an index-related change on an RBR table is happening (and vice versa) fails properly.

In the declarative schema changer, this means we need to ensure that no regions on the database are being modified before we can proceed with the schema change -- like in drop index

if tableDesc.IsLocalityRegionalByRow() {
if err := p.checkNoRegionChangeUnderway(
ctx,
tableDesc.GetParentID(),
"DROP INDEX on a REGIONAL BY ROW table",
); err != nil {
return err
}
}

In other words, this tracks the implementation of checkNoRegionChangeUnderway in the DSC.

Jira issue: CRDB-44972

@annrpom annrpom added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) labels Nov 27, 2024
@annrpom
Copy link
Contributor Author

annrpom commented Nov 27, 2024

This check is needed for the following schema changes on an RBR table:

  • DROP INDEX
  • ADD COLUMN
  • ALTER PRIMARY KEY
  • ADD UNIQUE CONSTRAINT
  • CREATE INDEX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

No branches or pull requests

1 participant