Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
103523: kv: split out liveness persistence r=erikgrinaker a=andrewbaptist

The liveness code deals with both in-memory and persistent versions internally. This change simplifies and makes the usage of the underlying storage more consistent.

Epic: none

Release note: None

103953: changefeedccl: cleanup tempfile in test r=miretskiy a=stevendanna

It's nice to clean things up.

Epic: none

Release note: None

103965: backupccl: speed up full cluster backup/restore tests r=adityamaru,healthy-pod a=stevendanna

CREATE USER and ALTER USER create schema change jobs in order to bump the descriptor version on the users and role_options tables in order to refresh the authentication cache.

Adding these users in a single transaction means we only need to wait for 3 such jobs rather than 3000 jobs.

This is particularly useful since we occasionally observe massive slow downs in processing these jobs. While we should get to the bottom of such slow downs, let's not slow down CI.

Supersedes #81276

Epic: none

Release note: None

Co-authored-by: Andrew Baptist <[email protected]>
Co-authored-by: Steven Danna <[email protected]>
  • Loading branch information
3 people committed May 26, 2023
4 parents a6aedec + ed022f5 + 793cf83 + af6349d commit ce29f7c
Show file tree
Hide file tree
Showing 7 changed files with 317 additions and 291 deletions.
9 changes: 7 additions & 2 deletions pkg/ccl/backupccl/full_cluster_backup_restore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,14 @@ CREATE TABLE data2.foo (a int);
if util.RaceEnabled {
numUsers = 10
}

sqlDB.Exec(t, "BEGIN")
for i := 0; i < numUsers; i++ {
sqlDB.Exec(t, fmt.Sprintf("CREATE USER maxroach%d", i))
sqlDB.Exec(t, fmt.Sprintf("ALTER USER maxroach%d CREATEDB", i))
}
sqlDB.Exec(t, "COMMIT")

// Populate system.zones.
sqlDB.Exec(t, `ALTER TABLE data.bank CONFIGURE ZONE USING gc.ttlseconds = 3600`)
sqlDB.Exec(t, `ALTER TABLE defaultdb.foo CONFIGURE ZONE USING gc.ttlseconds = 45`)
Expand Down Expand Up @@ -620,10 +624,11 @@ func TestClusterRestoreFailCleanup(t *testing.T) {

// Setup the system systemTablesToVerify to ensure that they are copied to the new cluster.
// Populate system.users.
sqlDB.Exec(t, "BEGIN")
for i := 0; i < 1000; i++ {
sqlDB.Exec(t, fmt.Sprintf("CREATE USER maxroach%d", i))
}

sqlDB.Exec(t, "COMMIT")
sqlDB.Exec(t, `BACKUP TO 'nodelocal://1/missing-ssts'`)

// Bugger the backup by removing the SST files. (Note this messes up all of
Expand Down Expand Up @@ -1078,7 +1083,7 @@ func TestRestoreWithRecreatedDefaultDB(t *testing.T) {

sqlDB.Exec(t, `
DROP DATABASE defaultdb;
CREATE DATABASE defaultdb;
CREATE DATABASE defaultdb;
`)
sqlDB.Exec(t, `BACKUP TO $1`, localFoo)

Expand Down
9 changes: 9 additions & 0 deletions pkg/ccl/changefeedccl/parquet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ func TestParquetRows(t *testing.T) {
var numCols int
f, err := os.CreateTemp(os.TempDir(), fileName)
require.NoError(t, err)
defer func() {
if t.Failed() {
t.Logf("leaving %s for inspection", f.Name())
} else {
if err := os.Remove(f.Name()); err != nil {
t.Logf("could not cleanup temp file %s: %s", f.Name(), err)
}
}
}()

numRows := len(tc.inserts)
for _, insertStmt := range tc.inserts {
Expand Down
5 changes: 4 additions & 1 deletion pkg/kv/kvserver/liveness/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "liveness",
srcs = ["liveness.go"],
srcs = [
"liveness.go",
"storage.go",
],
importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/liveness",
visibility = ["//visibility:public"],
deps = [
Expand Down
Loading

0 comments on commit ce29f7c

Please sign in to comment.