diff --git a/pkg/cmd/roachtest/tests/mixed_version_schemachange.go b/pkg/cmd/roachtest/tests/mixed_version_schemachange.go index f9697492a0b8..78ae7ed76326 100644 --- a/pkg/cmd/roachtest/tests/mixed_version_schemachange.go +++ b/pkg/cmd/roachtest/tests/mixed_version_schemachange.go @@ -64,7 +64,7 @@ func runSchemaChangeWorkloadStep(loadNode, maxOps, concurrency int) versionStep // crashes, deadlocks, etc. // TODO(spaskob): remove when https://github.com/cockroachdb/cockroach/issues/47430 // is closed. - "--tolerate-errors=true", + //"--tolerate-errors=true", fmt.Sprintf("--max-ops %d", maxOps), fmt.Sprintf("--concurrency %d", concurrency), fmt.Sprintf("{pgurl:1-%d}", u.c.Spec().NodeCount), diff --git a/pkg/workload/schemachange/operation_generator.go b/pkg/workload/schemachange/operation_generator.go index 93239f329d38..4a93a6b2d73d 100644 --- a/pkg/workload/schemachange/operation_generator.go +++ b/pkg/workload/schemachange/operation_generator.go @@ -2373,6 +2373,16 @@ func (og *operationGenerator) insertRow(ctx context.Context, tx pgx.Tx) (stmt *o if err != nil { return nil, err } + // If we aren't on 22.2 then disable the insert plugin, since 21.X + // can have queries fail due to an optimizer bug. + skipInserts, err := isClusterVersionLessThan(ctx, tx, clusterversion.ByKey(clusterversion.Start22_2)) + if err != nil { + return nil, err + } + if skipInserts { + tableExists = false + tableName.SchemaName = "InvalidObjectName" + } if !tableExists { return makeOpStmtForSingleError(OpStmtDML, fmt.Sprintf( @@ -2488,7 +2498,6 @@ func (og *operationGenerator) insertRow(ctx context.Context, tx pgx.Tx) (stmt *o for _, row := range rows { formattedRows = append(formattedRows, fmt.Sprintf("(%s)", strings.Join(row, ","))) } - stmt.sql = fmt.Sprintf( `INSERT INTO %s (%s) VALUES %s`, tableName,