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

roachtest: add schemachange/database-version-upgrade #54489

Merged
merged 1 commit into from
Sep 29, 2020

Conversation

thoszhang
Copy link
Contributor

@thoszhang thoszhang commented Sep 17, 2020

This PR adds a new mixed-version roachtest, which tests 2 loosely
related things:

  1. Correctness of database schema changes during the 20.1/20.2 mixed-
    version state, in which 20.2 nodes still use the deprecated database
    cache and non-lease-based schema change implementation.
  2. Ability to use ALTER DATABASE ... CONVERT TO SCHEMA WITH PARENT on
    databases created in 20.1.

To these ends, the test creates several databases, runs schema changes
on each one at different states in the rolling upgrade process, and runs
the reparenting statement on all of them post-finalization.

Closes #53568.

Release note: None

@thoszhang thoszhang requested a review from ajwerner September 17, 2020 04:23
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@thoszhang
Copy link
Contributor Author

I was originally trying to jam this into acceptance/mixed-version but decided against it, both because this needs a true mixed-binary-version state and because I was originally worried about interactions with the introspection in the schema change workload (though I then realized this isn't hard to avoid since the workload uses prefixes for its own names). So now this is a separate roachtest. Maybe the reparented databases could stand to have more stuff in them.

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

Maybe the reparented databases could stand to have more stuff in them.

I agree but am not going to block this good stuff over that.

:lgtm:

Reviewed 1 of 2 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @ajwerner)


pkg/cmd/roachtest/schema_change_database_version_upgrade.go, line 1 at r1 (raw file):

package main

lint stuffs


pkg/cmd/roachtest/schema_change_database_version_upgrade.go, line 204 at r1 (raw file):

		createParentDatabaseStep,
		reparentDatabaseStep("db_0"),
		reparentDatabaseStep("db_1"),

If I had one nit it'd be that it might be nice to interact with the tables after they've been reparented. It's just a suggestion though. I'd take this as-is or with a TODO.

@thoszhang thoszhang force-pushed the databases-version-upgrade branch from 0ae4fb7 to 81bd818 Compare September 29, 2020 05:47
This PR adds a new mixed-version roachtest, which tests 2 loosely
related things:

1. Correctness of database schema changes during the 20.1/20.2 mixed-
   version state, in which 20.2 nodes still use the deprecated database
   cache and non-lease-based schema change implementation.
2. Ability to use ALTER DATABASE ... CONVERT TO SCHEMA WITH PARENT on
   databases created in 20.1.

To these ends, the test creates several databases, runs schema changes
on each one at different states in the rolling upgrade process, and runs
the reparenting statement on all of them post-finalization.

Release note: None
@thoszhang thoszhang force-pushed the databases-version-upgrade branch from 81bd818 to 8b04524 Compare September 29, 2020 05:47
Copy link
Contributor Author

@thoszhang thoszhang 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! 0 of 0 LGTMs obtained (and 1 stale)


pkg/cmd/roachtest/schema_change_database_version_upgrade.go, line 1 at r1 (raw file):

Previously, ajwerner wrote…

lint stuffs

Done.


pkg/cmd/roachtest/schema_change_database_version_upgrade.go, line 204 at r1 (raw file):

Previously, ajwerner wrote…

If I had one nit it'd be that it might be nice to interact with the tables after they've been reparented. It's just a suggestion though. I'd take this as-is or with a TODO.

I added some schema changes at the end.

@thoszhang
Copy link
Contributor Author

TFTR

bors r+

@craig
Copy link
Contributor

craig bot commented Sep 29, 2020

Build succeeded:

@craig craig bot merged commit 1f8686f into cockroachdb:master Sep 29, 2020
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: create automated test for database to user-defined schema migration between 20.1 and 20.2
3 participants