Skip to content

Commit

Permalink
roachtest: run tpcc import on node with cockroach instance
Browse files Browse the repository at this point in the history
Fixes #55241.
Fixes #55242.

This ensures that the workload version matches the gateway version in a
mixed version cluster.
  • Loading branch information
nvanbenschoten authored and jayshrivastava committed Oct 8, 2020
1 parent c462bb1 commit 4629ae9
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pkg/cmd/roachtest/tpcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,14 @@ type tpccOptions struct {

// tpccImportCmd generates the command string to load tpcc data for the
// specified warehouse count into a cluster.
//
// The command uses `cockroach workload` instead of `workload` so the tpcc
// workload-versions match on release branches. Similarly, the command does not
// specify pgurl to ensure that it is run on a node with a running cockroach
// instance to ensure that the workload version matches the gateway version in a
// mixed version cluster.
func tpccImportCmd(t *test, warehouses int, extraArgs string) string {
// Use `cockroach workload` instead of `workload` so the tpcc
// workload-versions match on release branches.
return fmt.Sprintf("./cockroach workload fixtures import tpcc --warehouses=%d %s {pgurl:1}",
return fmt.Sprintf("./cockroach workload fixtures import tpcc --warehouses=%d %s",
warehouses, extraArgs)
}

Expand Down Expand Up @@ -121,7 +125,7 @@ func setupTPCC(
switch opts.SetupType {
case usingImport:
t.Status("loading fixture")
c.Run(ctx, workloadNode, tpccImportCmd(t, opts.Warehouses, opts.ExtraSetupArgs))
c.Run(ctx, crdbNodes[:1], tpccImportCmd(t, opts.Warehouses, opts.ExtraSetupArgs))
case usingInit:
t.Status("initializing tables")
extraArgs := opts.ExtraSetupArgs
Expand Down Expand Up @@ -665,7 +669,7 @@ func loadTPCCBench(
t.l.Printf("restoring tpcc fixture\n")
waitForFullReplication(t, db)
cmd := tpccImportCmd(t, b.LoadWarehouses, loadArgs)
if err := c.RunE(ctx, loadNode, cmd); err != nil {
if err := c.RunE(ctx, roachNodes[:1], cmd); err != nil {
return err
}
if rebalanceWait == 0 || len(roachNodes) <= 3 {
Expand Down

0 comments on commit 4629ae9

Please sign in to comment.