Skip to content

testcluster: clone Settings for each server#112456

Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom
RaduBerinde:no-settings-sharing-2
Oct 18, 2023
Merged

testcluster: clone Settings for each server#112456
craig[bot] merged 2 commits intocockroachdb:masterfrom
RaduBerinde:no-settings-sharing-2

Conversation

@RaduBerinde
Copy link
Copy Markdown
Member

testserver: unembed Settings, RaftConfig

There is no reason these should be embedded.
Epic: none
Release note: None

testcluster: clone Settings for each server

Currently there are many tests where multi-node test clusters share
the same *Settings object. This is problematic - on one hand, it can
make some test failures very hard to debug, and on the other hand, we
are missing out on testing more realistic scenarios where nodes in a
cluster don't magically have their settings in sync.

This change adds some test-only code to clone the Settings object.

Fixes #112395
Release note: None

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@RaduBerinde RaduBerinde force-pushed the no-settings-sharing-2 branch 3 times, most recently from aa97820 to 3649355 Compare October 17, 2023 00:49
@RaduBerinde RaduBerinde requested a review from mgartner October 17, 2023 03:22
@RaduBerinde RaduBerinde marked this pull request as ready for review October 17, 2023 03:22
@RaduBerinde RaduBerinde requested review from a team as code owners October 17, 2023 03:22
@RaduBerinde RaduBerinde requested a review from dt October 17, 2023 16:35
@RaduBerinde RaduBerinde force-pushed the no-settings-sharing-2 branch from 3649355 to fce396f Compare October 17, 2023 16:59
@RaduBerinde RaduBerinde force-pushed the no-settings-sharing-2 branch from fce396f to 598efb5 Compare October 17, 2023 17:33
There is no reason these should be embedded.
Epic: none
Release note: None
Currently there are many tests where multi-node test clusters share
the same `*Settings` object. This is problematic - on one hand, it can
make some test failures very hard to debug, and on the other hand, we
are missing out on testing more realistic scenarios where nodes in a
cluster don't magically have their settings in sync.

This change adds test-only code to clone the Settings object for each
server.

Fixes cockroachdb#112395
Release note: None
@RaduBerinde RaduBerinde force-pushed the no-settings-sharing-2 branch from 598efb5 to 0073091 Compare October 18, 2023 00:52
@RaduBerinde
Copy link
Copy Markdown
Member Author

Friendly ping for whomever has a bit of time to review this. I have a few PRs on top that I hope to merge before I leave on vacation Thursday afternoon. Many thanks!!

Copy link
Copy Markdown
Contributor

@mgartner mgartner 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 4 of 4 files at r1, 7 of 7 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @dt and @srosenberg)

@RaduBerinde
Copy link
Copy Markdown
Member Author

TFTR!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Oct 18, 2023

Build succeeded:

@craig craig bot merged commit 282ff9a into cockroachdb:master Oct 18, 2023
@RaduBerinde RaduBerinde deleted the no-settings-sharing-2 branch October 18, 2023 19:37
craig bot pushed a commit that referenced this pull request Oct 18, 2023
112385: bootstrap: fix and clean up bootstrapping at older versions r=RaduBerinde a=RaduBerinde

Note: this PR is only for the top commit, the rest is #112456.

----

This commit fixes the logic around bootstrapping clusters at earlier
versions. Currently there is some special casing around the minimum
supported version which makes that work, but other backwards
compatible versions don't work correctly.  Specifically, after bumping
the version to 24.1, a `local-mixed-23.2` config for logic tests does
not work.

The core problem is that we are initializing the stores with a version
and then populating the initial system values at another version.

I am reasonably confident this was the root cause for #104994, where
we tried adding a 23.1 config while the min supported version was
22.2.

This fix makes the logic clearer and simpler. We can only bootstrap
the cluster at specific versions (the current version, and compatible
released versions). When the bootstrap version is overridden, we find
the latest version that we can initialize the cluster and use that for
both the stores and the initial values. Then we can upgrade to the
desired version from there.

This simplifies the tests: we no longer need
`BootstrapVersionKeyOverride` (which was confusing, given that we also
have `BinaryVersionOverride`).

Epic: none
Release note: None



Co-authored-by: Radu Berinde <radu@cockroachlabs.com>
andrewbaptist pushed a commit to andrewbaptist/cockroach that referenced this pull request Mar 26, 2024
Previously the test TestRangeMigration was using artifical versions.
This no longer works after cockroachdb#112456. This commit cleans up the test to
validate upgrades work from `PreviousRelease` to `Latest`

Epic: none

Release note: None
craig bot pushed a commit that referenced this pull request Mar 26, 2024
121118: kvserver: clean up version logic r=kvoli a=andrewbaptist

Previously the test TestRangeMigration was using artifical versions. This no longer works after #112456. This commit cleans up the test to validate upgrades work from `PreviousRelease` to `Latest`

Epic: none

Release note: None

Co-authored-by: Andrew Baptist <baptist@cockroachlabs.com>
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.

testcluster: disallow sharing of Settings between nodes

3 participants