Skip to content

Commit

Permalink
Merge #55082 #55263
Browse files Browse the repository at this point in the history
55082: roachtest: update expected Django fails; fix SQLAlchemy setup r=arulajmani a=rafiss

fixes #55015
fixes #54933
fixes #54929
fixes #54917
fixes #54096

Release note: None

55263: roachtest: revive tpcc/mixed-headroom/n5cpu16 r=nvanbenschoten a=nvanbenschoten

### roachtest: run tpcc import on node with cockroach instance

Fixes #55241.
Fixes #55242.

This ensures that the workload version matches the gateway version in a mixed version cluster.

### roachtest: bump tpcc/mixed-headroom/n5cpu16 min version

Fixes #55023.

Co-authored-by: Rafi Shamim <[email protected]>
Co-authored-by: Nathan VanBenschoten <[email protected]>
  • Loading branch information
3 people committed Oct 7, 2020
3 parents 04bfabb + 6a40f4a + 1235b15 commit f37518b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 49 deletions.
4 changes: 3 additions & 1 deletion pkg/cmd/roachtest/django_blocklist.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ var djangoBlocklists = blocklistsForVersion{
// Maintain that this list is alphabetized.
var djangoBlocklist20_2 = blocklist{}

var djangoBlocklist20_1 = blocklist{}
var djangoBlocklist20_1 = blocklist{
"inspectdb.tests.InspectDBTestCase.test_json_field": "unknown",
}

var djangoIgnoreList20_2 = djangoIgnoreList20_1

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/roachtest/sqlalchemy.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func runSQLAlchemy(ctx context.Context, t *test, c *cluster) {
}

if err := repeatRunE(ctx, c, node, "install pytest", `
sudo pip3 install --upgrade --force-reinstall setuptools pytest pytest-xdist psycopg2
sudo pip3 install --upgrade --force-reinstall setuptools pytest==6.0.1 pytest-xdist psycopg2
`); err != nil {
t.Fatal(err)
}
Expand Down
65 changes: 20 additions & 45 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 @@ -222,11 +226,9 @@ func registerTPCC(r *testRegistry) {
// w=headroom runs tpcc for a semi-extended period with some amount of
// headroom, more closely mirroring a real production deployment than
// running with the max supported warehouses.
Name: "tpcc/headroom/" + headroomSpec.String(),
Owner: OwnerKV,
// TODO(dan): Backfill tpccSupportedWarehouses and remove this "v2.1.0"
// minimum on gce.
MinVersion: maxVersion("v2.1.0", maybeMinVersionForFixturesImport(cloud)),
Name: "tpcc/headroom/" + headroomSpec.String(),
Owner: OwnerKV,
MinVersion: "v19.1.0",
Tags: []string{`default`, `release_qualification`},
Cluster: headroomSpec,
Run: func(ctx context.Context, t *test, c *cluster) {
Expand All @@ -247,11 +249,9 @@ func registerTPCC(r *testRegistry) {
// mixed-headroom is similar to w=headroom, but with an additional node
// and on a mixed version cluster. It simulates a real production
// deployment in the middle of the migration into a new cluster version.
Name: "tpcc/mixed-headroom/" + mixedHeadroomSpec.String(),
Owner: OwnerKV,
// TODO(dan): Backfill tpccSupportedWarehouses and remove this "v2.1.0"
// minimum on gce.
MinVersion: maxVersion("v2.1.0", maybeMinVersionForFixturesImport(cloud)),
Name: "tpcc/mixed-headroom/" + mixedHeadroomSpec.String(),
Owner: OwnerKV,
MinVersion: "v19.1.0",
// TODO(tbg): add release_qualification tag once we know the test isn't
// buggy.
Tags: []string{`default`},
Expand Down Expand Up @@ -280,7 +280,7 @@ func registerTPCC(r *testRegistry) {
r.Add(testSpec{
Name: "tpcc-nowait/nodes=3/w=1",
Owner: OwnerKV,
MinVersion: maybeMinVersionForFixturesImport(cloud),
MinVersion: "v19.1.0",
Cluster: makeClusterSpec(4, cpu(16)),
Run: func(ctx context.Context, t *test, c *cluster) {
runTPCC(ctx, t, c, tpccOptions{
Expand All @@ -294,7 +294,7 @@ func registerTPCC(r *testRegistry) {
r.Add(testSpec{
Name: "weekly/tpcc/headroom",
Owner: OwnerKV,
MinVersion: maybeMinVersionForFixturesImport(cloud),
MinVersion: "v19.1.0",
Tags: []string{`weekly`},
Cluster: makeClusterSpec(4, cpu(16)),
Timeout: time.Duration(6*24)*time.Hour + time.Duration(10)*time.Minute,
Expand All @@ -311,8 +311,8 @@ func registerTPCC(r *testRegistry) {
r.Add(testSpec{
Name: "tpcc/w=100/nodes=3/chaos=true",
Owner: OwnerKV,
MinVersion: "v19.1.0",
Cluster: makeClusterSpec(4),
MinVersion: maybeMinVersionForFixturesImport(cloud),
Run: func(ctx context.Context, t *test, c *cluster) {
duration := 30 * time.Minute
runTPCC(ctx, t, c, tpccOptions{
Expand All @@ -339,8 +339,8 @@ func registerTPCC(r *testRegistry) {
r.Add(testSpec{
Name: "tpcc/interleaved/nodes=3/cpu=16/w=500",
Owner: OwnerSQLExec,
Cluster: makeClusterSpec(4, cpu(16)),
MinVersion: "v20.1.0",
Cluster: makeClusterSpec(4, cpu(16)),
Timeout: 6 * time.Hour,
Run: func(ctx context.Context, t *test, c *cluster) {
skip.WithIssue(t, 53886)
Expand Down Expand Up @@ -413,38 +413,13 @@ func registerTPCC(r *testRegistry) {
})
}

func maxVersion(vers ...string) string {
var max *version.Version
for _, v := range vers {
v, err := version.Parse(v)
if err != nil {
continue
}
if max == nil || v.AtLeast(max) {
max = v
}
}
if max == nil {
return ""
}
return max.String()
}

func gceOrAws(cloud string, gce, aws int) int {
if cloud == "aws" {
return aws
}
return gce
}

func maybeMinVersionForFixturesImport(cloud string) string {
const minVersionForFixturesImport = "v19.1.0"
if cloud == "aws" {
return minVersionForFixturesImport
}
return ""
}

// tpccBenchDistribution represents a distribution of nodes in a tpccbench
// cluster.
type tpccBenchDistribution int
Expand Down Expand Up @@ -588,7 +563,7 @@ func registerTPCCBenchSpec(r *testRegistry, b tpccBenchSpec) {

minVersion := b.MinVersion
if minVersion == "" {
minVersion = maybeMinVersionForFixturesImport(cloud)
minVersion = "v19.1.0" // needed for import
}

r.Add(testSpec{
Expand Down Expand Up @@ -665,7 +640,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
4 changes: 2 additions & 2 deletions pkg/cmd/roachtest/tpchbench.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type tpchBenchSpec struct {
url string
numRunsPerQuery int
// minVersion specifies the minimum version of CRDB nodes. If omitted, it
// will default to maybeMinVersionForFixturesImport.
// will default to v19.1.0.
minVersion string
// maxLatency is the expected maximum time that a query will take to execute
// needed to correctly initialize histograms.
Expand Down Expand Up @@ -159,7 +159,7 @@ func registerTPCHBenchSpec(r *testRegistry, b tpchBenchSpec) {
numNodes := b.Nodes + 1
minVersion := b.minVersion
if minVersion == `` {
minVersion = maybeMinVersionForFixturesImport(cloud)
minVersion = "v19.1.0" // needed for import
}

r.Add(testSpec{
Expand Down

0 comments on commit f37518b

Please sign in to comment.