Skip to content

roachtest: rewrite multitenant-upgrade to use the mixedversion framework#131847

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
renatolabs:rc/roachtest-mixedversion-multitenant-upgrade
Oct 4, 2024
Merged

roachtest: rewrite multitenant-upgrade to use the mixedversion framework#131847
craig[bot] merged 1 commit intocockroachdb:masterfrom
renatolabs:rc/roachtest-mixedversion-multitenant-upgrade

Conversation

@renatolabs
Copy link
Copy Markdown

This commit rewrites the multitenant-upgrade roachtest to use the mixedversion framework. Previously, this test would create a fixed set of tenants and run basic queries on them.

With this change, a lot of aspects of the test are randomized: the number of tenants created, the amount of SQL server processes for each, the timing of tenant creation. We also run a tpcc workload on the tenants instead of the previous basic sanity checks.

Fixes: #117673

Release note: None

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

This commit rewrites the `multitenant-upgrade` roachtest to use the
`mixedversion` framework. Previously, this test would create a fixed
set of tenants and run basic queries on them.

With this change, a lot of aspects of the test are randomized: the
number of tenants created, the amount of SQL server processes for
each, the timing of tenant creation. We also run a `tpcc` workload on
the tenants instead of the previous basic sanity checks.

Fixes: cockroachdb#117673

Release note: None
@renatolabs renatolabs force-pushed the rc/roachtest-mixedversion-multitenant-upgrade branch from 1c3e509 to e5dcb49 Compare October 3, 2024 19:54
@renatolabs renatolabs marked this pull request as ready for review October 4, 2024 14:18
@renatolabs renatolabs requested a review from a team as a code owner October 4, 2024 14:19
@renatolabs renatolabs requested review from DarrylWong and srosenberg and removed request for a team October 4, 2024 14:19
@renatolabs
Copy link
Copy Markdown
Author

Test passed 10 times on this branch (1 SSH flake).

}
type createTenantOpt func(*createTenantOptions)

func createTenantNodeInternal(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good riddance!

Copy link
Copy Markdown
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.

Nice!

@renatolabs
Copy link
Copy Markdown
Author

@cockroachdb/disaster-recovery FYI, as owners of this test. It seems pretty stable, but letting you know in case you see a weird failure in the coming days.

TFTR!

bors r=srosenberg

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Oct 4, 2024

@craig craig bot merged commit e4e1c31 into cockroachdb:master Oct 4, 2024
@renatolabs renatolabs deleted the rc/roachtest-mixedversion-multitenant-upgrade branch October 4, 2024 19:55
rimadeodhar added a commit to rimadeodhar/cockroach that referenced this pull request Jan 13, 2025
The multitenant upgrade test enforces different test
scenarios while upgrading tenants in a mixed version state.
The test enforces the following cases:
1. Start storage cluster with binary version: x, cluster version: x
2. Create some tenants with binary version: x and ensure
   they can connect to the cluster and run a workload.
3. Using the mixed version test framework, upgrade the storage cluster
   with binary version: x+1, cluster version: x. In this mixed version
   state, create remaining tenants with binary version: x and run a workload.
4. Finalize the storage cluster. At this point, the storage cluster
   has binary version: x+1 and cluster version: x+1
5. Upgrade tenants with binary version: x+1 and confirm tenants
   can connect to the storage cluster and run a workload.

In cockroachdb#131847, the
test was rewritten using the new mixed version test framework.
However, this change exposed this test to a scenario
that can cause this test to fail at step 3 above. The MVT framework
also runs the mixed version test (i.e. with the tenant
at the older binary version) when the cluster is in the
finalizing stage. This scenario is run with a prefixed
probability. However, if we attempt to start the tenants
with the previous version (i.e. the version the cluster
is being upgraded from) when the cluster is being finalized,
the tenants rightfully fail to connect which the test
incorrectly interprets as a failure. As a result, we would see this
test fail occassionally since the test was updated to use the new MVT.
This PR modifies the test to ensure that in the finalizing state,
we start the tenants with the right version.

Epic: none
Fixes: cockroachdb#136447
Release note: None
craig bot pushed a commit that referenced this pull request Jan 13, 2025
138233: roachtest: Deflake multitenant upgrade test r=rimadeodhar a=rimadeodhar

The multitenant upgrade test enforces different test scenarios while upgrading tenants in a mixed version state. The test enforces the following cases:
1. Start storage cluster with binary version: x, cluster version: x
2. Create some tenants with binary version: x and ensure they can connect to the cluster and run a workload.
3. Using the mixed version test framework, upgrade the storage cluster with binary version: x+1, cluster version: x. In this mixed version state, create remaining tenants with binary version: x and run a workload.
4. Finalize the storage cluster. At this point, the storage cluster has binary version: x+1 and cluster version: x+1
5. Upgrade tenants with binary version: x+1 and confirm tenants can connect to the storage cluster and run a workload.

In #131847, the test was rewritten using the new mixed version test framework. However, this change exposed this test to a scenario that can cause this test to fail at step 3 above. The MVT framework also runs the mixed version test (i.e. with the tenant at the older binary version) when the cluster is in the finalizing stage. This scenario is run with a [prefixed probability](https://github.com/cockroachdb/cockroach/blob/b29d6f670b94492730eec233051cbe38a57b1ae9/pkg/cmd/roachtest/roachtestutil/mixedversion/mixedversion.go#L633). However, if we attempt to start the tenants with the previous version (i.e. the version the cluster is being upgraded from) when the cluster is being finalized, the tenants rightfully fail to connect which the test incorrectly interprets as a failure. As a result, we would see this test fail occassionally since the test was updated to use the new MVT. This PR modifies the test to ensure that in the finalizing state, we start the tenants with the right version.

Epic: none
Fixes: #136447
Release note: None

138977: roachtest: fix WaitForReady bugs r=kyle-a-wong a=kyle-a-wong

WaitForReady was not properly handling when the deadline of a timeout context was reached while waiting for the cluster to be ready. Previously, hitting the timeout would result in the roachtest running for 10 minutes until the whole test timed out. Now, WaitForReady respects when the timeutil.RunWithTimeout context times out.

Updated WaitForReady's checkReady func to use RoachtestHTTPClient's http client when making the call to GET /health?ready=1 instead of RoachtestHTTPClient's wrapper method. This wrapper method attempts to authenticate the user if no session id exists, but this endpoint doesn't require authentication so it doesnt need to use the wrapper method.

Fixes: #138143
Resolves: #136128
Epic: None
Release note: None

Co-authored-by: rimadeodhar <rima@cockroachlabs.com>
Co-authored-by: Kyle Wong <37189875+kyle-a-wong@users.noreply.github.com>
blathers-crl bot pushed a commit that referenced this pull request Jan 13, 2025
The multitenant upgrade test enforces different test
scenarios while upgrading tenants in a mixed version state.
The test enforces the following cases:
1. Start storage cluster with binary version: x, cluster version: x
2. Create some tenants with binary version: x and ensure
   they can connect to the cluster and run a workload.
3. Using the mixed version test framework, upgrade the storage cluster
   with binary version: x+1, cluster version: x. In this mixed version
   state, create remaining tenants with binary version: x and run a workload.
4. Finalize the storage cluster. At this point, the storage cluster
   has binary version: x+1 and cluster version: x+1
5. Upgrade tenants with binary version: x+1 and confirm tenants
   can connect to the storage cluster and run a workload.

In #131847, the
test was rewritten using the new mixed version test framework.
However, this change exposed this test to a scenario
that can cause this test to fail at step 3 above. The MVT framework
also runs the mixed version test (i.e. with the tenant
at the older binary version) when the cluster is in the
finalizing stage. This scenario is run with a prefixed
probability. However, if we attempt to start the tenants
with the previous version (i.e. the version the cluster
is being upgraded from) when the cluster is being finalized,
the tenants rightfully fail to connect which the test
incorrectly interprets as a failure. As a result, we would see this
test fail occassionally since the test was updated to use the new MVT.
This PR modifies the test to ensure that in the finalizing state,
we start the tenants with the right version.

Epic: none
Fixes: #136447
Release note: None
mohini-crl pushed a commit to mohini-crl/cockroach that referenced this pull request Jan 17, 2025
The multitenant upgrade test enforces different test
scenarios while upgrading tenants in a mixed version state.
The test enforces the following cases:
1. Start storage cluster with binary version: x, cluster version: x
2. Create some tenants with binary version: x and ensure
   they can connect to the cluster and run a workload.
3. Using the mixed version test framework, upgrade the storage cluster
   with binary version: x+1, cluster version: x. In this mixed version
   state, create remaining tenants with binary version: x and run a workload.
4. Finalize the storage cluster. At this point, the storage cluster
   has binary version: x+1 and cluster version: x+1
5. Upgrade tenants with binary version: x+1 and confirm tenants
   can connect to the storage cluster and run a workload.

In cockroachdb#131847, the
test was rewritten using the new mixed version test framework.
However, this change exposed this test to a scenario
that can cause this test to fail at step 3 above. The MVT framework
also runs the mixed version test (i.e. with the tenant
at the older binary version) when the cluster is in the
finalizing stage. This scenario is run with a prefixed
probability. However, if we attempt to start the tenants
with the previous version (i.e. the version the cluster
is being upgraded from) when the cluster is being finalized,
the tenants rightfully fail to connect which the test
incorrectly interprets as a failure. As a result, we would see this
test fail occassionally since the test was updated to use the new MVT.
This PR modifies the test to ensure that in the finalizing state,
we start the tenants with the right version.

Epic: none
Fixes: cockroachdb#136447
Release note: None
rimadeodhar added a commit to rimadeodhar/cockroach that referenced this pull request May 2, 2025
The multitenant upgrade test enforces different test
scenarios while upgrading tenants in a mixed version state.
The test enforces the following cases:
1. Start storage cluster with binary version: x, cluster version: x
2. Create some tenants with binary version: x and ensure
   they can connect to the cluster and run a workload.
3. Using the mixed version test framework, upgrade the storage cluster
   with binary version: x+1, cluster version: x. In this mixed version
   state, create remaining tenants with binary version: x and run a workload.
4. Finalize the storage cluster. At this point, the storage cluster
   has binary version: x+1 and cluster version: x+1
5. Upgrade tenants with binary version: x+1 and confirm tenants
   can connect to the storage cluster and run a workload.

In cockroachdb#131847, the
test was rewritten using the new mixed version test framework.
However, this change exposed this test to a scenario
that can cause this test to fail at step 3 above. The MVT framework
also runs the mixed version test (i.e. with the tenant
at the older binary version) when the cluster is in the
finalizing stage. This scenario is run with a prefixed
probability. However, if we attempt to start the tenants
with the previous version (i.e. the version the cluster
is being upgraded from) when the cluster is being finalized,
the tenants rightfully fail to connect which the test
incorrectly interprets as a failure. As a result, we would see this
test fail occassionally since the test was updated to use the new MVT.
This PR modifies the test to ensure that in the finalizing state,
we start the tenants with the right version.

Epic: none
Fixes: cockroachdb#136447
Release note: None
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.

roachtest: port multitenant-upgrade to new APIs

3 participants