Skip to content

Commit

Permalink
[release-17.0] Fix upgrade tests (#14143)
Browse files Browse the repository at this point in the history
  • Loading branch information
frouioui authored Oct 2, 2023
1 parent 52c20e1 commit 492ce55
Show file tree
Hide file tree
Showing 21 changed files with 74 additions and 28 deletions.
1 change: 0 additions & 1 deletion examples/common/scripts/vttablet-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ vttablet \
--grpc_port $grpc_port \
--service_map 'grpc-queryservice,grpc-tabletmanager,grpc-updatestream' \
--pid_file $VTDATAROOT/$tablet_dir/vttablet.pid \
--vtctld_addr http://$hostname:$vtctld_web_port/ \
--heartbeat_enable --heartbeat_interval=250ms --heartbeat_on_demand_duration=5s \
> $VTDATAROOT/$tablet_dir/vttablet.out 2>&1 &

Expand Down
1 change: 0 additions & 1 deletion examples/compose/vttablet-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ exec $VTROOT/bin/vttablet \
--port $web_port \
--grpc_port $grpc_port \
--service_map 'grpc-queryservice,grpc-tabletmanager,grpc-updatestream' \
--vtctld_addr "http://vtctld:$WEB_PORT/" \
--init_keyspace $keyspace \
--init_shard $shard \
--backup_storage_implementation file \
Expand Down
2 changes: 0 additions & 2 deletions go/test/endtoend/cluster/vttablet_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ func (vttablet *VttabletProcess) Setup() (err error) {
"--backup_storage_implementation", vttablet.BackupStorageImplementation,
"--file_backup_storage_root", vttablet.FileBackupStorageRoot,
"--service_map", vttablet.ServiceMap,
"--vtctld_addr", vttablet.VtctldAddress,
"--vtctld_addr", vttablet.VtctldAddress,
"--vreplication_tablet_type", vttablet.VreplicationTabletType,
"--db_charset", vttablet.Charset,
)
Expand Down
5 changes: 4 additions & 1 deletion go/test/endtoend/onlineddl/revert/onlineddl_revert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"time"

"vitess.io/vitess/go/mysql"
"vitess.io/vitess/go/test/endtoend/utils"
"vitess.io/vitess/go/vt/log"
"vitess.io/vitess/go/vt/schema"

Expand Down Expand Up @@ -154,9 +155,11 @@ func TestMain(m *testing.M) {
"--heartbeat_interval", "250ms",
"--heartbeat_on_demand_duration", "5s",
"--migration_check_interval", "5s",
"--queryserver-config-schema-change-signal-interval", "0.1",
"--watch_replication_stream",
}
if !utils.BinaryIsAtVersion(17, "vttablet") {
clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--queryserver-config-schema-change-signal-interval", "0.1")
}
clusterInstance.VtGateExtraArgs = []string{
"--ddl_strategy", "online",
}
Expand Down
16 changes: 11 additions & 5 deletions go/test/endtoend/reparent/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"vitess.io/vitess/go/test/endtoend/utils"

querypb "vitess.io/vitess/go/vt/proto/query"
"vitess.io/vitess/go/vt/vttablet/tabletconn"

Expand Down Expand Up @@ -63,7 +65,7 @@ var (
replicationWaitTimeout = time.Duration(15 * time.Second)
)

//region cluster setup/teardown
// region cluster setup/teardown

// SetupReparentCluster is used to setup the reparent cluster
func SetupReparentCluster(t *testing.T, durability string) *cluster.LocalProcessCluster {
Expand Down Expand Up @@ -138,18 +140,22 @@ func setupCluster(ctx context.Context, t *testing.T, shardName string, cells []s
// If the initSchema acquires the lock, then it takes about 30 seconds for it to run during which time the
// DemotePrimary rpc is stalled!
"--queryserver_enable_online_ddl=false",
)

if !utils.BinaryIsAtVersion(17, "vttablet") {
// disabling active reparents on the tablet since we don't want the replication manager
// to fix replication if it is stopped. Some tests deliberately do that. Also, we don't want
// the replication manager to silently fix the replication in case ERS or PRS mess up. All the
// tests in this test suite should work irrespective of this flag. Each run of ERS, PRS should be
// setting up the replication correctly.
"--disable-replication-manager")
clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--disable-replication-manager")
}

// Initialize Cluster
err = clusterInstance.SetupCluster(keyspace, []cluster.Shard{*shard})
require.NoError(t, err, "Cannot launch cluster")

//Start MySql
// Start MySql
var mysqlCtlProcessList []*exec.Cmd
for _, shard := range clusterInstance.Keyspaces[0].Shards {
for _, tablet := range shard.Vttablets {
Expand Down Expand Up @@ -252,7 +258,7 @@ func StartNewVTTablet(t *testing.T, clusterInstance *cluster.LocalProcessCluster
return tablet
}

//endregion
// endregion

// region database queries
func getMysqlConnParam(tablet *cluster.Vttablet) mysql.ConnParams {
Expand Down Expand Up @@ -280,7 +286,7 @@ func execute(t *testing.T, conn *mysql.Conn, query string) *sqltypes.Result {
return qr
}

//endregion
// endregion

// region ers, prs

Expand Down
5 changes: 4 additions & 1 deletion go/test/endtoend/utils/mysqlvsvitess/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ func TestMain(m *testing.M) {
VSchema: vschema,
}
clusterInstance.VtGateExtraArgs = []string{"--schema_change_signal"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal", "--queryserver-config-schema-change-signal-interval", "0.1"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal"}
if !utils.BinaryIsAtVersion(17, "vttablet") {
clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--queryserver-config-schema-change-signal-interval", "0.1")
}
err = clusterInstance.StartKeyspace(*keyspace, []string{"-80", "80-"}, 0, false)
if err != nil {
return 1
Expand Down
5 changes: 4 additions & 1 deletion go/test/endtoend/vtgate/gen4/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ func TestMain(m *testing.M) {
}

clusterInstance.VtGateExtraArgs = []string{"--schema_change_signal"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal", "--queryserver-config-schema-change-signal-interval", "0.1"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal"}
if !utils.BinaryIsAtVersion(17, "vttablet") {
clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--queryserver-config-schema-change-signal-interval", "0.1")
}
err = clusterInstance.StartKeyspace(*sKs, shardedKsShards, 0, false)
if err != nil {
return 1
Expand Down
5 changes: 4 additions & 1 deletion go/test/endtoend/vtgate/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ func TestMain(m *testing.M) {
VSchema: VSchema,
}
clusterInstance.VtGateExtraArgs = []string{"--schema_change_signal"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal", "--queryserver-config-schema-change-signal-interval", "0.1", "--queryserver-config-max-result-size", "100", "--queryserver-config-terse-errors"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal", "--queryserver-config-max-result-size", "100", "--queryserver-config-terse-errors"}
if !utils.BinaryIsAtVersion(17, "vttablet") {
clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--queryserver-config-schema-change-signal-interval", "0.1")
}
err = clusterInstance.StartKeyspace(*keyspace, []string{"-80", "80-"}, 0, false)
if err != nil {
return 1
Expand Down
5 changes: 4 additions & 1 deletion go/test/endtoend/vtgate/queries/aggregation/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ func TestMain(m *testing.M) {
VSchema: vschema,
}
clusterInstance.VtGateExtraArgs = []string{"--schema_change_signal"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal", "--queryserver-config-schema-change-signal-interval", "0.1"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal"}
if !utils.BinaryIsAtVersion(17, "vttablet") {
clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--queryserver-config-schema-change-signal-interval", "0.1")
}
err = clusterInstance.StartKeyspace(*keyspace, []string{"-80", "80-"}, 0, false)
if err != nil {
return 1
Expand Down
5 changes: 4 additions & 1 deletion go/test/endtoend/vtgate/queries/foundrows/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ func TestMain(m *testing.M) {
VSchema: vschema,
}
clusterInstance.VtGateExtraArgs = []string{"--schema_change_signal"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal", "--queryserver-config-schema-change-signal-interval", "0.1"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal"}
if !utils.BinaryIsAtVersion(17, "vttablet") {
clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--queryserver-config-schema-change-signal-interval", "0.1")
}
err = clusterInstance.StartKeyspace(*keyspace, []string{"-80", "80-"}, 0, false)
if err != nil {
return 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ func TestMain(m *testing.M) {
VSchema: vschema,
}
clusterInstance.VtGateExtraArgs = []string{"--schema_change_signal"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal", "--queryserver-config-schema-change-signal-interval", "0.1"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal"}
if !utils.BinaryIsAtVersion(17, "vttablet") {
clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--queryserver-config-schema-change-signal-interval", "0.1")
}
err = clusterInstance.StartKeyspace(*keyspace, []string{"-80", "80-"}, 0, false)
if err != nil {
return 1
Expand Down
5 changes: 4 additions & 1 deletion go/test/endtoend/vtgate/queries/lookup_queries/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ func TestMain(m *testing.M) {
VSchema: shardedVSchema,
}

clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal-interval", "0.1"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal"}
if !utils.BinaryIsAtVersion(17, "vttablet") {
clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--queryserver-config-schema-change-signal-interval", "0.1")
}
err = clusterInstance.StartKeyspace(*sKs, shardedKsShards, 0, false)
if err != nil {
return 1
Expand Down
5 changes: 4 additions & 1 deletion go/test/endtoend/vtgate/queries/orderby/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ func TestMain(m *testing.M) {
VSchema: vschema,
}
clusterInstance.VtGateExtraArgs = []string{"--schema_change_signal"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal", "--queryserver-config-schema-change-signal-interval", "0.1"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal"}
if !utils.BinaryIsAtVersion(17, "vttablet") {
clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--queryserver-config-schema-change-signal-interval", "0.1")
}
err = clusterInstance.StartKeyspace(*keyspace, []string{"-80", "80-"}, 0, false)
if err != nil {
return 1
Expand Down
5 changes: 4 additions & 1 deletion go/test/endtoend/vtgate/queries/subquery/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ func TestMain(m *testing.M) {
VSchema: VSchema,
}
clusterInstance.VtGateExtraArgs = []string{"--schema_change_signal"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal", "--queryserver-config-schema-change-signal-interval", "0.1"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal"}
if !utils.BinaryIsAtVersion(17, "vttablet") {
clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--queryserver-config-schema-change-signal-interval", "0.1")
}
err = clusterInstance.StartKeyspace(*keyspace, []string{"-80", "80-"}, 0, false)
if err != nil {
return 1
Expand Down
5 changes: 4 additions & 1 deletion go/test/endtoend/vtgate/queries/union/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ func TestMain(m *testing.M) {
VSchema: vschema,
}
clusterInstance.VtGateExtraArgs = []string{"--schema_change_signal"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal", "--queryserver-config-schema-change-signal-interval", "0.1"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal"}
if !utils.BinaryIsAtVersion(17, "vttablet") {
clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--queryserver-config-schema-change-signal-interval", "0.1")
}
err = clusterInstance.StartKeyspace(*keyspace, []string{"-80", "80-"}, 0, false)
if err != nil {
return 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ func TestMain(m *testing.M) {

// restart the tablet so that the schema.Engine gets a chance to start with existing schema
tablet := clusterInstance.Keyspaces[0].Shards[0].PrimaryTablet()
tablet.VttabletProcess.ExtraArgs = []string{
"--queryserver-config-schema-change-signal",
fmt.Sprintf("--queryserver-config-schema-change-signal-interval=%d", signalInterval),
tablet.VttabletProcess.ExtraArgs = []string{"--queryserver-config-schema-change-signal"}
if !utils.BinaryIsAtVersion(17, "vttablet") {
tablet.VttabletProcess.ExtraArgs = append(tablet.VttabletProcess.ExtraArgs, fmt.Sprintf("--queryserver-config-schema-change-signal-interval=%d", signalInterval))
}
if err := tablet.RestartOnlyTablet(); err != nil {
return 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,13 @@ func TestMain(m *testing.M) {
"--schema_change_signal_user", "userData1"}
clusterInstance.VtGatePlannerVersion = planbuilder.Gen4
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal",
"--queryserver-config-schema-change-signal-interval", "0.1",
"--queryserver-config-strict-table-acl",
"--queryserver-config-acl-exempt-acl", "userData1",
"--table-acl-config", "dummy.json"}

if vttabletVer <= 16 {
clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--queryserver-config-schema-change-signal-interval", "0.1")
}
if vtgateVer >= 16 && vttabletVer >= 16 {
clusterInstance.VtGateExtraArgs = append(clusterInstance.VtGateExtraArgs, "--enable-views")
clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--queryserver-enable-views")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ func TestMain(m *testing.M) {
}

clusterInstance.VtGateExtraArgs = []string{"--schema_change_signal", "--schema_change_signal_user", "userData1"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal", "--queryserver-config-schema-change-signal-interval", "5", "--queryserver-config-strict-table-acl", "--queryserver-config-acl-exempt-acl", "userData1", "--table-acl-config", "dummy.json"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal", "--queryserver-config-strict-table-acl", "--queryserver-config-acl-exempt-acl", "userData1", "--table-acl-config", "dummy.json"}
if !utils.BinaryIsAtVersion(17, "vttablet") {
clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--queryserver-config-schema-change-signal-interval", "5")
}

// Start topo server
err = clusterInstance.StartTopo()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import (

"github.com/stretchr/testify/require"

"vitess.io/vitess/go/test/endtoend/utils"

"vitess.io/vitess/go/mysql"
"vitess.io/vitess/go/test/endtoend/cluster"
)
Expand Down Expand Up @@ -69,10 +71,12 @@ func TestMain(m *testing.M) {
clusterInstance.VtGateExtraArgs = append(clusterInstance.VtGateExtraArgs, "--schema_change_signal")
clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs,
"--queryserver-config-schema-change-signal",
"--queryserver-config-schema-change-signal-interval", "0.1",
"--queryserver-config-strict-table-acl",
"--queryserver-config-acl-exempt-acl", "userData1",
"--table-acl-config", "dummy.json")
if !utils.BinaryIsAtVersion(17, "vttablet") {
clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--queryserver-config-schema-change-signal-interval", "0.1")
}
err = clusterInstance.StartKeyspace(*keyspace, []string{"-80", "80-"}, 0, false)
if err != nil {
return 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ func TestMain(m *testing.M) {
SchemaSQL: sqlSchema,
SidecarDBName: sidecarDBName,
}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal", "--queryserver-config-schema-change-signal-interval", "0.1"}
clusterInstance.VtTabletExtraArgs = []string{"--queryserver-config-schema-change-signal"}
if !utils.BinaryIsAtVersion(17, "vttablet") {
clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--queryserver-config-schema-change-signal-interval", "0.1")
}
err = clusterInstance.StartUnshardedKeyspace(*keyspace, 0, false)
if err != nil {
return 1
Expand Down
1 change: 0 additions & 1 deletion vitess-mixin/e2e/vttablet-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ exec $VTROOT/bin/vttablet \
--port $web_port \
--grpc_port $grpc_port \
--service_map 'grpc-queryservice,grpc-tabletmanager,grpc-updatestream' \
--vtctld_addr "http://vtctld:$WEB_PORT/" \
--init_keyspace $keyspace \
--init_shard $shard \
--backup_storage_implementation file \
Expand Down

0 comments on commit 492ce55

Please sign in to comment.