-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
restore: fix full cluster restore after public schema migration #71479
Comments
Hi @RichardJCai, I've guessed the C-ategory of your issue and suitably labeled it. Please re-label if inaccurate. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
Should I put this under @cockroachdb/bulk-io or @cockroachdb/sql-experience since I'll probably be implementing this? |
I think it needs to start with on the SQL team. cc @adityamaru |
Sorry I couldn't join the meeting so just catching up. My first reaction was ugh more static IDs 😄 but I guess there is more context here. Dropping the databases before a cluster restore does simplify stuff a lot. I'll catch up on the notes! |
@adityamaru heh, sorry, we didn't keep detailed notes, but essentially plan is to 1) first make restoring into a cluster with realized Doing 1) requires a) materializing new |
As of today (21.2) IDs 52 and onwards are used by objects created by the user.
Once the public schema migration has been completed, new clusters created on CockroachDB versions >=22.1 will use IDs 52, 53 an in order to create two new public schemas for the default created dbs (defaultdb, postgres).
(defaultdb 50, defaultdb public schema 51, postgres, 52, postgres public schema 53)
This creates an issue with full cluster restore as we currently don't support re-keying.
For example, if we backed up a cluster in 21.2 where the user simply created one table
t
and inserted some rows,t
would use ID 52. Restoring this table into a cluster where the public schema migration has been completed will be an issue since 52 will be used bypostgres
database.The solution to this would be to drop both
defaultdb
andpostgres
perform the restore where we are guaranteed those IDs are not being used by the dbs, and recreate the databases with their public schemas afterwards.This is similar to how we create the temporary system database for restore above the ID space (above the maximum id being restored).
cc @dt @ajwerner
Epic CRDB-1521
The text was updated successfully, but these errors were encountered: