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: validate cluster when using fixtures and provide opt-out #105455

Merged

Conversation

renatolabs
Copy link
Contributor

This commit updates the mixedversion API with two main changes:

  • cluster validation: previously, mixed-version tests would always start from checked-in fixtures. Those fixtures have an implied cluster topology and require the cluster to have 4 cockroach nodes -- if that's not the case, the cluster fails to start up with non-obvious error messages. To make this situation clearer, we now validate that the test is being run with the correct number of nodes.

  • to allow for larger-scale mixed-version tests (more than 4 nodes), we now expose a DisableFixtures option that can be passed to NewTest. With this option, nodes start with an empty store directory, eliminating any restrictions on cluster size.

Epic: CRDB-19321

Release note: None

@renatolabs renatolabs requested a review from a team as a code owner June 23, 2023 19:24
@renatolabs renatolabs requested review from herkolategan and smg260 and removed request for a team June 23, 2023 19:24
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@renatolabs renatolabs force-pushed the rc/mixedversion-cluster-validation branch 2 times, most recently from 4f6a3a8 to c93fced Compare June 28, 2023 20:52
Copy link
Member

@srosenberg srosenberg left a comment

Choose a reason for hiding this comment

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

:lgtm:

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


pkg/cmd/roachtest/roachtestutil/mixedversion/mixedversion.go line 131 at r2 (raw file):

		// We use fixtures more often than not as they are more likely to
		// detect bugs, especially in migrations.
		useFixturesProbability: 0.7,

Are there many other mixed-version tests (besides backup/restore) which support running without fixtures? We might consider adding requireFixtures to TestSpec.


pkg/cmd/roachtest/roachtestutil/mixedversion/mixedversion.go line 276 at r2 (raw file):

// disable the use of fixtures in the test. Necessary if the test
// wants to use a number of cockroach nodes other than 4.
func DisableFixtures(opts *testOptions) {

Nit: maybe NeverUseFixtures?

This commit updates the `mixedversion` API with two main changes:

* cluster validation: previously, mixed-version tests would always
start from checked-in fixtures. Those fixtures have an implied cluster
topology and require the cluster to have 4 cockroach nodes -- if
that's not the case, the cluster fails to start up with non-obvious
error messages. To make this situation clearer, we now validate that
the test is being run with the correct number of nodes.

* to allow for larger-scale mixed-version tests (more than 4 nodes),
we now expose a `DisableFixtures` option that can be passed to
`NewTest`. With this option, nodes start with an empty store
directory, eliminating any restrictions on cluster size.

Epic: CRDB-19321

Release note: None
@renatolabs renatolabs force-pushed the rc/mixedversion-cluster-validation branch from c93fced to 2c3e868 Compare June 29, 2023 20:20
Copy link
Contributor Author

@renatolabs renatolabs left a comment

Choose a reason for hiding this comment

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

Rebased and fixed conflicts.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @herkolategan, @smg260, and @srosenberg)


pkg/cmd/roachtest/roachtestutil/mixedversion/mixedversion.go line 131 at r2 (raw file):

Previously, srosenberg (Stan Rosenberg) wrote…

Are there many other mixed-version tests (besides backup/restore) which support running without fixtures? We might consider adding requireFixtures to TestSpec.

I believe all tests except acceptance/version-upgrade can run without the baked-in fixtures (i.e., that test is the only one that has assertions that only work if the cluster started from those fixtures). Not sure it would make sense to add something to TestSpec since previous-version fixtures only make sense in the context of mixed-version tests.


pkg/cmd/roachtest/roachtestutil/mixedversion/mixedversion.go line 276 at r2 (raw file):

Previously, srosenberg (Stan Rosenberg) wrote…

Nit: maybe NeverUseFixtures?

Good point, renamed.

@renatolabs
Copy link
Contributor Author

TFTR!

bors r=srosenberg

@craig
Copy link
Contributor

craig bot commented Jul 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.

3 participants