Skip to content

sql: enable tenant testing for more tests#140447

Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom
shubhamdhama:sql-tenant-testing-part-1
Feb 11, 2025
Merged

sql: enable tenant testing for more tests#140447
craig[bot] merged 2 commits intocockroachdb:masterfrom
shubhamdhama:sql-tenant-testing-part-1

Conversation

@shubhamdhama
Copy link
Copy Markdown
Contributor

To achieve this, this PR reduces the usage of createTestServerParams by replacing it with createTestServerParamsAllowTenants. The changes are mostly straightforward, including replacing hardcoded keys.SystemSQLCodec with server.Codec(), and using server.StorageLayer()/server.SystemLayer() where the test is specific to the system tenant.

Informs: #140446
Epic: CRDB-38970
Release note: None

@shubhamdhama shubhamdhama requested a review from a team as a code owner February 4, 2025 07:05
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@shubhamdhama
Copy link
Copy Markdown
Contributor Author

There are still a lot of these usages left, but to keep the PR relatively easier for review I'll put it in next one.

@shubhamdhama shubhamdhama requested a review from rafiss February 7, 2025 08:50
@craig

This comment was marked as outdated.

@shubhamdhama shubhamdhama force-pushed the sql-tenant-testing-part-1 branch 2 times, most recently from 3967b7b to c1f7079 Compare February 10, 2025 06:35
To achieve this, this PR reduces the usage of `createTestServerParams`
by replacing it with `createTestServerParamsAllowTenants`. The changes
are mostly straightforward, including replacing hardcoded
`keys.SystemSQLCodec` with `server.Codec()`, and using
`server.StorageLayer()`/`server.SystemLayer()` where the test is
specific to the system tenant.

Informs: cockroachdb#140446
Epic: CRDB-38970
Release note: None
The previous comment implied that `ApplicationLayer()` could randomly
return either the system tenant's or a secondary tenant's interface.
This change clarifies that behavior.
@shubhamdhama shubhamdhama force-pushed the sql-tenant-testing-part-1 branch from c1f7079 to b13bd15 Compare February 10, 2025 06:57
Copy link
Copy Markdown
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

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

lgtm! thank you for improving these tests!

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @cthumuluru-crdb)

@shubhamdhama
Copy link
Copy Markdown
Contributor Author

bors r=rafiss

@shubhamdhama
Copy link
Copy Markdown
Contributor Author

Thanks for the review, Rafi.

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 11, 2025

@craig craig bot merged commit 0366399 into cockroachdb:master Feb 11, 2025
17 checks passed
shubhamdhama added a commit to shubhamdhama/cockroach that referenced this pull request Feb 12, 2025
Previously all tests in this file were disabled for multitenancy.

(Continuation of cockroachdb#140447 for `schema_changer_test.go`)

Informs: cockroachdb#140446
Epic: CRDB-38970
Release note: None
@cthumuluru-crdb
Copy link
Copy Markdown
Contributor

LGTM. Thanks, @shubhamdhama!

Copy link
Copy Markdown
Contributor

@cthumuluru-crdb cthumuluru-crdb left a comment

Choose a reason for hiding this comment

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

LGTM!

craig bot pushed a commit that referenced this pull request Feb 14, 2025
141213: sql: enable tenant testing for schema_changer tests r=cthumuluru-crdb,rafiss a=shubhamdhama

Previously all tests in this file were disabled for multitenancy.

(Continuation of #140447 for `schema_changer_test.go`)

Informs: #140446
Epic: CRDB-38970
Release note: None

141392: sqlstats: Reuse sessionphase.Times on stats collector r=xinhaoz a=xinhaoz

StatsCollector.Reset shows up in sqlstats section of cpu/mem
profiles. This seemed to mostly be allocations of new session.PhaseTimes
objects. This commit avoids new allocations of session.PhaseTimes
when resetting the stats collector.

Epic: none

Release note: None

```
name                                           old time/op    new time/op    delta
Sysbench/SQL/3node/oltp_read_write-24            13.2ms ± 2%    13.0ms ± 1%  -1.69%  (p=0.001 n=10+10)
ParallelSysbench/SQL/3node/oltp_read_write-24    1.22ms ± 3%    1.22ms ± 1%    ~     (p=0.315 n=10+10)

name                                           old errs/op    new errs/op    delta
Sysbench/SQL/3node/oltp_read_write-24              0.00           0.00         ~     (all equal)
ParallelSysbench/SQL/3node/oltp_read_write-24      0.01 ±20%      0.01 ±52%    ~     (p=0.231 n=9+10)

name                                           old alloc/op   new alloc/op   delta
Sysbench/SQL/3node/oltp_read_write-24            2.18MB ± 1%    2.18MB ± 1%    ~     (p=0.666 n=9+9)
ParallelSysbench/SQL/3node/oltp_read_write-24    2.03MB ± 1%    2.03MB ± 1%    ~     (p=0.971 n=10+10)

name                                           old allocs/op  new allocs/op  delta
Sysbench/SQL/3node/oltp_read_write-24             10.5k ± 2%     10.5k ± 2%    ~     (p=0.529 n=10+10)
ParallelSysbench/SQL/3node/oltp_read_write-24     9.16k ± 2%     9.17k ± 2%    ~     (p=0.853 n=10+10)
```


141446: backup: fix panic on encrypted incremental after non-encrypted backup r=msbutler a=kev-cao

When attempting an encrypted backup on a non-encrypted backup chain, an error should be surfaced to the user indicating an error and inability to do so. Due to a missing error check, this currently panics.

Epic: none

Release note: None

Co-authored-by: Shubham Dhama <shubham.dhama@cockroachlabs.com>
Co-authored-by: Xin Hao Zhang <xzhang@cockroachlabs.com>
Co-authored-by: Kevin Cao <kevin.cao@cockroachlabs.com>
annrpom pushed a commit to annrpom/cockroach that referenced this pull request Feb 20, 2025
Previously all tests in this file were disabled for multitenancy.

(Continuation of cockroachdb#140447 for `schema_changer_test.go`)

Informs: cockroachdb#140446
Epic: CRDB-38970
Release note: None
shubhamdhama added a commit to shubhamdhama/cockroach that referenced this pull request Feb 21, 2025
(Stacked on cockroachdb#141490.)

This PR continues the work from cockroachdb#140447, replacing occurrences of
`createTestServerParams` with `createTestServerParamsAllowTenants`
to enable tenant testing in these tests.

Informs: cockroachdb#140446
Epic: CRDB-38970
Release note: None
craig bot pushed a commit that referenced this pull request Feb 21, 2025
141604: sql: increase tenant testing coverage r=rafiss,yuzefovich a=shubhamdhama

This PR continues the work from #140447, replacing occurrences of
`createTestServerParams` with `createTestServerParamsAllowTenants`
to enable tenant testing in these tests.

Informs: #140446
Epic: CRDB-38970
Release note: None


141833: upgrades: report progress during 25.1 upgrade jobs backfill r=dt a=dt

Release note: none.
Epic: none.

Co-authored-by: Shubham Dhama <shubham.dhama@cockroachlabs.com>
Co-authored-by: David Taylor <tinystatemachine@gmail.com>
@shubhamdhama shubhamdhama deleted the sql-tenant-testing-part-1 branch March 1, 2025 10:45
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.

4 participants