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

ccl: regionless restores with rbr table(s) fail fast, add version gate #111443

Merged
merged 2 commits into from
Oct 4, 2023

Conversation

annrpom
Copy link
Contributor

@annrpom annrpom commented Sep 28, 2023

ccl: regionless restores with regional by row table(s) fail fast

Previously, backing up an MR cluster/db/table that had a regional by row table did not work out-of-the-box (users could not write to said table without performing some operations to ensure hidden column added by regional by row enablement, crdb_region, and zone config behaved according to the target RESTORE cluster. This was inadequate because we allowed users to perform a RESTORE where some tables were not "available" right away. This patch addresses this by making sure we "fail fast" if users do decide to attempt a RESTORE where the BACKUP object has a regional by row table.

Also: tests. A small amount of tests were fixed to separate the behavior of restoring a database vs a table (just dropping a table after we performed a db restore to test table restore is not a properly isolated test of behavior). Mixed-version tests were added as well.

Epic: CRDB-27601
Informs: #111348

Release note (sql change): Users are not able to perform a remove_regions RESTORE if the object being restored contains a regional by row table.


ccl: add 23.2 version gate to regionless restore

This patch adds a >= 23.2 version gate to the remove_regions
RESTORE option, in addition to a mixed-version test to ensure
that RESTORE fails fast if it is on a cluster version < 23.2.

Epic: CRDB-27601
Fixes: #111348

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@annrpom annrpom requested a review from msbutler September 28, 2023 20:09
Copy link
Collaborator

@msbutler msbutler left a comment

Choose a reason for hiding this comment

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

Thanks for doing this!

@annrpom annrpom marked this pull request as ready for review September 28, 2023 21:20
@annrpom annrpom requested a review from a team as a code owner September 28, 2023 21:20
@annrpom annrpom marked this pull request as draft October 2, 2023 14:31
@annrpom annrpom force-pushed the regionless-restore-option branch 3 times, most recently from 3a4b509 to 64cb124 Compare October 2, 2023 17:39
@annrpom annrpom marked this pull request as ready for review October 2, 2023 18:10
@annrpom annrpom force-pushed the regionless-restore-option branch from 64cb124 to 4c83ea6 Compare October 2, 2023 18:18
@annrpom annrpom requested review from msbutler and rafiss October 2, 2023 18:31
@annrpom annrpom force-pushed the regionless-restore-option branch 3 times, most recently from 030c63a to 42d583b Compare October 2, 2023 19:01
@annrpom annrpom changed the title ccl: regionless restores with regional by row table(s) fails fast ccl: regionless restores with regional by row table(s) fails fast, add version gate Oct 2, 2023
@annrpom annrpom changed the title ccl: regionless restores with regional by row table(s) fails fast, add version gate ccl: regionless restores with rbr table(s) fails fast, add version gate Oct 2, 2023
@annrpom annrpom changed the title ccl: regionless restores with rbr table(s) fails fast, add version gate ccl: regionless restores with rbr table(s) fail fast, add version gate Oct 2, 2023
Copy link
Collaborator

@msbutler msbutler left a comment

Choose a reason for hiding this comment

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

LGTM modulo a review from foundations on cross version descriptor checks as we discussed.

@annrpom annrpom force-pushed the regionless-restore-option branch from 3f017fa to ad52b7d Compare October 2, 2023 20:30
@annrpom annrpom requested a review from a team October 3, 2023 14:04
Previously, backing up an MR cluster/db/table that had a regional by
row table did not work out-of-the-box (users could not write to said
table without performing some operations to ensure hidden column added
by regional by row enablement, `crdb_region`, and zone config behaved
according to the target RESTORE cluster. This was inadequate because
we allowed users to perform a RESTORE where some tables were not
"available" right away. This patch addresses this by making sure we
"fail fast" if users do decide to attempt a RESTORE where the BACKUP
object has a regional by row table.

Also: tests. A small amount of tests were fixed to separate the behavior
of restoring a database vs a table (just dropping a table after we
performed a db restore to test table restore is not a properly
isolated test of behavior).

Epic: none
Informs: cockroachdb#111348
Part of: https://cockroachlabs.atlassian.net/browse/CRDB-29129

Release note (sql change): Users are not able to perform a
`remove_regions` RESTORE if the object being restored contains
a regional by row table.
@annrpom annrpom force-pushed the regionless-restore-option branch from ad52b7d to 526f500 Compare October 3, 2023 19:44
@annrpom annrpom requested a review from a team as a code owner October 3, 2023 19:44
@annrpom annrpom requested review from herkolategan and renatolabs and removed request for a team October 3, 2023 19:44
@annrpom annrpom force-pushed the regionless-restore-option branch from 526f500 to 059f55f Compare October 4, 2023 14:43
Copy link
Collaborator

@fqazi fqazi left a comment

Choose a reason for hiding this comment

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

:LGTM: just some minor nits on the commit messages only

The main part of stripping localities should be safe to backport since none of the fields were are stripping are new here.

Reviewed 4 of 5 files at r1, 3 of 3 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @annrpom, @herkolategan, @rafiss, and @renatolabs)


-- commits line 23 at r2:
This feature hasn't been released yet, so a release note isn't warranted.


-- commits line 32 at r2:
23.2


-- commits line 38 at r2:
Again similar to above

Copy link
Contributor Author

@annrpom annrpom left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @fqazi, @herkolategan, @rafiss, and @renatolabs)


-- commits line 23 at r2:

Previously, fqazi (Faizan Qazi) wrote…

This feature hasn't been released yet, so a release note isn't warranted.

This one is more for docs - a merged PR specified the behavior of this restore option if the object being restored does have a rbr table & this is just here to document that such behavior has changed


-- commits line 32 at r2:

Previously, fqazi (Faizan Qazi) wrote…

23.2

ah rip - thank you


-- commits line 38 at r2:

Previously, fqazi (Faizan Qazi) wrote…

Again similar to above

done!

This patch adds a >= 23.2 version gate to the `remove_regions`
RESTORE option, in addition to a mixed-version test to ensure
that RESTORE fails fast if it is on a cluster version < 23.2.

Epic: none
Fixes: cockroachdb#111348
Part of: https://cockroachlabs.atlassian.net/browse/CRDB-29129

Release note: None
@annrpom annrpom force-pushed the regionless-restore-option branch from 059f55f to 831d60b Compare October 4, 2023 15:22
@annrpom
Copy link
Contributor Author

annrpom commented Oct 4, 2023

TFTR! ('-')7

bors r=msbutler

@craig
Copy link
Contributor

craig bot commented Oct 4, 2023

Build succeeded:

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.

sql-foundations: tweak regionless restore syntax and semantics
4 participants