-
Notifications
You must be signed in to change notification settings - Fork 4.1k
testserver: racy access to DisableDefaultTestTenant #104500
Copy link
Copy link
Closed
Labels
A-multitenancyRelated to multi-tenancyRelated to multi-tenancyA-testingTesting tools and infrastructureTesting tools and infrastructureC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-multitenantIssues owned by the multi-tenant virtual teamIssues owned by the multi-tenant virtual team
Description
Describe the problem
This code in (ts *TestServer) maybeStartDefaultTestTenant:
if err := base.CheckEnterpriseEnabled(ts.st, clusterID(), "SQL servers"); err != nil {
ts.cfg.DisableDefaultTestTenant = true // <- HERE
return nil
}possibly races with the following code in (s *Server) makeSharedProcessTenantConfig:
parentCfg := s.cfg // <- HEREThe race is triggered when the following conditions hold simultaneously:
ccl.TestingEnableEnterprise()has not been called- a test server is started via
serverutils.StartServer - concurrently, the test makes the server controller internally start a tenant server (eg as side effect of
alter tenant start service shared)
These conditions are rather unlikely and currently only happen in configprofiles.TestDataDriven (this is the root cause of test failures #102800 and #102408.)
Expected behavior
I don't think it's safe/reasonable for the code in (ts *TestServer) maybeStartDefaultTestTenant to write to its ts.cfg.
I also don't think it's even necessary for this logic.
Jira issue: CRDB-28566
Epic: CRDB-18499
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-multitenancyRelated to multi-tenancyRelated to multi-tenancyA-testingTesting tools and infrastructureTesting tools and infrastructureC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-multitenantIssues owned by the multi-tenant virtual teamIssues owned by the multi-tenant virtual team