Skip to content

server,util: reduce usage of tenant 2 as an application tenant from tests#148805

Open
Nukitt wants to merge 1 commit intocockroachdb:masterfrom
Nukitt:ten3-tests
Open

server,util: reduce usage of tenant 2 as an application tenant from tests#148805
Nukitt wants to merge 1 commit intocockroachdb:masterfrom
Nukitt:ten3-tests

Conversation

@Nukitt
Copy link
Copy Markdown
Contributor

@Nukitt Nukitt commented Jun 25, 2025

This PR is similar and in continuation to #148804.

Currently, we use tenant ID 2 as an application tenant in various tests.
However, in normal operational scenarios, the creation of tenant ID 2 is
explicitly disabled to avoid conflicts with its role in UA, as detailed here:

// ID 2 is reserved for future use: it was a "template" tenant in 23.2 UA and
// used for an internal test in serverless, so we can reclaim it if we want it
// so long as we don't allow it to be used for real tenants.
if nextID == 2 {
nextID = 3
}

With the ongoing migration towards UA, tenant ID 2 will begin functioning
as a system tenant.

Consequently, we are shifting the application tenant role from tenant ID 2 to
tenant ID 3 to clearly separate the roles and responsibilities of system and
application tenants. This patch specifically addresses and reduces the usage
of tenant ID 2 within tests, ensuring tests align with this architectural adjustment
and maintaining consistency across the codebase.

Part of: #138801
Epic : CRDB-45181
Release note: none

@Nukitt Nukitt requested a review from shubhamdhama June 25, 2025 13:22
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@Nukitt Nukitt changed the title all: remove usage of tenant 2 as an application tenant from tests server,util: remove usage of tenant 2 as an application tenant from tests Jun 25, 2025
@Nukitt Nukitt marked this pull request as ready for review June 25, 2025 20:42
@Nukitt Nukitt requested review from a team as code owners June 25, 2025 20:42
@Nukitt Nukitt requested review from Abhinav1299, aa-joshi, arjunmahishi, kyle-a-wong and msbutler and removed request for a team June 25, 2025 20:42
@Nukitt Nukitt changed the title server,util: remove usage of tenant 2 as an application tenant from tests server,util: reduce usage of tenant 2 as an application tenant from tests Aug 1, 2025
…ests

This PR is similar to cockroachdb#148804.

Currently, we use tenant ID 2 as an application tenant in various tests.
However, in normal operational scenarios, the creation of tenant ID 2 is
explicitly disabled to avoid conflicts with its role in UA, as detailed here:

https://github.com/cockroachdb/cockroach/blob/9919801f067f26c951f43cbedfa093c37cdda20e/pkg/sql/tenant_creation.go#L604-L609

With the ongoing migration towards UA, tenant ID 2 will begin functioning
as a system tenant.

Consequently, we are shifting the application tenant role from tenant ID 2 to
tenant ID 3 to clearly separate the roles and responsibilities of system and
application tenants. This patch specifically addresses and reduces the usage
of tenant ID 2 within tests, ensuring tests align with this architectural adjustment
and maintaining consistency across the codebase.

Part of: cockroachdb#138801
Epic : CRDB-45181
Release note: none
@rafiss rafiss removed the request for review from a team December 19, 2025 20:25
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.

2 participants