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

roachtest: port multitenant-multiregion to new APIs #124795

Conversation

vidit-bhat
Copy link
Contributor

@vidit-bhat vidit-bhat commented May 29, 2024

This commit ports the acceptance/multitenant-multiregion roachtest to use the recently introduced roachprod API to manage virtual clusters.
It also removes the previous brittle logic for log checking.

Fixes: #124029
Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

This commit ports the `multitenant-multiregion` roachtest to use the
recently introduced roachprod API to manage virtual clusters.

It also removes the previous brittle logic for log checking.

Fixes: cockroachdb#124029

Release note: None
@vidit-bhat vidit-bhat force-pushed the roachtest-multiregion-multitenant-new-api branch from 119a704 to 5f509a2 Compare May 29, 2024 09:41
require.NoError(t, err)
configStmts := []string{
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we want all of these cluster settings back in, but especially that first one:

sql.virtual_cluster.feature_access.multiregion.enabled='true'

Without that, I don't think it will let you create a multitenant + multiregion cluster

install.MakeClusterSettings(),
)

virtualClusterURLs := func() []string {
Copy link
Contributor

Choose a reason for hiding this comment

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

This shouldn't change once the cluster is started, so this can just be a var virtualClusterURLs []string instead of invoking a function to fetch it every time.

for i, node := range c.All() {
region := regions[i]
regionInfo := fmt.Sprintf("cloud=%s,region=%s,zone=%s", c.Cloud(), regionOnly(region), region)
tenant := deprecatedCreateTenantNode(ctx, t, c, c.All(), tenantID, node, tenantHTTPPort, tenantSQLPort, createTenantRegion(regionInfo))
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like the old test was creating a tenant on every node whereas here you're just creating one tenant overall. I think we would want to call c.StartServiceForVirtualCluster for every tenant?

mkStmt("SET CLUSTER SETTING sql.region_liveness.enabled='yes'"),
)
verifySQL(t, tenants[0].pgURL,
verifySQL(t, virtualClusterURLs[0],
mkStmt(fmt.Sprintf(`ALTER DATABASE system SET PRIMARY REGION '%s'`, regionOnly(regions[0]))),
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't work because the tenant user doesn't have access to modify the system db 🤔

This might not be an issue with your test set up? It should be creating the default user and granting it ADMIN permissions, and in fact I see the comment in the logs saying: log into DB console for virtual cluster multiregion-tenant with user=roachprod password=cockroachdb.

Would need to take a deeper look to see why it's not working. Maybe the pgurl isn't correct?

Anyway, if it is unrelated you can pass in Auth: install.AuthRootCert to c.ExternalPGUrl() as a temporary unblocker, although in the end we should get this working with non root.

@vidit-bhat vidit-bhat closed this Sep 24, 2024
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-multiregion to new APIs
3 participants