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

server: don't write to the test server config in maybeStartDefaultTestTenant #104503

Closed
wants to merge 1 commit into from

Conversation

knz
Copy link
Contributor

@knz knz commented Jun 7, 2023

Epic: CRDB-18499
Fixes #104500.

The server config can be read asynchronously by the server controller when starting servers in the background. So a write there is racy.

(If we later discover we really need to write to the server config, we'd need to introduce a mutex for that.)

Release note: None

…stTenant`

The server config can be read asynchronously by the server controller
when starting servers in the background. So a write there is racy.

(If we later discover we really need to write to the server config,
we'd need to introduce a mutex for that.)

Release note: None
@knz knz requested review from a team as code owners June 7, 2023 14:19
@knz knz requested review from smg260 and removed request for a team June 7, 2023 14:19
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@herkolategan herkolategan left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ajstorm, @knz, @smg260, and @stevendanna)


pkg/server/testserver.go line 548 at r1 (raw file):

		// If not enterprise enabled, we won't be able to use SQL Servers so eat
		// the error and return without creating/starting a SQL server.
		ts.cfg.DisableDefaultTestTenant = true

Some CI failures unfortunately popped up. This somehow exposed a different issue where testing.TB is not set in a call to StartServerRaw causing a panic when it tries to log the tenant message, which I think should be fixed in either case. And additionally logic.go also makes some assumptions by calling TestCluster.StartedDefaultTestTenant() which gets it from the above cfg. Not sure if patching these or introducing a mutex will be lower impact.

@knz
Copy link
Contributor Author

knz commented Aug 15, 2023

Replacing with #108762.

@knz knz closed this Aug 15, 2023
@knz knz deleted the 20230607-avoid-ts-write branch August 15, 2023 10:32
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.

testserver: racy access to DisableDefaultTestTenant
3 participants