Skip to content

sql: several preliminary changes to making tests work with secondary tenants#155783

Merged
craig[bot] merged 4 commits intocockroachdb:masterfrom
yuzefovich:tenant-sql-preliminary
Oct 24, 2025
Merged

sql: several preliminary changes to making tests work with secondary tenants#155783
craig[bot] merged 4 commits intocockroachdb:masterfrom
yuzefovich:tenant-sql-preliminary

Conversation

@yuzefovich
Copy link
Copy Markdown
Member

This PR contains several commits which audit tests in pkg/sql directory to ensure the right JobRegistry, codec, LeaseManager, and PGUrl are used. Almost all were pretty mechanical changes. Note that no new tests are enabled with secondary tenants yet - this will be done separately.

Epic: CRDB-48945

@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Oct 21, 2025

Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@yuzefovich yuzefovich force-pushed the tenant-sql-preliminary branch 2 times, most recently from 88deb14 to ddc445c Compare October 22, 2025 02:45
@yuzefovich yuzefovich marked this pull request as ready for review October 22, 2025 02:45
@yuzefovich yuzefovich requested review from a team as code owners October 22, 2025 02:45
@yuzefovich yuzefovich requested review from a team, jasonlmfong, kev-cao, nameisbhaskar, rytaft and srosenberg and removed request for a team, jasonlmfong, kev-cao, nameisbhaskar, rytaft and srosenberg October 22, 2025 02:45
@yuzefovich yuzefovich requested review from a team and mw5h and removed request for a team October 22, 2025 02:46
Copy link
Copy Markdown
Contributor

@mw5h mw5h left a comment

Choose a reason for hiding this comment

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

:lgtm:

@mw5h reviewed 5 of 7 files at r1, 29 of 31 files at r2, 5 of 5 files at r3, 32 of 32 files at r4, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @yuzefovich)


pkg/sql/catalog/lease/lease_internal_test.go line 1911 at r4 (raw file):

	})
	go func() {
	}()

Wut?

Code quote:

	go func() {
	}()

@yuzefovich yuzefovich force-pushed the tenant-sql-preliminary branch from ddc445c to 3eb6bb1 Compare October 23, 2025 21:34
Copy link
Copy Markdown
Member Author

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

TFTR!

bors r+

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @mw5h)


pkg/sql/catalog/lease/lease_internal_test.go line 1911 at r4 (raw file):

Previously, mw5h (Matt White) wrote…

Wut?

Haha, that was my reaction as well 😆

craig bot pushed a commit that referenced this pull request Oct 23, 2025
155783: sql: several preliminary changes to making tests work with secondary tenants r=yuzefovich a=yuzefovich

This PR contains several commits which audit tests in `pkg/sql` directory to ensure the right JobRegistry, codec, LeaseManager, and PGUrl are used. Almost all were pretty mechanical changes. Note that no new tests are enabled with secondary tenants yet - this will be done separately.

Epic: CRDB-48945


156002: workload/tpch: add a couple of missed values for fixtures generation r=yuzefovich a=yuzefovich

When we added the fixtures generation of TPCH spec, we forgot a couple of values - one for "priorities" and one for "containers". This commit fixes that omission. In particular, missing priority value made us return 4 rows instead of 5 for Q4, and the expectation has been adjusted accordingly.

Note that this omission was exposed via a roachtest that uses correctly generated fixtures of SF 100.

Fixes: #155834.

Release note: None

156008: Revert "publish-artifacts: change GCS latest key prefix for Workload … r=rail a=williamchoe3

Original PR: #155789

Reverting to split into 2 commits for easier backport

Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
Co-authored-by: William Choe <williamchoe3@gmail.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Oct 23, 2025

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Oct 24, 2025

Merge conflict.

One of the common modifications we need to make for tests to work with
secondary tenants is using the JobRegistry of the ApplicationLayer (as
opposed to the one belonging to the system tenant). This commit audits
all tests in `pkg/sql` directory to ensure the right registry is used.
Note that tests still might need further modifications.

Release note: None
One of the common modifications we need to make for tests to work with
secondary tenants is using the right `keys.SQLCodec` (as opposed to the
one belonging to the system tenant). This commit audits all tests in
`pkg/sql` directory to ensure that the right codec is passed. Note that
tests still might need further modifications. Also note that tests that
don't start a test server / a test cluster weren't touched (since they
don't benefit from the tenant randomization behavior).

Release note: None
This commit audits all tests in `pkg/sql` directory to ensure the
LeaseManager of the application layer is used. Note that tests
still might need further modifications.

Release note: None
This commit replaces almost all usages of `pgurlutils` package within
the `sql` directory in tests with the corresponding `PGUrl` call on the
`ApplicationLayerInterface` since I found this to be a necessary change
in several tests when making them work with secondary tenants. Perhaps
this wasn't necessary, but it seems cleaner and more consistent this
way.

Release note: None
@yuzefovich yuzefovich force-pushed the tenant-sql-preliminary branch from 3eb6bb1 to 2d2edcb Compare October 24, 2025 06:44
@yuzefovich
Copy link
Copy Markdown
Member Author

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Oct 24, 2025

@craig craig bot merged commit b2be406 into cockroachdb:master Oct 24, 2025
23 of 24 checks passed
@yuzefovich yuzefovich deleted the tenant-sql-preliminary branch October 24, 2025 14:45
rishabh7m added a commit to crltest-issue-syncing/cockroach-fork that referenced this pull request Nov 20, 2025
rishabh7m added a commit to crltest-issue-syncing/cockroach-fork that referenced this pull request Nov 21, 2025
rishabh7m added a commit to crltest-issue-syncing/cockroach-fork that referenced this pull request Nov 21, 2025
rishabh7m added a commit to crltest-issue-syncing/cockroach-fork that referenced this pull request Dec 1, 2025
rishabh7m added a commit to crltest-issue-syncing/cockroach-fork that referenced this pull request Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants