Skip to content

sql: remove usages of TODOTestTenantDisabled#106883

Merged
craig[bot] merged 3 commits intocockroachdb:masterfrom
yuzefovich:tt-sql
Jul 19, 2023
Merged

sql: remove usages of TODOTestTenantDisabled#106883
craig[bot] merged 3 commits intocockroachdb:masterfrom
yuzefovich:tt-sql

Conversation

@yuzefovich
Copy link
Copy Markdown
Member

Addresses: #76378.
Epic: CRDB-18499

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@yuzefovich yuzefovich force-pushed the tt-sql branch 3 times, most recently from 348e8b7 to 7d0dfd7 Compare July 17, 2023 22:25
@yuzefovich yuzefovich force-pushed the tt-sql branch 7 times, most recently from 5721df2 to 7ec96b3 Compare July 19, 2023 01:35
@yuzefovich yuzefovich marked this pull request as ready for review July 19, 2023 02:44
@yuzefovich yuzefovich requested review from a team as code owners July 19, 2023 02:44
@yuzefovich yuzefovich requested review from knz, mgartner and stevendanna and removed request for mgartner July 19, 2023 02:44
Copy link
Copy Markdown
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

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

:lgtm: with a few clarifying questions

Reviewed 3 of 3 files at r1, 1 of 1 files at r2, 9 of 9 files at r3, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @stevendanna and @yuzefovich)


pkg/sql/backfill_protected_timestamp_test.go line 101 at r2 (raw file):

	}

	// By default, secondary tenants aren't allowed to mock with the zone

nit: s/mock/muck


pkg/sql/conn_executor_test.go line 1198 at r1 (raw file):

		},
	}
	tc := serverutils.StartNewTestCluster(t, 1, testClusterArgs)

maybe StartServer instead of test cluster.


pkg/sql/crdb_internal_test.go line 982 at r1 (raw file):

	ctx := context.Background()
	tc := testcluster.StartTestCluster(t, 1,

maybe StartServer with TestTenantAlwaysEnabled, and drop the StartTenant call below.


pkg/sql/run_control_test.go line 925 at r1 (raw file):

	}

	kvserver, _, _ := serverutils.StartServer(t, params)

maybe use TestTenantAlwaysEnabled and do tenant := kvserver.TenantOrServer() below.


pkg/sql/run_control_test.go line 940 at r1 (raw file):

	makeTenantConn := func() *sqlutils.SQLRunner {
		return sqlutils.MakeSQLRunner(serverutils.OpenDBConn(t, tenant.SQLAddr(), "" /* useDatabase */, false /* insecure */, kvserver.Stopper()))

that kvserver.Stopper here seems wrong, the conn should hang off the tenant stopper instead.


pkg/sql/importer/exportparquet_test.go line 294 at r3 (raw file):

	sqlDB.Exec(t, fmt.Sprintf("CREATE DATABASE %s", dbName))

	// instantiating an internal executor to easily get datums from the table

nit: capital at start of sentence and period at the end.


pkg/sql/importer/import_stmt_test.go line 138 at r3 (raw file):

	sqlDB.Exec(t, `SET CLUSTER SETTING kv.bulk_ingest.batch_size = '10KB'`)
	sqlDB.Exec(t, `SET CLUSTER SETTING storage.mvcc.range_tombstones.enabled = true`)

curious - why did you need to remove this here and below?

Three of the tests in `sql` package are explicitly managing the tenants
already.

Release note: None
This commit adjusts `TestValidationWithProtectedTS` to work with test
tenants too. However, it seems like the test becomes noticeably
slower, and improving the test speed is tracked by cockroachdb#106960.

Release note: None
This commit is a grab bag of things:
- remove a couple of TODOTestTenantDisabled in benchmarks to be tracked
by the benchmarking issue
- ensure that all tests in `sql/importer` can run with test tenant
(unless explicitly disabled)
  - enable Export tests
  - adjust `TestProcessorEncountersUncertaintyError`
  - use correct `ExecutorConfig` in some of the tests
  - `TestProtectedTimestampsDuringImportInto` is marked as required
    separate investigation
  - remove updating `storage.mvcc.range_tombstones.enabled` cluster
    setting to `true` since it's already enabled by default on master.

Most of the remaining TODOsin `sql/importer` are currently in `importer`
test package (rather than `importer_test`) which would create an import
cycle if `ccl` is imported, so they will be tackled separately.

Release note: None
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 @knz and @stevendanna)


pkg/sql/conn_executor_test.go line 1198 at r1 (raw file):

Previously, knz (Raphael 'kena' Poss) wrote…

maybe StartServer instead of test cluster.

Done.


pkg/sql/crdb_internal_test.go line 982 at r1 (raw file):

Previously, knz (Raphael 'kena' Poss) wrote…

maybe StartServer with TestTenantAlwaysEnabled, and drop the StartTenant call below.

Done.


pkg/sql/run_control_test.go line 925 at r1 (raw file):

Previously, knz (Raphael 'kena' Poss) wrote…

maybe use TestTenantAlwaysEnabled and do tenant := kvserver.TenantOrServer() below.

Done.


pkg/sql/run_control_test.go line 940 at r1 (raw file):

Previously, knz (Raphael 'kena' Poss) wrote…

that kvserver.Stopper here seems wrong, the conn should hang off the tenant stopper instead.

Done.


pkg/sql/importer/import_stmt_test.go line 138 at r3 (raw file):

Previously, knz (Raphael 'kena' Poss) wrote…

curious - why did you need to remove this here and below?

This setting is already defaulted to true, actually not being used on 23.2 binaries, and is tenant read-only so we were getting an error when updating it.

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jul 19, 2023

This PR was included in a batch that timed out, it will be automatically retried

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jul 19, 2023

Build succeeded:

@craig craig bot merged commit b005e97 into cockroachdb:master Jul 19, 2023
@yuzefovich yuzefovich deleted the tt-sql branch July 19, 2023 22:13
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.

3 participants