Skip to content

Commit 2a335a2

Browse files
committed
roachtest: add read committed variants of ycsb
Closes cockroachdb#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
1 parent 062f970 commit 2a335a2

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

pkg/cmd/roachtest/tests/ycsb.go

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const envYCSBFlags = "ROACHTEST_YCSB_FLAGS"
2929
func registerYCSB(r registry.Registry) {
3030
workloads := []string{"A", "B", "C", "D", "E", "F"}
3131
cpusConfigs := []int{8, 32}
32+
cpusWithReadCommitted := 32
3233
cpusWithGlobalMVCCRangeTombstone := 32
3334

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

4748
runYCSB := func(
48-
ctx context.Context, t test.Test, c cluster.Cluster, wl string, cpus int, rangeTombstone bool,
49+
ctx context.Context, t test.Test, c cluster.Cluster, wl string, cpus int, readCommitted, rangeTombstone bool,
4950
) {
5051
// For now, we only want to run the zfs tests on GCE, since only GCE supports
5152
// starting roachprod instances on zfs.
@@ -75,9 +76,11 @@ func registerYCSB(r registry.Registry) {
7576
m := c.NewMonitor(ctx, c.Range(1, nodes))
7677
m.Go(func(ctx context.Context) error {
7778
var args string
78-
args += fmt.Sprintf(" --select-for-update=%t", t.IsBuildVersion("v19.2.0"))
7979
args += " --ramp=" + ifLocal(c, "0s", "2m")
8080
args += " --duration=" + ifLocal(c, "10s", "30m")
81+
if readCommitted {
82+
args += " --isolation-level=read_committed"
83+
}
8184
if envFlags := os.Getenv(envYCSBFlags); envFlags != "" {
8285
args += " " + envFlags
8386
}
@@ -107,7 +110,7 @@ func registerYCSB(r registry.Registry) {
107110
Benchmark: true,
108111
Cluster: r.MakeClusterSpec(4, spec.CPU(cpus)),
109112
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
110-
runYCSB(ctx, t, c, wl, cpus, false /* rangeTombstone */)
113+
runYCSB(ctx, t, c, wl, cpus, false /* readCommitted */, false /* rangeTombstone */)
111114
},
112115
Tags: registry.Tags(`aws`),
113116
})
@@ -119,19 +122,32 @@ func registerYCSB(r registry.Registry) {
119122
Benchmark: true,
120123
Cluster: r.MakeClusterSpec(4, spec.CPU(cpus), spec.SetFileSystem(spec.Zfs)),
121124
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
122-
runYCSB(ctx, t, c, wl, cpus, false /* rangeTombstone */)
125+
runYCSB(ctx, t, c, wl, cpus, false /* readCommitted */, false /* rangeTombstone */)
123126
},
124127
})
125128
}
126129

130+
if cpus == cpusWithReadCommitted {
131+
r.Add(registry.TestSpec{
132+
Name: fmt.Sprintf("%s/isolation-level=read-committed", name),
133+
Owner: registry.OwnerTestEng,
134+
Benchmark: true,
135+
Cluster: r.MakeClusterSpec(4, spec.CPU(cpus)),
136+
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
137+
runYCSB(ctx, t, c, wl, cpus, true /* readCommitted */, false /* rangeTombstone */)
138+
},
139+
Tags: registry.Tags(`aws`),
140+
})
141+
}
142+
127143
if cpus == cpusWithGlobalMVCCRangeTombstone {
128144
r.Add(registry.TestSpec{
129145
Name: fmt.Sprintf("%s/mvcc-range-keys=global", name),
130146
Owner: registry.OwnerTestEng,
131147
Benchmark: true,
132148
Cluster: r.MakeClusterSpec(4, spec.CPU(cpus)),
133149
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
134-
runYCSB(ctx, t, c, wl, cpus, true /* rangeTombstone */)
150+
runYCSB(ctx, t, c, wl, cpus, false /* readCommitted */, true /* rangeTombstone */)
135151
},
136152
Tags: registry.Tags(`aws`),
137153
})

0 commit comments

Comments
 (0)