Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 0 additions & 99 deletions pkg/cmd/roachtest/tests/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -767,105 +767,6 @@ func drainWithIpTables(
c.Start(ctx, t.L(), startOpts, install.MakeClusterSettings(), restartNode)
}

func registerKVSplits(r registry.Registry) {
for _, item := range []struct {
quiesce bool
splits int
leases registry.LeaseType
timeout time.Duration
envVars []string
}{
// NB: with 500000 splits, this test sometimes fails since it's pushing
// far past the number of replicas per node we support, at least if the
// ranges start to unquiesce (which can set off a cascade due to resource
// exhaustion).
{true, 200_000, registry.EpochLeases, 140 * time.Minute, nil},
// This version of the test prevents range quiescence to trigger the
// badness described above more reliably for when we wish to improve
// the performance. For now, just verify that 30k unquiesced ranges
// is tenable.
{false, 30_000, registry.EpochLeases, 2 * time.Hour, nil},
// Expiration-based leases prevent quiescence, and are also more expensive
// to keep alive. Again, just verify that 30k ranges is ok.
{false, 30_000, registry.ExpirationLeases, 2 * time.Hour, nil},
// Leader leases without quiescence perform similarly to epoch leases
// without quiescence. Even though epoch leases are set to reach 30k, they
// also reach 60k reliably.
{false, 60_000, registry.LeaderLeases, 2 * time.Hour, nil},
// Leader leases with quiescence don't quite match epoch leases with
// quiescence because in leader leases only the followers ever quiesce.
{true, 80_000, registry.LeaderLeases, 2 * time.Hour, nil},
// With some additional tuning, leader leases can do even better. The extended interval allow
// for more flexibility in extending store liveness support, and prevent support withdrawals at
// higher CPU utilization when goroutine scheduling latency is high.
{
true, 100_000, registry.LeaderLeases, 2 * time.Hour,
[]string{
"COCKROACH_STORE_LIVENESS_SUPPORT_EXPIRY_INTERVAL=1s",
"COCKROACH_STORE_LIVENESS_HEARTBEAT_INTERVAL=3s",
"COCKROACH_STORE_LIVENESS_SUPPORT_DURATION=6s",
},
},
} {
item := item // for use in closure below
name := fmt.Sprintf("kv/splits/nodes=3/quiesce=%t/lease=%s", item.quiesce, item.leases)
if item.envVars != nil {
name += "/tuned"
}
r.Add(registry.TestSpec{
Name: name,
Owner: registry.OwnerKV,
Timeout: item.timeout,
Cluster: r.MakeClusterSpec(
4,
spec.WorkloadNode(),
spec.RandomizeVolumeType(),
spec.RandomlyUseXfs(),
),
// These tests are carefully tuned to succeed up to certain number of
// splits; they are flaky in slower environments.
CompatibleClouds: registry.Clouds(spec.GCE, spec.Local),
Suites: registry.Suites(registry.Nightly),
Leases: item.leases,
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
nodes := c.Spec().NodeCount - 1

settings := install.MakeClusterSettings()
// Enable continuous Go execution tracing to aid diagnosis of
// overload-driven failures. See #166402.
settings.ClusterSettings["obs.execution_tracer.interval"] = "10s"
settings.ClusterSettings["obs.execution_tracer.duration"] = "10s"
settings.ClusterSettings["obs.execution_tracer.total_dump_size_limit"] = "10 GiB"
settings.Env = append(settings.Env, "COCKROACH_MEMPROF_INTERVAL=1m", "COCKROACH_DISABLE_QUIESCENCE="+strconv.FormatBool(!item.quiesce))
settings.Env = append(settings.Env, item.envVars...)
if !item.quiesce {
settings.ClusterSettings["kv.raft.store_liveness.quiescence.enabled"] = "false"
}
startOpts := option.NewStartOpts(option.NoBackupSchedule)
startOpts.RoachprodOpts.ExtraArgs = append(startOpts.RoachprodOpts.ExtraArgs, "--cache=256MiB")
c.Start(ctx, t.L(), startOpts, settings, c.CRDBNodes())

t.Status("running workload")
workloadCtx, workloadCancel := context.WithCancel(ctx)
m := c.NewDeprecatedMonitor(workloadCtx, c.CRDBNodes())
m.Go(func(ctx context.Context) error {
defer workloadCancel()
concurrency := roachtestutil.IfLocal(c, "", " --concurrency="+fmt.Sprint(nodes*64))
splits := " --splits=" + roachtestutil.IfLocal(c, "2000", fmt.Sprint(item.splits))
cmd := fmt.Sprintf(
"./cockroach workload run kv --init --max-ops=1"+
concurrency+splits+
" {pgurl%s}",
c.CRDBNodes())
c.Run(ctx, option.WithNodes(c.WorkloadNode()), cmd)
return nil
})
m.Wait()
},
})
}
}

func registerKVScalability(r registry.Registry) {
runScalability := func(ctx context.Context, t test.Test, c cluster.Cluster, percent int) {
nodes := len(c.CRDBNodes())
Expand Down
3 changes: 3 additions & 0 deletions pkg/cmd/roachtest/tests/perturbation/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ go_library(
"network_partition.go",
"restart_node.go",
"slow_disk.go",
"splits.go",
],
importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests/perturbation",
visibility = ["//visibility:public"],
Expand All @@ -23,6 +24,7 @@ go_library(
"//pkg/cmd/roachtest/registry",
"//pkg/cmd/roachtest/roachtestutil",
"//pkg/cmd/roachtest/roachtestutil/artifactsutil",
"//pkg/cmd/roachtest/roachtestutil/task",
"//pkg/cmd/roachtest/spec",
"//pkg/cmd/roachtest/test",
"//pkg/roachprod/install",
Expand All @@ -34,6 +36,7 @@ go_library(
"//pkg/workload/cli",
"//pkg/workload/histogram",
"@com_github_cockroachdb_errors//:errors",
"@com_github_lib_pq//:pq",
"@com_github_stretchr_testify//require",
],
)
Loading
Loading