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: Implement CREATE DATABASE in declarative schema changer #117292

Merged

Conversation

Xiang-Gu
Copy link
Contributor

@Xiang-Gu Xiang-Gu commented Jan 3, 2024

This PR implements CREATE DATABASE in declarative schema changer.
It falls back to legacy schema changer if the database is requested to be
multi-region.

Epic: CRDB-25312
Fix: #103324
Inform: #103607
Release note: None

Previously, we used a `map` to store all descriptors we want to create
within one stage, and just iterate over that map to actually call
functions to add them. The iteration ordering is non-deterministic so
it can cause flakes in end-to-end test where we assert a particular
order of desc upsertion. This commit fixes it by ensuring we always
create descs in the ascending order of their ID.

Release note: None
This commit supports CREATE DATABASE in declarative schema changer.
It falls back to legacy schema changer if the database is requested
to be multi-region.

Release note: None
Copy link

blathers-crl bot commented Jan 3, 2024

Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@Xiang-Gu Xiang-Gu marked this pull request as ready for review January 4, 2024 00:24
@Xiang-Gu Xiang-Gu requested review from a team as code owners January 4, 2024 00:24
@Xiang-Gu Xiang-Gu requested review from herkolategan and renatolabs and removed request for a team January 4, 2024 00:24
@Xiang-Gu
Copy link
Contributor Author

Xiang-Gu commented Jan 4, 2024

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Jan 4, 2024

Build succeeded:

@craig craig bot merged commit e4067f1 into cockroachdb:master Jan 4, 2024
7 of 9 checks passed
@Xiang-Gu Xiang-Gu deleted the feature/create-database-declarative branch January 4, 2024 17:00
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.

schemachanger: Support CREATE DATABASE
3 participants