Skip to content

Commit

Permalink
roachtest: update gen haproxy call
Browse files Browse the repository at this point in the history
Previously, `cockroach gen haproxy` did not support a non root user. This was
fixed recently by #131905, and the call has been update to use the standard
expanders instead of explicitly generating a postgres url.

Epic: None
Release note: None
  • Loading branch information
herkolategan committed Oct 4, 2024
1 parent ac0b244 commit c9a527f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
12 changes: 1 addition & 11 deletions pkg/cmd/roachtest/tests/sysbench.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/roachtestutil"
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/spec"
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/test"
"github.com/cockroachdb/cockroach/pkg/roachprod"
roachprodErrors "github.com/cockroachdb/cockroach/pkg/roachprod/errors"
"github.com/cockroachdb/cockroach/pkg/roachprod/install"
"github.com/cockroachdb/cockroach/pkg/util/timeutil"
Expand Down Expand Up @@ -148,16 +147,7 @@ func runSysbench(ctx context.Context, t test.Test, c cluster.Cluster, opts sysbe
if err := c.Install(ctx, t.L(), c.WorkloadNode(), "haproxy"); err != nil {
t.Fatal(err)
}
// cockroach gen haproxy does not support specifying a non root user
pgurl, err := roachprod.PgURL(ctx, t.L(), c.MakeNodes(c.Node(1)), install.CockroachNodeCertsDir, roachprod.PGURLOptions{
External: true,
Auth: install.AuthRootCert,
Secure: c.IsSecure(),
})
if err != nil {
t.Fatal(err)
}
c.Run(ctx, option.WithNodes(c.WorkloadNode()), fmt.Sprintf("./cockroach gen haproxy --url %s", pgurl[0]))
c.Run(ctx, option.WithNodes(c.WorkloadNode()), "./cockroach gen haproxy --url {pgurl:1}")
c.Run(ctx, option.WithNodes(c.WorkloadNode()), "haproxy -f haproxy.cfg -D")
}

Expand Down
12 changes: 1 addition & 11 deletions pkg/cmd/roachtest/tests/tpcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/roachtestutil/mixedversion"
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/spec"
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/test"
"github.com/cockroachdb/cockroach/pkg/roachprod"
"github.com/cockroachdb/cockroach/pkg/roachprod/install"
"github.com/cockroachdb/cockroach/pkg/roachprod/logger"
"github.com/cockroachdb/cockroach/pkg/roachprod/prometheus"
Expand Down Expand Up @@ -1560,16 +1559,7 @@ func runTPCCBench(ctx context.Context, t test.Test, c cluster.Cluster, b tpccBen
if err := c.Install(ctx, t.L(), loadNodes, "haproxy"); err != nil {
t.Fatal(err)
}
// cockroach gen haproxy does not support specifying a non root user
pgurl, err := roachprod.PgURL(ctx, t.L(), c.MakeNodes(c.Node(1)), install.CockroachNodeCertsDir, roachprod.PGURLOptions{
External: true,
Auth: install.AuthRootCert,
Secure: c.IsSecure(),
})
if err != nil {
t.Fatal(err)
}
c.Run(ctx, option.WithNodes(loadNodes), fmt.Sprintf("./cockroach gen haproxy --url %s", pgurl[0]))
c.Run(ctx, option.WithNodes(loadNodes), "./cockroach gen haproxy --url {pgurl:1}")
// Increase the maximum connection limit to ensure that no TPC-C
// load gen workers get stuck during connection initialization.
// 10k warehouses requires at least 20,000 connections, so add a
Expand Down

0 comments on commit c9a527f

Please sign in to comment.