Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roachtest: use 'fixtures import' from 'cockroach workload' #38022

Merged
merged 1 commit into from
Jun 5, 2019
Merged
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
19 changes: 13 additions & 6 deletions pkg/cmd/roachtest/tpcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ type tpccOptions struct {
// specified warehouse count into a cluster using either `fixtures import`
// or `fixtures load` depending on the cloud.
func tpccFixturesCmd(t *test, cloud string, warehouses int, extraArgs string) string {
var action string
var command string
switch cloud {
case "gce":
// TODO(nvanbenschoten): We could switch to import for both clouds.
// At the moment, import is still a little unstable and load is still
// marginally faster.
action = "load"
command = "./workload fixtures load"
fixtureWarehouses := -1
for _, w := range []int{1, 10, 100, 1000, 2000, 5000, 10000} {
if w >= warehouses {
Expand All @@ -79,12 +79,14 @@ func tpccFixturesCmd(t *test, cloud string, warehouses int, extraArgs string) st
}
warehouses = fixtureWarehouses
case "aws":
action = "import"
// For fixtures import, use the version built into the cockroach binary
// so the tpcc workload-versions match on release branches.
command = "./cockroach workload fixtures import"
default:
t.Fatalf("unknown cloud: %q", cloud)
}
return fmt.Sprintf("./workload fixtures %s tpcc --warehouses=%d %s {pgurl:1}",
action, warehouses, extraArgs)
return fmt.Sprintf("%s tpcc --warehouses=%d %s {pgurl:1}",
command, warehouses, extraArgs)
}

func runTPCC(ctx context.Context, t *test, c *cluster, opts tpccOptions) {
Expand Down Expand Up @@ -125,6 +127,8 @@ func runTPCC(ctx context.Context, t *test, c *cluster, opts tpccOptions) {
c.Put(ctx, cockroach, "./cockroach", regularNodes...)
}

// Fixture import needs ./cockroach workload on workloadNode.
c.Put(ctx, cockroach, "./cockroach", workloadNode)
c.Put(ctx, workload, "./workload", workloadNode)

t.Status("loading fixture")
Expand Down Expand Up @@ -668,6 +672,10 @@ func runTPCCBench(ctx context.Context, t *test, c *cluster, b tpccBenchSpec) {
roachNodes := loadGroups.roachNodes()
loadNodes := loadGroups.loadNodes()
c.Put(ctx, cockroach, "./cockroach", roachNodes)
// Fixture import needs ./cockroach workload on loadNodes[0],
// and if we use haproxy (see below) we need it on the others
// as well.
c.Put(ctx, cockroach, "./cockroach", loadNodes)
c.Put(ctx, workload, "./workload", loadNodes)
c.Start(ctx, t, append(b.startOpts(), roachNodes)...)

Expand All @@ -678,7 +686,6 @@ func runTPCCBench(ctx context.Context, t *test, c *cluster, b tpccBenchSpec) {
}
t.Status("installing haproxy")
c.Install(ctx, loadNodes, "haproxy")
c.Put(ctx, cockroach, "./cockroach", loadNodes)
c.Run(ctx, loadNodes, "./cockroach gen haproxy --insecure --url {pgurl:1}")
c.Run(ctx, loadNodes, "haproxy -f haproxy.cfg -D")
}
Expand Down