Skip to content

Commit

Permalink
roachtest: add read committed variants of ycsb
Browse files Browse the repository at this point in the history
Closes #107112.

This commit adds the following six roachtest variants:
```
ycsb/A/nodes=3/cpu=32/isolation-level=read-committed
ycsb/B/nodes=3/cpu=32/isolation-level=read-committed
ycsb/C/nodes=3/cpu=32/isolation-level=read-committed
ycsb/D/nodes=3/cpu=32/isolation-level=read-committed
ycsb/E/nodes=3/cpu=32/isolation-level=read-committed
ycsb/F/nodes=3/cpu=32/isolation-level=read-committed
```

Release note: None
  • Loading branch information
nvanbenschoten committed Jul 26, 2023
1 parent 062f970 commit 2a335a2
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions pkg/cmd/roachtest/tests/ycsb.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const envYCSBFlags = "ROACHTEST_YCSB_FLAGS"
func registerYCSB(r registry.Registry) {
workloads := []string{"A", "B", "C", "D", "E", "F"}
cpusConfigs := []int{8, 32}
cpusWithReadCommitted := 32
cpusWithGlobalMVCCRangeTombstone := 32

// concurrencyConfigs contains near-optimal concurrency levels for each
Expand All @@ -45,7 +46,7 @@ func registerYCSB(r registry.Registry) {
}

runYCSB := func(
ctx context.Context, t test.Test, c cluster.Cluster, wl string, cpus int, rangeTombstone bool,
ctx context.Context, t test.Test, c cluster.Cluster, wl string, cpus int, readCommitted, rangeTombstone bool,
) {
// For now, we only want to run the zfs tests on GCE, since only GCE supports
// starting roachprod instances on zfs.
Expand Down Expand Up @@ -75,9 +76,11 @@ func registerYCSB(r registry.Registry) {
m := c.NewMonitor(ctx, c.Range(1, nodes))
m.Go(func(ctx context.Context) error {
var args string
args += fmt.Sprintf(" --select-for-update=%t", t.IsBuildVersion("v19.2.0"))
args += " --ramp=" + ifLocal(c, "0s", "2m")
args += " --duration=" + ifLocal(c, "10s", "30m")
if readCommitted {
args += " --isolation-level=read_committed"
}
if envFlags := os.Getenv(envYCSBFlags); envFlags != "" {
args += " " + envFlags
}
Expand Down Expand Up @@ -107,7 +110,7 @@ func registerYCSB(r registry.Registry) {
Benchmark: true,
Cluster: r.MakeClusterSpec(4, spec.CPU(cpus)),
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
runYCSB(ctx, t, c, wl, cpus, false /* rangeTombstone */)
runYCSB(ctx, t, c, wl, cpus, false /* readCommitted */, false /* rangeTombstone */)
},
Tags: registry.Tags(`aws`),
})
Expand All @@ -119,19 +122,32 @@ func registerYCSB(r registry.Registry) {
Benchmark: true,
Cluster: r.MakeClusterSpec(4, spec.CPU(cpus), spec.SetFileSystem(spec.Zfs)),
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
runYCSB(ctx, t, c, wl, cpus, false /* rangeTombstone */)
runYCSB(ctx, t, c, wl, cpus, false /* readCommitted */, false /* rangeTombstone */)
},
})
}

if cpus == cpusWithReadCommitted {
r.Add(registry.TestSpec{
Name: fmt.Sprintf("%s/isolation-level=read-committed", name),
Owner: registry.OwnerTestEng,
Benchmark: true,
Cluster: r.MakeClusterSpec(4, spec.CPU(cpus)),
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
runYCSB(ctx, t, c, wl, cpus, true /* readCommitted */, false /* rangeTombstone */)
},
Tags: registry.Tags(`aws`),
})
}

if cpus == cpusWithGlobalMVCCRangeTombstone {
r.Add(registry.TestSpec{
Name: fmt.Sprintf("%s/mvcc-range-keys=global", name),
Owner: registry.OwnerTestEng,
Benchmark: true,
Cluster: r.MakeClusterSpec(4, spec.CPU(cpus)),
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
runYCSB(ctx, t, c, wl, cpus, true /* rangeTombstone */)
runYCSB(ctx, t, c, wl, cpus, false /* readCommitted */, true /* rangeTombstone */)
},
Tags: registry.Tags(`aws`),
})
Expand Down

0 comments on commit 2a335a2

Please sign in to comment.