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

logictest: add local-mixed-23.1-23.2 as a default config #104994

Closed
wants to merge 1 commit into from

Conversation

rafiss
Copy link
Collaborator

@rafiss rafiss commented Jun 15, 2023

informs #103956

This ensures that we test logic tests with a system schema bootstrapped from 23.1.

This also renames local-mixed-22.2-23.1 to instead to be local-mixed-22.2-23.2, since we want to test skipping version 23.1.

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@rafiss rafiss force-pushed the local-mixed-23.1-23.2 branch 4 times, most recently from 0772754 to cb06b02 Compare June 15, 2023 19:39
This ensures that we test logic tests with a system schema bootstrapped
from 23.1.

This also renames local-mixed-22.2-23.1 to instead to be
local-mixed-22.2-23.2, since we want to test skipping version 23.1.

Release note: None
@rafiss rafiss force-pushed the local-mixed-23.1-23.2 branch from cb06b02 to 64f3b22 Compare June 15, 2023 20:52
@rafiss
Copy link
Collaborator Author

rafiss commented Jun 17, 2023

@postamar I tried making a new logictest config like this:

	{
		Name:                        "local-mixed-23.1-23.2",
		NumNodes:                    1,
		OverrideDistSQLMode:         "off",
		BootstrapVersion:            clusterversion.V23_1,
		DisableUpgrade:              true,
		DeclarativeCorpusCollection: true,
	},

However, the test setup fails here:

// Only create the test database on the initial cluster, since cluster restore
// expects an empty cluster.
if _, err := t.db.Exec(`
CREATE DATABASE test; USE test;
`); err != nil {
t.Fatal(err)
}

with the error:

    logic.go:1888: pq: unexpected value: raw_bytes:"J\013\341S\003\022Y\n\tdefaultdb\020d\0320\n\013\n\005admin\020\002\030\002\n\r\n\006public\020\200\020\030\000\n\n\n\004root\020\002\030\002\022\004root\030\002\"\000(\001:\014\n\006public\022\002\010e@\000J\000Z\002\020\000" timestamp:<wall_time:1686864046932492476 >

This seems like it might have something to do with the initialvalues for V23_1. Do you have any ideas for how to debug this?

@postamar
Copy link
Contributor

As discussed this looks like the failure of a CPut to system.descriptor. Those are performed by the descs.Collection.

That's the proximal cause however, deeper down I suspect it's related to the test cluster not being set up correctly somehow; we're doing something relatively new and, until now, uncommon, in which we start a test cluster at a version which is neither the min-supported version or the binary version. I'm curious how mixed-version clusters started using the go-testserver framework will behave.

@rafiss
Copy link
Collaborator Author

rafiss commented Oct 17, 2023

#112122 replaced this

@rafiss rafiss closed this Oct 17, 2023
@rafiss rafiss deleted the local-mixed-23.1-23.2 branch October 17, 2023 15:27
RaduBerinde added a commit to RaduBerinde/cockroach that referenced this pull request Oct 18, 2023
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 cockroachdb#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
RaduBerinde added a commit to RaduBerinde/cockroach that referenced this pull request Oct 18, 2023
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 cockroachdb#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
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 <[email protected]>
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