Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
95865: cmd/roachtest: adapt disk-stall detection roachtest r=nicktrav,erikgrinaker a=jbowens

Move the existing disk-stall/* roachtests under disk-stall/fuse/* (for the FUSE
filesystem approach to stalling) and skip them for now. Currently, they're not
capable of stalling the disk longer 50us (see #95886), which makes them
unreliable at exercising stalls.

Add two new roachtests, disk-stall/dmsetup and disk-stall/cgroup that use
dmsetup and cgroup bandwidth restrctions respectively to reliably induce a
write stall for an indefinite duration.

Informs #94373.
Epic: None
Release note: None

95999: multitenant: add multitenant/shared-process/basic roachtest r=stevendanna a=msbutler

This patch introduces a simple roachtest that runs in a shared-process tenant.
This test imports a 500 tpcc workload (about 30 GB of replicated data), and
runs the workload for 10 minutes. The test is run on a 4 node, 4vcpu cluster
with local ssds.

A future patch could complicate the test by running schema changes or other
bulk operations.

Fixes #95990

Release note: None

96202: opt: inverted-index accelerate filters of the form j->0 @> '{"b": "c"} r=Shivs11 a=Shivs11

Previously, the optimizer did not plan inverted index scans for filters
having an integer as the index for the fetch value in a filter alongside
the "contains" or the "contained by" operator.

To address this, we now build JSON arrays from fetch value expressions
with integer indexes. From these JSON arrays, inverted spans are built
for constraining scans over inverted indexes. With these changes chains
of both integer and string fetch value operators are now supported
alongside the "contains" and the "contained by" operators.
(e.g., j->0 `@>` '{"b": "c"}' and j->0 <@ '{"b": "c"}').

Epic: [CRDB-3301](https://cockroachlabs.atlassian.net/browse/CRDB-3301)
Fixes: #94667

Release note (performance improvement): The optimizer now plans
inverted index scans for queries that filter by JSON fetch value
operators (->) with integer indices alongside the "contains" or
the "contained by" operators, e.g, json_col->0 `@>` '{"b": "c"}'
or json_col->0 <@ '{"b": "c"}'

96328: udf: allow strict UDF with no arguments r=DrewKimball a=DrewKimball

This patch fixes the case when a strict UDF (returns null on null input) has no arguments. Previously, attempting to call such a function would result in `ERROR: reflect: call of reflect.Value.Pointer on zero Value`.

Fixes #96326

Release note: None

Co-authored-by: Jackson Owens <[email protected]>
Co-authored-by: Michael Butler <[email protected]>
Co-authored-by: Shivam Saraf <[email protected]>
Co-authored-by: Drew Kimball <[email protected]>
  • Loading branch information
5 people committed Feb 1, 2023
5 parents 7ac7861 + 2e8f273 + 33a01d2 + 3ed8616 + e08a60b commit c77104e
Show file tree
Hide file tree
Showing 15 changed files with 1,169 additions and 178 deletions.
1 change: 1 addition & 0 deletions pkg/cmd/roachtest/tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ go_library(
"mixed_version_schemachange.go",
"multitenant.go",
"multitenant_distsql.go",
"multitenant_shared_process.go",
"multitenant_tpch.go",
"multitenant_upgrade.go",
"multitenant_utils.go",
Expand Down
28 changes: 5 additions & 23 deletions pkg/cmd/roachtest/tests/cluster_to_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,14 @@ func setupC2C(
srcClusterSettings(t, srcSQL)
destClusterSettings(t, destSQL)

createTenantAdminRole(t, "src-system", srcSQL)
createTenantAdminRole(t, "dst-system", destSQL)

srcTenantID, destTenantID := 2, 2
srcTenantName := "src-tenant"
destTenantName := "destination-tenant"
srcSQL.Exec(t, fmt.Sprintf(`CREATE TENANT %q`, srcTenantName))

createInMemoryTenant(ctx, t, c, srcTenantName, srcCluster, true)

pgURL, err := copyPGCertsAndMakeURL(ctx, t, c, srcNode, srcClusterSetting.PGUrlCertsDir, addr[0])
require.NoError(t, err)
Expand All @@ -241,35 +245,13 @@ func setupC2C(
db: destDB,
nodes: dstCluster}

// Currently, a tenant has by default a 10m RU burst limit, which can be
// reached during these tests. To prevent RU limit throttling, add 10B RUs to
// the tenant.
srcTenantInfo.sql.Exec(t, `SELECT crdb_internal.update_tenant_resource_limits($1, 10000000000, 0,
10000000000, now(), 0);`, srcTenantInfo.ID)

createSystemRole(t, srcTenantInfo.name+" system tenant", srcTenantInfo.sql)
createSystemRole(t, srcTenantInfo.name+" system tenant", destTenantInfo.sql)

srcTenantDB := c.Conn(ctx, t.L(), srcNode[0], option.TenantName(srcTenantName))
srcTenantSQL := sqlutils.MakeSQLRunner(srcTenantDB)
createSystemRole(t, destTenantInfo.name+" app tenant", srcTenantSQL)
return &c2cSetup{
src: srcTenantInfo,
dst: destTenantInfo,
workloadNode: workloadNode,
metrics: c2cMetrics{}}
}

// createSystemRole creates a role that can be used to log into the cluster's db console
func createSystemRole(t test.Test, name string, sql *sqlutils.SQLRunner) {
username := "secure"
password := "roach"
sql.Exec(t, fmt.Sprintf(`CREATE ROLE %s WITH LOGIN PASSWORD '%s'`, username, password))
sql.Exec(t, fmt.Sprintf(`GRANT ADMIN TO %s`, username))
t.L().Printf(`Log into the %s db console with username "%s" and password "%s"`,
name, username, password)
}

type streamingWorkload interface {
// sourceInitCmd returns a command that will populate the src cluster with data before the
// replication stream begins
Expand Down
Loading

0 comments on commit c77104e

Please sign in to comment.