From d759ab7d9517723ce948d45b2622df807867b14e Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 13 Jul 2022 15:18:24 -0400 Subject: [PATCH 01/25] Add support for MySQL 8.0 in backup tests Signed-off-by: Matt Lord --- .../backup/mysqlctld/backup_mysqlctld_test.go | 2 +- .../backup/vtctlbackup/backup_test.go | 2 +- .../backup/vtctlbackup/backup_utils.go | 266 +++++++----------- 3 files changed, 103 insertions(+), 167 deletions(-) diff --git a/go/test/endtoend/backup/mysqlctld/backup_mysqlctld_test.go b/go/test/endtoend/backup/mysqlctld/backup_mysqlctld_test.go index 177c1a8b8ff..dabec5d6355 100644 --- a/go/test/endtoend/backup/mysqlctld/backup_mysqlctld_test.go +++ b/go/test/endtoend/backup/mysqlctld/backup_mysqlctld_test.go @@ -26,7 +26,7 @@ import ( // TestBackupMysqlctld - tests the backup using mysqlctld. func TestBackupMysqlctld(t *testing.T) { - backup.TestBackup(t, backup.Mysqlctld, "", 0, nil, nil) + backup.TestBackup(t, backup.Mysqlctld, "xbstream", 0, nil, nil) } func TestBackupMysqlctldWithlz4Compression(t *testing.T) { diff --git a/go/test/endtoend/backup/vtctlbackup/backup_test.go b/go/test/endtoend/backup/vtctlbackup/backup_test.go index 00e51c435e6..7362a318139 100644 --- a/go/test/endtoend/backup/vtctlbackup/backup_test.go +++ b/go/test/endtoend/backup/vtctlbackup/backup_test.go @@ -24,7 +24,7 @@ import ( // TestBackupMain - main tests backup using vtctl commands func TestBackupMain(t *testing.T) { - TestBackup(t, Backup, "", 0, nil, nil) + TestBackup(t, Backup, "xbstream", 0, nil, nil) } func TestBackupMainWithZstdCompression(t *testing.T) { diff --git a/go/test/endtoend/backup/vtctlbackup/backup_utils.go b/go/test/endtoend/backup/vtctlbackup/backup_utils.go index 19c73659d5f..2bc04f87959 100644 --- a/go/test/endtoend/backup/vtctlbackup/backup_utils.go +++ b/go/test/endtoend/backup/vtctlbackup/backup_utils.go @@ -1,12 +1,9 @@ /* Copyright 2019 The Vitess Authors. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -45,6 +42,8 @@ const ( XtraBackup = iota Backup Mysqlctld + useXBStream = "--xtrabackup_stream_mode=xbstream" + useTar = "--xtrabackup_stream_mode=tar" ) var ( @@ -52,17 +51,15 @@ var ( replica1 *cluster.Vttablet replica2 *cluster.Vttablet localCluster *cluster.LocalProcessCluster - newInitDBFile string useXtrabackup bool cell = cluster.DefaultCell hostname = "localhost" keyspaceName = "ks" - dbPassword = "VtDbaPass" + dbPassword = "" shardKsName = fmt.Sprintf("%s/%s", keyspaceName, shardName) - dbCredentialFile string shardName = "0" - commonTabletArg = []string{ + commonTabletArgs = []string{ "--vreplication_healthcheck_topology_refresh", "1s", "--vreplication_healthcheck_retry_delay", "1s", "--vreplication_retry_delay", "1s", @@ -90,40 +87,15 @@ type CompressionDetails struct { } // LaunchCluster : starts the cluster as per given params. -func LaunchCluster(setupType int, streamMode string, stripes int, cDetails *CompressionDetails) (int, error) { +func LaunchCluster(t *testing.T, setupType int, streamMode string, stripes int, cDetails *CompressionDetails) { localCluster = cluster.NewCluster(cell, hostname) // Start topo server err := localCluster.StartTopo() - if err != nil { - return 1, err - } - - // Start keyspace - localCluster.Keyspaces = []cluster.Keyspace{ - { - Name: keyspaceName, - Shards: []cluster.Shard{ - { - Name: shardName, - }, - }, - }, - } - shard := &localCluster.Keyspaces[0].Shards[0] - - dbCredentialFile = cluster.WriteDbCredentialToTmp(localCluster.TmpDirectory) - initDb, _ := os.ReadFile(path.Join(os.Getenv("VTROOT"), "/config/init_db.sql")) - sql := string(initDb) - newInitDBFile = path.Join(localCluster.TmpDirectory, "init_db_with_passwords.sql") - sql = sql + cluster.GetPasswordUpdateSQL(localCluster) - err = os.WriteFile(newInitDBFile, []byte(sql), 0666) - if err != nil { - return 1, err - } + require.NoError(t, err) - extraArgs := []string{"--db-credentials-file", dbCredentialFile} - commonTabletArg = append(commonTabletArg, "--db-credentials-file", dbCredentialFile) + keyspace := cluster.Keyspace{Name: keyspaceName} + shards := []string{shardName} // Update arguments for xtrabackup if setupType == XtraBackup { @@ -131,7 +103,6 @@ func LaunchCluster(setupType int, streamMode string, stripes int, cDetails *Comp xtrabackupArgs := []string{ "--backup_engine_implementation", "xtrabackup", - fmt.Sprintf("--xtrabackup_stream_mode=%s", streamMode), "--xtrabackup_user=vt_dba", fmt.Sprintf("--xtrabackup_stripes=%d", stripes), "--xtrabackup_backup_flags", fmt.Sprintf("--password=%s", dbPassword), @@ -139,84 +110,31 @@ func LaunchCluster(setupType int, streamMode string, stripes int, cDetails *Comp // if streamMode is xbstream, add some additional args to test other xtrabackup flags if streamMode == "xbstream" { - xtrabackupArgs = append(xtrabackupArgs, "--xtrabackup_prepare_flags", fmt.Sprintf("--use-memory=100M")) //nolint - } - - commonTabletArg = append(commonTabletArg, xtrabackupArgs...) - } - - commonTabletArg = append(commonTabletArg, getCompressorArgs(cDetails)...) - - var mysqlProcs []*exec.Cmd - for i := 0; i < 3; i++ { - tabletType := "replica" - if i == 0 { - tabletType = "primary" - } - tablet := localCluster.NewVttabletInstance(tabletType, 0, cell) - tablet.VttabletProcess = localCluster.VtprocessInstanceFromVttablet(tablet, shard.Name, keyspaceName) - tablet.VttabletProcess.DbPassword = dbPassword - tablet.VttabletProcess.ExtraArgs = commonTabletArg - tablet.VttabletProcess.SupportsBackup = true - tablet.VttabletProcess.EnableSemiSync = true - - if setupType == Mysqlctld { - tablet.MysqlctldProcess = *cluster.MysqlCtldProcessInstance(tablet.TabletUID, tablet.MySQLPort, localCluster.TmpDirectory) - tablet.MysqlctldProcess.InitDBFile = newInitDBFile - tablet.MysqlctldProcess.ExtraArgs = extraArgs - tablet.MysqlctldProcess.Password = tablet.VttabletProcess.DbPassword - if err := tablet.MysqlctldProcess.Start(); err != nil { - return 1, err - } - shard.Vttablets = append(shard.Vttablets, tablet) - continue - } - - tablet.MysqlctlProcess = *cluster.MysqlCtlProcessInstance(tablet.TabletUID, tablet.MySQLPort, localCluster.TmpDirectory) - tablet.MysqlctlProcess.InitDBFile = newInitDBFile - tablet.MysqlctlProcess.ExtraArgs = extraArgs - proc, err := tablet.MysqlctlProcess.StartProcess() - if err != nil { - return 1, err + xtrabackupArgs = append(xtrabackupArgs, + useXBStream, + "--xtrabackup_prepare_flags", + "--use-memory=100M", + ) + localCluster.VtTabletExtraArgs = append(localCluster.VtTabletExtraArgs, useXBStream) + localCluster.VtctldExtraArgs = append(localCluster.VtctldExtraArgs, useXBStream) + } else { + xtrabackupArgs = append(xtrabackupArgs, useTar) } - mysqlProcs = append(mysqlProcs, proc) - shard.Vttablets = append(shard.Vttablets, tablet) - } - for _, proc := range mysqlProcs { - if err := proc.Wait(); err != nil { - return 1, err - } + localCluster.VtTabletExtraArgs = append(localCluster.VtTabletExtraArgs, xtrabackupArgs...) } - primary = shard.Vttablets[0] - replica1 = shard.Vttablets[1] - replica2 = shard.Vttablets[2] - if err := localCluster.VtctlclientProcess.InitTablet(primary, cell, keyspaceName, hostname, shard.Name); err != nil { - return 1, err - } - if err := localCluster.VtctlclientProcess.InitTablet(replica1, cell, keyspaceName, hostname, shard.Name); err != nil { - return 1, err - } - vtctldClientProcess := cluster.VtctldClientProcessInstance("localhost", localCluster.VtctldProcess.GrpcPort, localCluster.TmpDirectory) - _, err = vtctldClientProcess.ExecuteCommandWithOutput("SetKeyspaceDurabilityPolicy", keyspaceName, "--durability-policy=semi_sync") - if err != nil { - return 1, err - } + localCluster.VtTabletExtraArgs = append(localCluster.VtTabletExtraArgs, commonTabletArgs...) + localCluster.VtTabletExtraArgs = append(localCluster.VtTabletExtraArgs, getCompressorArgs(cDetails)...) - for _, tablet := range []cluster.Vttablet{*primary, *replica1} { - if err := tablet.VttabletProcess.CreateDB(keyspaceName); err != nil { - return 1, err - } - if err := tablet.VttabletProcess.Setup(); err != nil { - return 1, err - } - } + localCluster.StartKeyspace(keyspace, shards, 2, false) + require.NoError(t, err) + localCluster.VtgateProcess.WaitForStatusOfTabletInShard("primary", 1) + localCluster.VtgateProcess.WaitForStatusOfTabletInShard("replica", 2) - if err := localCluster.VtctlclientProcess.InitShardPrimary(keyspaceName, shard.Name, cell, primary.TabletUID); err != nil { - return 1, err - } - return 0, nil + primary = localCluster.Keyspaces[0].Shards[0].Vttablets[0] + replica1 = localCluster.Keyspaces[0].Shards[0].Vttablets[1] + replica2 = localCluster.Keyspaces[0].Shards[0].Vttablets[2] } func getCompressorArgs(cDetails *CompressionDetails) []string { @@ -253,6 +171,24 @@ func TearDownCluster() { // TestBackup runs all the backup tests func TestBackup(t *testing.T, setupType int, streamMode string, stripes int, cDetails *CompressionDetails, runSpecific []string) error { + verStr, err := mysqlctl.GetVersionString() + require.NoError(t, err) + _, vers, err := mysqlctl.ParseVersionString(verStr) + require.NoError(t, err) + switch streamMode { + case "xbstream": + if vers.Major < 8 { + t.Logf("Skipping streaming xtrabackup tests as those are only tested on MySQL 8.0+") + return nil + } + case "tar": + if vers.Major > 5 { + t.Logf("Skipping tar based xtrabackup tests as those are no longer supported on MySQL 8.0+") + return nil + } + default: + require.FailNow(t, fmt.Sprintf("Unsupported xtrabackup stream mode: %s", streamMode)) + } testMethods := []struct { name string @@ -294,8 +230,7 @@ func TestBackup(t *testing.T, setupType int, streamMode string, stripes int, cDe defer cluster.PanicHandler(t) // setup cluster for the testing - code, err := LaunchCluster(setupType, streamMode, stripes, cDetails) - require.Nilf(t, err, "setup failed with status code %d", code) + LaunchCluster(t, setupType, streamMode, stripes, cDetails) // Teardown the cluster defer TearDownCluster() @@ -349,7 +284,7 @@ func primaryBackup(t *testing.T) { localCluster.VerifyBackupCount(t, shardKsName, 0) err = localCluster.VtctlclientProcess.ExecuteCommand("Backup", "--", "--allow_primary=true", primary.Alias) - require.Nil(t, err) + require.NoError(t, err) // We'll restore this on the primary later to test restores using a backup timestamp firstBackupTimestamp := time.Now().UTC().Format(mysqlctl.BackupTimestampFormat) @@ -358,11 +293,11 @@ func primaryBackup(t *testing.T) { assert.Contains(t, backups[0], primary.Alias) _, err = primary.VttabletProcess.QueryTablet("insert into vt_insert_test (msg) values ('test2')", keyspaceName, true) - require.Nil(t, err) + require.NoError(t, err) restoreWaitForBackup(t, "replica") err = replica2.VttabletProcess.WaitForTabletStatusesForTimeout([]string{"SERVING"}, 25*time.Second) - require.Nil(t, err) + require.NoError(t, err) // Verify that we have all the new data -- we should have 2 records now... // And only 1 record after we restore using the first backup timestamp @@ -370,7 +305,7 @@ func primaryBackup(t *testing.T) { cluster.VerifyLocalMetadata(t, replica2, keyspaceName, shardName, cell) err = localCluster.VtctlclientProcess.ExecuteCommand("Backup", "--", "--allow_primary=true", primary.Alias) - require.Nil(t, err) + require.NoError(t, err) backups = localCluster.VerifyBackupCount(t, shardKsName, 2) assert.Contains(t, backups[1], primary.Alias) @@ -380,32 +315,32 @@ func primaryBackup(t *testing.T) { err = localCluster.VtctlclientProcess.ExecuteCommand("PlannedReparentShard", "--", "--keyspace_shard", shardKsName, "--new_primary", replica2.Alias) - require.Nil(t, err) + require.NoError(t, err) // Delete the current primary tablet (replica2) so that the original primary tablet (primary) can be restored from the // older/first backup w/o it replicating the subsequent insert done after the first backup was taken err = localCluster.VtctlclientProcess.ExecuteCommand("DeleteTablet", "--", "--allow_primary=true", replica2.Alias) - require.Nil(t, err) + require.NoError(t, err) err = replica2.VttabletProcess.TearDown() - require.Nil(t, err) + require.NoError(t, err) // Restore the older/first backup -- using the timestamp we saved -- on the original primary tablet (primary) err = localCluster.VtctlclientProcess.ExecuteCommand("RestoreFromBackup", "--", "--backup_timestamp", firstBackupTimestamp, primary.Alias) - require.Nil(t, err) + require.NoError(t, err) // Re-init the shard -- making the original primary tablet (primary) primary again -- for subsequent tests err = localCluster.VtctlclientProcess.InitShardPrimary(keyspaceName, shardName, cell, primary.TabletUID) - require.Nil(t, err) + require.NoError(t, err) // Verify that we don't have the record created after the older/first backup cluster.VerifyRowsInTablet(t, primary, keyspaceName, 1) cluster.VerifyLocalMetadata(t, primary, keyspaceName, shardName, cell) verifyAfterRemovingBackupNoBackupShouldBePresent(t, backups) - require.Nil(t, err) + require.NoError(t, err) _, err = primary.VttabletProcess.QueryTablet("DROP TABLE vt_insert_test", keyspaceName, true) - require.Nil(t, err) + require.NoError(t, err) } // Test a primary and replica from the same backup. @@ -418,16 +353,16 @@ func primaryReplicaSameBackup(t *testing.T) { // backup the replica err := localCluster.VtctlclientProcess.ExecuteCommand("Backup", replica1.Alias) - require.Nil(t, err) + require.NoError(t, err) // insert more data on the primary _, err = primary.VttabletProcess.QueryTablet("insert into vt_insert_test (msg) values ('test2')", keyspaceName, true) - require.Nil(t, err) + require.NoError(t, err) // now bring up the other replica, letting it restore from backup. restoreWaitForBackup(t, "replica") err = replica2.VttabletProcess.WaitForTabletStatusesForTimeout([]string{"SERVING"}, 25*time.Second) - require.Nil(t, err) + require.NoError(t, err) // check the new replica has the data cluster.VerifyRowsInTablet(t, replica2, keyspaceName, 2) @@ -436,11 +371,11 @@ func primaryReplicaSameBackup(t *testing.T) { err = localCluster.VtctlclientProcess.ExecuteCommand("PlannedReparentShard", "--", "--keyspace_shard", shardKsName, "--new_primary", replica2.Alias) - require.Nil(t, err) + require.NoError(t, err) // insert more data on replica2 (current primary) _, err = replica2.VttabletProcess.QueryTablet("insert into vt_insert_test (msg) values ('test3')", keyspaceName, true) - require.Nil(t, err) + require.NoError(t, err) // Force replica1 to restore from backup. verifyRestoreTablet(t, replica1, "SERVING") @@ -454,18 +389,18 @@ func primaryReplicaSameBackup(t *testing.T) { // // Take another backup on the replica. err = localCluster.VtctlclientProcess.ExecuteCommand("Backup", replica1.Alias) - require.Nil(t, err) + require.NoError(t, err) // Insert more data on replica2 (current primary). _, err = replica2.VttabletProcess.QueryTablet("insert into vt_insert_test (msg) values ('test4')", keyspaceName, true) - require.Nil(t, err) + require.NoError(t, err) // Force replica1 to restore from backup. verifyRestoreTablet(t, replica1, "SERVING") cluster.VerifyRowsInTablet(t, replica1, keyspaceName, 4) err = replica2.VttabletProcess.TearDown() - require.Nil(t, err) + require.NoError(t, err) restartPrimaryAndReplica(t) } @@ -498,21 +433,21 @@ func testRestoreOldPrimary(t *testing.T, method restoreMethod) { // backup the replica err := localCluster.VtctlclientProcess.ExecuteCommand("Backup", replica1.Alias) - require.Nil(t, err) + require.NoError(t, err) // insert more data on the primary _, err = primary.VttabletProcess.QueryTablet("insert into vt_insert_test (msg) values ('test2')", keyspaceName, true) - require.Nil(t, err) + require.NoError(t, err) // reparent to replica1 err = localCluster.VtctlclientProcess.ExecuteCommand("PlannedReparentShard", "--", "--keyspace_shard", shardKsName, "--new_primary", replica1.Alias) - require.Nil(t, err) + require.NoError(t, err) // insert more data to new primary _, err = replica1.VttabletProcess.QueryTablet("insert into vt_insert_test (msg) values ('test3')", keyspaceName, true) - require.Nil(t, err) + require.NoError(t, err) // force the old primary to restore at the latest backup. method(t, primary) @@ -526,13 +461,13 @@ func testRestoreOldPrimary(t *testing.T, method restoreMethod) { func restoreUsingRestart(t *testing.T, tablet *cluster.Vttablet) { err := tablet.VttabletProcess.TearDown() - require.Nil(t, err) + require.NoError(t, err) verifyRestoreTablet(t, tablet, "SERVING") } func restoreInPlace(t *testing.T, tablet *cluster.Vttablet) { err := localCluster.VtctlclientProcess.ExecuteCommand("RestoreFromBackup", tablet.Alias) - require.Nil(t, err) + require.NoError(t, err) } func restartPrimaryAndReplica(t *testing.T) { @@ -546,7 +481,7 @@ func restartPrimaryAndReplica(t *testing.T) { for _, tablet := range []*cluster.Vttablet{primary, replica1, replica2} { if tablet.MysqlctldProcess.TabletUID > 0 { err := tablet.MysqlctldProcess.Start() - require.Nilf(t, err, "error while starting mysqlctld, tabletUID %v", tablet.TabletUID) + require.NoErrorf(t, err, "error while starting mysqlctld, tabletUID %v", tablet.TabletUID) continue } proc, _ := tablet.MysqlctlProcess.StartProcess() @@ -557,14 +492,14 @@ func restartPrimaryAndReplica(t *testing.T) { } for _, tablet := range []*cluster.Vttablet{primary, replica1} { err := localCluster.VtctlclientProcess.InitTablet(tablet, cell, keyspaceName, hostname, shardName) - require.Nil(t, err) + require.NoError(t, err) err = tablet.VttabletProcess.CreateDB(keyspaceName) - require.Nil(t, err) + require.NoError(t, err) err = tablet.VttabletProcess.Setup() - require.Nil(t, err) + require.NoError(t, err) } err := localCluster.VtctlclientProcess.InitShardPrimary(keyspaceName, shardName, cell, primary.TabletUID) - require.Nil(t, err) + require.NoError(t, err) } func stopAllTablets() { @@ -599,33 +534,33 @@ func terminatedRestore(t *testing.T) { // backup the replica err := localCluster.VtctlclientProcess.ExecuteCommand("Backup", replica1.Alias) - require.Nil(t, err) + require.NoError(t, err) // insert more data on the primary _, err = primary.VttabletProcess.QueryTablet("insert into vt_insert_test (msg) values ('test2')", keyspaceName, true) - require.Nil(t, err) + require.NoError(t, err) // reparent to replica1 err = localCluster.VtctlclientProcess.ExecuteCommand("PlannedReparentShard", "--", "--keyspace_shard", shardKsName, "--new_primary", replica1.Alias) - require.Nil(t, err) + require.NoError(t, err) // insert more data to new primary _, err = replica1.VttabletProcess.QueryTablet("insert into vt_insert_test (msg) values ('test3')", keyspaceName, true) - require.Nil(t, err) + require.NoError(t, err) terminateRestore(t) err = localCluster.VtctlclientProcess.ExecuteCommand("RestoreFromBackup", primary.Alias) - require.Nil(t, err) + require.NoError(t, err) output, err := localCluster.VtctlclientProcess.ExecuteCommandWithOutput("GetTablet", primary.Alias) - require.Nil(t, err) + require.NoError(t, err) var tabletPB topodata.Tablet err = json.Unmarshal([]byte(output), &tabletPB) - require.Nil(t, err) + require.NoError(t, err) assert.Equal(t, tabletPB.Type, topodata.TabletType_REPLICA) _, err = os.Stat(path.Join(primary.VttabletProcess.Directory, "restore_in_progress")) @@ -651,40 +586,42 @@ func terminatedRestore(t *testing.T) { // // func vtctlBackup(t *testing.T, tabletType string) { + // we always use replica2, reset its state when we're done + replica2.Type = tabletType restoreWaitForBackup(t, tabletType) verifyInitialReplication(t) err := localCluster.VtctlclientProcess.ExecuteCommand("Backup", replica1.Alias) - require.Nil(t, err) + require.NoError(t, err) backups := localCluster.VerifyBackupCount(t, shardKsName, 1) _, err = primary.VttabletProcess.QueryTablet("insert into vt_insert_test (msg) values ('test2')", keyspaceName, true) - require.Nil(t, err) + require.NoError(t, err) err = replica2.VttabletProcess.WaitForTabletStatusesForTimeout([]string{"SERVING"}, 25*time.Second) - require.Nil(t, err) + require.NoError(t, err) cluster.VerifyRowsInTablet(t, replica2, keyspaceName, 2) cluster.VerifyLocalMetadata(t, replica2, keyspaceName, shardName, cell) verifyAfterRemovingBackupNoBackupShouldBePresent(t, backups) err = replica2.VttabletProcess.TearDown() - require.Nil(t, err) + require.NoError(t, err) err = localCluster.VtctlclientProcess.ExecuteCommand("DeleteTablet", replica2.Alias) - require.Nil(t, err) + require.NoError(t, err) _, err = primary.VttabletProcess.QueryTablet("DROP TABLE vt_insert_test", keyspaceName, true) - require.Nil(t, err) + require.NoError(t, err) } // This will create schema in primary, insert some data to primary and verify the same data in replica func verifyInitialReplication(t *testing.T) { _, err := primary.VttabletProcess.QueryTablet(vtInsertTest, keyspaceName, true) - require.Nil(t, err) + require.NoError(t, err) _, err = primary.VttabletProcess.QueryTablet("insert into vt_insert_test (msg) values ('test1')", keyspaceName, true) - require.Nil(t, err) + require.NoError(t, err) cluster.VerifyRowsInTablet(t, replica1, keyspaceName, 1) } @@ -697,21 +634,21 @@ func verifyInitialReplication(t *testing.T) { func restoreWaitForBackup(t *testing.T, tabletType string) { replica2.Type = tabletType replica2.ValidateTabletRestart(t) - replicaTabletArgs := commonTabletArg + replicaTabletArgs := commonTabletArgs replicaTabletArgs = append(replicaTabletArgs, "--backup_engine_implementation", "fake_implementation") replicaTabletArgs = append(replicaTabletArgs, "--wait_for_backup_interval", "1s") replicaTabletArgs = append(replicaTabletArgs, "--init_tablet_type", tabletType) replica2.VttabletProcess.ExtraArgs = replicaTabletArgs replica2.VttabletProcess.ServingStatus = "" err := replica2.VttabletProcess.Setup() - require.Nil(t, err) + require.NoError(t, err) } func verifyAfterRemovingBackupNoBackupShouldBePresent(t *testing.T, backups []string) { // Remove the backup for _, backup := range backups { err := localCluster.VtctlclientProcess.ExecuteCommand("RemoveBackup", shardKsName, backup) - require.Nil(t, err) + require.NoError(t, err) } // Now, there should not be no backup @@ -719,14 +656,13 @@ func verifyAfterRemovingBackupNoBackupShouldBePresent(t *testing.T, backups []st } func verifyRestoreTablet(t *testing.T, tablet *cluster.Vttablet, status string) { - tablet.ValidateTabletRestart(t) tablet.VttabletProcess.ServingStatus = "" err := tablet.VttabletProcess.Setup() - require.Nil(t, err) + require.NoError(t, err) if status != "" { err = tablet.VttabletProcess.WaitForTabletStatusesForTimeout([]string{status}, 25*time.Second) - require.Nil(t, err) + require.NoError(t, err) } // We restart replication here because semi-sync will not be set correctly on tablet startup since // we deprecated enable_semi_sync. StartReplication RPC fixes the semi-sync settings by consulting the @@ -745,10 +681,10 @@ func verifyRestoreTablet(t *testing.T, tablet *cluster.Vttablet, status string) func verifySemiSyncStatus(t *testing.T, vttablet *cluster.Vttablet, expectedStatus string) { status, err := vttablet.VttabletProcess.GetDBVar("rpl_semi_sync_slave_enabled", keyspaceName) - require.Nil(t, err) + require.NoError(t, err) assert.Equal(t, status, expectedStatus) status, err = vttablet.VttabletProcess.GetDBStatus("rpl_semi_sync_slave_status", keyspaceName) - require.Nil(t, err) + require.NoError(t, err) assert.Equal(t, status, expectedStatus) } @@ -767,7 +703,7 @@ func terminateRestore(t *testing.T) { reader, _ := tmpProcess.StderrPipe() err := tmpProcess.Start() - require.Nil(t, err) + require.NoError(t, err) found := false scanner := bufio.NewScanner(reader) From e9fa25bf9a259b845085b028456eac52a2885d46 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 13 Jul 2022 15:20:44 -0400 Subject: [PATCH 02/25] Add 8.0 workflow Signed-off-by: Matt Lord --- .../cluster_endtoend_xb_backup_mysql80.yml | 121 ++++++++++++++++++ test/ci_workflow_gen.go | 2 + .../cluster_endtoend_test_mysql80.tpl | 2 +- 3 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/cluster_endtoend_xb_backup_mysql80.yml diff --git a/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml b/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml new file mode 100644 index 00000000000..f99be39465f --- /dev/null +++ b/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml @@ -0,0 +1,121 @@ +# DO NOT MODIFY: THIS FILE IS GENERATED USING "make generate_ci_workflows" + +name: Cluster (xb_backup) mysql80 +on: [push, pull_request] +concurrency: + group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (xb_backup) mysql80') + cancel-in-progress: true + +env: + LAUNCHABLE_ORGANIZATION: "vitess" + LAUNCHABLE_WORKSPACE: "vitess-app" + GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}" + +jobs: + build: + name: Run endtoend tests on Cluster (xb_backup) mysql80 + runs-on: ubuntu-20.04 + + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Check for changes in relevant files + uses: frouioui/paths-filter@main + id: changes + with: + token: '' + filters: | + end_to_end: + - 'go/**/*.go' + - 'test.go' + - 'Makefile' + - 'build.env' + - 'go.[sumod]' + - 'proto/*.proto' + - 'tools/**' + - 'config/**' + - 'bootstrap.sh' + - '.github/workflows/**' + + - name: Set up Go + if: steps.changes.outputs.end_to_end == 'true' + uses: actions/setup-go@v2 + with: + go-version: 1.18.3 + + - name: Set up python + if: steps.changes.outputs.end_to_end == 'true' + uses: actions/setup-python@v2 + + - name: Tune the OS + if: steps.changes.outputs.end_to_end == 'true' + run: | + echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range + # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio + echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf + sudo sysctl -p /etc/sysctl.conf + + - name: Get dependencies + if: steps.changes.outputs.end_to_end == 'true' + run: | + # Get key to latest MySQL repo + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + + # Setup MySQL 8.0 + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* + sudo apt-get update + + # Install everything else we need, and configure + sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils + sudo service mysql stop + sudo service etcd stop + sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ + sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld + go mod download + + # install JUnit report formatter + go install github.com/jstemmer/go-junit-report@latest + + wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb + sudo apt-get install -y gnupg2 + sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb + sudo apt-get update + sudo apt-get install percona-xtrabackup-80 + + - name: Setup launchable dependencies + if: steps.changes.outputs.end_to_end == 'true' + run: | + # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up + pip3 install --user launchable~=1.0 > /dev/null + + # verify that launchable setup is all correct. + launchable verify || true + + # Tell Launchable about the build you are producing and testing + launchable record build --name "$GITHUB_RUN_ID" --source . + + - name: Run cluster endtoend test + if: steps.changes.outputs.end_to_end == 'true' + timeout-minutes: 30 + run: | + # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file + # which musn't be more than 107 characters long. + export VTDATAROOT="/tmp/" + source build.env + + set -x + + # run the tests however you normally do, then produce a JUnit XML file + eatmydata -- go run test.go -docker=false -follow -shard xb_backup | tee -a output.txt | go-junit-report -set-exit-code > report.xml + + - name: Print test output and Record test result in launchable + if: steps.changes.outputs.end_to_end == 'true' && always() + run: | + # send recorded tests to launchable + launchable record tests --build "$GITHUB_RUN_ID" go-test . || true + + # print test output + cat output.txt diff --git a/test/ci_workflow_gen.go b/test/ci_workflow_gen.go index 92f81ded214..a58e645ea12 100644 --- a/test/ci_workflow_gen.go +++ b/test/ci_workflow_gen.go @@ -177,6 +177,8 @@ func clusterMySQLVersions(clusterName string) mysqlVersions { return []mysqlVersion{mysql80} case clusterName == "vreplication_across_db_versions": return []mysqlVersion{mysql80} + case clusterName == "xb_backup": + return allMySQLVersions default: return defaultMySQLVersions } diff --git a/test/templates/cluster_endtoend_test_mysql80.tpl b/test/templates/cluster_endtoend_test_mysql80.tpl index e4033240409..2c7d5d38d22 100644 --- a/test/templates/cluster_endtoend_test_mysql80.tpl +++ b/test/templates/cluster_endtoend_test_mysql80.tpl @@ -83,7 +83,7 @@ jobs: sudo apt-get install -y gnupg2 sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb sudo apt-get update - sudo apt-get install percona-xtrabackup-24 + sudo apt-get install percona-xtrabackup-80 {{end}} From e88c8b72f7e5ee75ec442859e6182ec384fe8423 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 13 Jul 2022 15:24:32 -0400 Subject: [PATCH 03/25] whitespace Signed-off-by: Matt Lord --- test/ci_workflow_gen.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ci_workflow_gen.go b/test/ci_workflow_gen.go index a58e645ea12..9c44d20b54a 100644 --- a/test/ci_workflow_gen.go +++ b/test/ci_workflow_gen.go @@ -178,7 +178,7 @@ func clusterMySQLVersions(clusterName string) mysqlVersions { case clusterName == "vreplication_across_db_versions": return []mysqlVersion{mysql80} case clusterName == "xb_backup": - return allMySQLVersions + return allMySQLVersions default: return defaultMySQLVersions } From 90ca126093d064b33437948387f03694919a3b97 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 13 Jul 2022 18:25:54 -0400 Subject: [PATCH 04/25] Use vtctldclient SetKeyspaceDurabilityPolicy to manage semi-sync This needed to be done after the shard was setup in order to satisfy the semantic assumptions related to semi-sync in the tests. Signed-off-by: Matt Lord --- go/test/endtoend/backup/vtctlbackup/backup_utils.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/go/test/endtoend/backup/vtctlbackup/backup_utils.go b/go/test/endtoend/backup/vtctlbackup/backup_utils.go index 2bc04f87959..7b84fc4cd06 100644 --- a/go/test/endtoend/backup/vtctlbackup/backup_utils.go +++ b/go/test/endtoend/backup/vtctlbackup/backup_utils.go @@ -67,6 +67,8 @@ var ( "--lock_tables_timeout", "5s", "--watch_replication_stream", "--enable_replication_reporter", + "--enable_semi_sync", + "--restore_from_backup", "--serving_state_grace_period", "1s", } @@ -89,14 +91,13 @@ type CompressionDetails struct { // LaunchCluster : starts the cluster as per given params. func LaunchCluster(t *testing.T, setupType int, streamMode string, stripes int, cDetails *CompressionDetails) { localCluster = cluster.NewCluster(cell, hostname) + keyspace := cluster.Keyspace{Name: keyspaceName} + shards := []string{shardName} // Start topo server err := localCluster.StartTopo() require.NoError(t, err) - keyspace := cluster.Keyspace{Name: keyspaceName} - shards := []string{shardName} - // Update arguments for xtrabackup if setupType == XtraBackup { useXtrabackup = true @@ -132,6 +133,10 @@ func LaunchCluster(t *testing.T, setupType int, streamMode string, stripes int, localCluster.VtgateProcess.WaitForStatusOfTabletInShard("primary", 1) localCluster.VtgateProcess.WaitForStatusOfTabletInShard("replica", 2) + vtctldClientProcess := cluster.VtctldClientProcessInstance("localhost", localCluster.VtctldProcess.GrpcPort, localCluster.TmpDirectory) + _, err = vtctldClientProcess.ExecuteCommandWithOutput("SetKeyspaceDurabilityPolicy", keyspaceName, "--durability-policy=semi_sync") + require.NoError(t, err) + primary = localCluster.Keyspaces[0].Shards[0].Vttablets[0] replica1 = localCluster.Keyspaces[0].Shards[0].Vttablets[1] replica2 = localCluster.Keyspaces[0].Shards[0].Vttablets[2] From d808cd24e54b0ff9629f1a68cf94baf7a95081bf Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 13 Jul 2022 18:40:18 -0400 Subject: [PATCH 05/25] Remove extraneous changes Signed-off-by: Matt Lord --- go/test/endtoend/backup/vtctlbackup/backup_utils.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/go/test/endtoend/backup/vtctlbackup/backup_utils.go b/go/test/endtoend/backup/vtctlbackup/backup_utils.go index 7b84fc4cd06..5ae26e6033a 100644 --- a/go/test/endtoend/backup/vtctlbackup/backup_utils.go +++ b/go/test/endtoend/backup/vtctlbackup/backup_utils.go @@ -591,8 +591,6 @@ func terminatedRestore(t *testing.T) { // // func vtctlBackup(t *testing.T, tabletType string) { - // we always use replica2, reset its state when we're done - replica2.Type = tabletType restoreWaitForBackup(t, tabletType) verifyInitialReplication(t) From 64e0c068505bb22d1d6b48704407ec781d41560f Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 13 Jul 2022 19:08:14 -0400 Subject: [PATCH 06/25] We need lz4 for TestXtrabackupStreamWithlz4Compression Signed-off-by: Matt Lord --- .github/workflows/cluster_endtoend_xb_backup_mysql80.yml | 2 +- test/templates/cluster_endtoend_test_mysql80.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml b/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml index f99be39465f..862036f3f62 100644 --- a/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml +++ b/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml @@ -83,7 +83,7 @@ jobs: sudo apt-get install -y gnupg2 sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb sudo apt-get update - sudo apt-get install percona-xtrabackup-80 + sudo apt-get install percona-xtrabackup-80 lz4 - name: Setup launchable dependencies if: steps.changes.outputs.end_to_end == 'true' diff --git a/test/templates/cluster_endtoend_test_mysql80.tpl b/test/templates/cluster_endtoend_test_mysql80.tpl index 2c7d5d38d22..8b045fe1029 100644 --- a/test/templates/cluster_endtoend_test_mysql80.tpl +++ b/test/templates/cluster_endtoend_test_mysql80.tpl @@ -83,7 +83,7 @@ jobs: sudo apt-get install -y gnupg2 sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb sudo apt-get update - sudo apt-get install percona-xtrabackup-80 + sudo apt-get install percona-xtrabackup-80 lz4 {{end}} From 21829803843c5005d764e01989086ccee2cb4d69 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 13 Jul 2022 20:19:23 -0400 Subject: [PATCH 07/25] Try using Percona Repo for MySQL 8 to align mysqld and xtrabackup versions Signed-off-by: Matt Lord --- .../cluster_endtoend_xb_backup_mysql80.yml | 21 +++++++------------ .../cluster_endtoend_test_mysql80.tpl | 21 +++++++------------ 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml b/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml index 862036f3f62..a4fee7119a1 100644 --- a/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml +++ b/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml @@ -59,17 +59,16 @@ jobs: - name: Get dependencies if: steps.changes.outputs.end_to_end == 'true' run: | - # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - - # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb - echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections - sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* + # Setup Percona Server for MySQL 8.0 + sudo apt-get update + sudo apt-get install -y lsb-release gnupg2 curl + wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb + sudo percona-release setup ps80 sudo apt-get update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils + sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils sudo service mysql stop sudo service etcd stop sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ @@ -79,11 +78,7 @@ jobs: # install JUnit report formatter go install github.com/jstemmer/go-junit-report@latest - wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb - sudo apt-get install -y gnupg2 - sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb - sudo apt-get update - sudo apt-get install percona-xtrabackup-80 lz4 + sudo apt-get install percona-server-server percona-xtrabackup-80 lz4 - name: Setup launchable dependencies if: steps.changes.outputs.end_to_end == 'true' diff --git a/test/templates/cluster_endtoend_test_mysql80.tpl b/test/templates/cluster_endtoend_test_mysql80.tpl index 8b045fe1029..0391269af07 100644 --- a/test/templates/cluster_endtoend_test_mysql80.tpl +++ b/test/templates/cluster_endtoend_test_mysql80.tpl @@ -57,17 +57,16 @@ jobs: - name: Get dependencies if: steps.changes.outputs.end_to_end == 'true' run: | - # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - - # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb - echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections - sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* + # Setup Percona Server for MySQL 8.0 + sudo apt-get update + sudo apt-get install -y lsb-release gnupg2 curl + wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb + sudo percona-release setup ps80 sudo apt-get update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils + sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils sudo service mysql stop sudo service etcd stop sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ @@ -79,11 +78,7 @@ jobs: {{if .InstallXtraBackup}} - wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb - sudo apt-get install -y gnupg2 - sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb - sudo apt-get update - sudo apt-get install percona-xtrabackup-80 lz4 + sudo apt-get install percona-server-server percona-xtrabackup-80 lz4 {{end}} From d104ad2518a6baf22bfd5b233016ce142c1866b5 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 13 Jul 2022 20:41:26 -0400 Subject: [PATCH 08/25] Specify stream type everywhere Signed-off-by: Matt Lord --- go/test/endtoend/backup/mysqlctld/backup_mysqlctld_test.go | 2 +- go/test/endtoend/backup/vtctlbackup/backup_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go/test/endtoend/backup/mysqlctld/backup_mysqlctld_test.go b/go/test/endtoend/backup/mysqlctld/backup_mysqlctld_test.go index dabec5d6355..e49ece11934 100644 --- a/go/test/endtoend/backup/mysqlctld/backup_mysqlctld_test.go +++ b/go/test/endtoend/backup/mysqlctld/backup_mysqlctld_test.go @@ -35,7 +35,7 @@ func TestBackupMysqlctldWithlz4Compression(t *testing.T) { BuiltinCompressor: "lz4", } - backup.TestBackup(t, backup.Mysqlctld, "", 0, cDetails, []string{"TestReplicaBackup", "TestPrimaryBackup"}) + backup.TestBackup(t, backup.Mysqlctld, "xbstream", 0, cDetails, []string{"TestReplicaBackup", "TestPrimaryBackup"}) } func setDefaultCompressionFlag() { diff --git a/go/test/endtoend/backup/vtctlbackup/backup_test.go b/go/test/endtoend/backup/vtctlbackup/backup_test.go index 7362a318139..557ee57ec27 100644 --- a/go/test/endtoend/backup/vtctlbackup/backup_test.go +++ b/go/test/endtoend/backup/vtctlbackup/backup_test.go @@ -35,7 +35,7 @@ func TestBackupMainWithZstdCompression(t *testing.T) { ExternalDecompressorCmd: "zstd -d", } - TestBackup(t, Backup, "", 0, cDetails, []string{"TestReplicaBackup", "TestPrimaryBackup"}) + TestBackup(t, Backup, "xbstream", 0, cDetails, []string{"TestReplicaBackup", "TestPrimaryBackup"}) } func setDefaultCompressionFlag() { From da5a08d0c48fb2dad5faa25cd039d69d3b646a4f Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 13 Jul 2022 20:45:41 -0400 Subject: [PATCH 09/25] Remove repeated server install Signed-off-by: Matt Lord --- test/templates/cluster_endtoend_test_mysql80.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/templates/cluster_endtoend_test_mysql80.tpl b/test/templates/cluster_endtoend_test_mysql80.tpl index 0391269af07..907e83dfe3e 100644 --- a/test/templates/cluster_endtoend_test_mysql80.tpl +++ b/test/templates/cluster_endtoend_test_mysql80.tpl @@ -78,7 +78,7 @@ jobs: {{if .InstallXtraBackup}} - sudo apt-get install percona-server-server percona-xtrabackup-80 lz4 + sudo apt-get install percona-xtrabackup-80 lz4 {{end}} From b379bbc114222fd61ca7713776dbc5607d2e5876 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 13 Jul 2022 20:54:52 -0400 Subject: [PATCH 10/25] Moar... Signed-off-by: Matt Lord --- go/test/endtoend/backup/vtctlbackup/backup_utils.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go/test/endtoend/backup/vtctlbackup/backup_utils.go b/go/test/endtoend/backup/vtctlbackup/backup_utils.go index 5ae26e6033a..c0ef340363a 100644 --- a/go/test/endtoend/backup/vtctlbackup/backup_utils.go +++ b/go/test/endtoend/backup/vtctlbackup/backup_utils.go @@ -1,9 +1,12 @@ /* Copyright 2019 The Vitess Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. From c73ecf5a16ace3c4e99fafb8b4e8cd1dbe19e9d6 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 13 Jul 2022 21:01:18 -0400 Subject: [PATCH 11/25] Move vtctlbackup test to 8.0 Signed-off-by: Matt Lord --- ...oend_vtctlbackup_sharded_clustertest_heavy.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml b/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml index fe434669aae..5b96131dca4 100644 --- a/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml +++ b/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml @@ -14,7 +14,7 @@ env: jobs: build: name: Run endtoend tests on Cluster (vtctlbackup_sharded_clustertest_heavy) - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - name: Check out code @@ -59,8 +59,16 @@ jobs: - name: Get dependencies if: steps.changes.outputs.end_to_end == 'true' run: | + # Setup Percona Server for MySQL 8.0 sudo apt-get update - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata + sudo apt-get install -y lsb-release gnupg2 curl + wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb + sudo percona-release setup ps80 + sudo apt-get update + + # Install everything else we need, and configure + sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils sudo service mysql stop sudo service etcd stop sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ @@ -97,8 +105,9 @@ jobs: sudo sysctl -w net.ipv4.ip_local_port_range="22768 61999" # Increase our open file descriptor limit as we could hit this ulimit -n 65536 - cat <<-EOF>>./config/mycnf/mysql57.cnf + cat <<-EOF>>./config/mycnf/mysql80.cnf innodb_buffer_pool_dump_at_shutdown=OFF + innodb_buffer_pool_in_core_file=OFF innodb_buffer_pool_load_at_startup=OFF innodb_buffer_pool_size=64M innodb_doublewrite=OFF From f64273a2adf0befa7a42c8c5b3cb1ce6067c172a Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 13 Jul 2022 21:06:22 -0400 Subject: [PATCH 12/25] Rename vtbackup test and move to MySQL 8 Signed-off-by: Matt Lord --- ...> cluster_endtoend_vtbackup_transform.yml} | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) rename .github/workflows/{cluster_endtoend_19.yml => cluster_endtoend_vtbackup_transform.yml} (79%) diff --git a/.github/workflows/cluster_endtoend_19.yml b/.github/workflows/cluster_endtoend_vtbackup_transform.yml similarity index 79% rename from .github/workflows/cluster_endtoend_19.yml rename to .github/workflows/cluster_endtoend_vtbackup_transform.yml index 5b87ed86f22..971a6e41b9b 100644 --- a/.github/workflows/cluster_endtoend_19.yml +++ b/.github/workflows/cluster_endtoend_vtbackup_transform.yml @@ -1,9 +1,9 @@ # DO NOT MODIFY: THIS FILE IS GENERATED USING "make generate_ci_workflows" -name: Cluster (19) +name: Cluster (vtbackup_transform) on: [push, pull_request] concurrency: - group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (19)') + group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtbackup_transform)') cancel-in-progress: true env: @@ -13,8 +13,8 @@ env: jobs: build: - name: Run endtoend tests on Cluster (19) - runs-on: ubuntu-18.04 + name: Run endtoend tests on Cluster (vtbackup_transform) + runs-on: ubuntu-20.04 steps: - name: Check out code @@ -59,8 +59,16 @@ jobs: - name: Get dependencies if: steps.changes.outputs.end_to_end == 'true' run: | + # Setup Percona Server for MySQL 8.0 sudo apt-get update - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata + sudo apt-get install -y lsb-release gnupg2 curl + wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb + sudo percona-release setup ps80 + sudo apt-get update + + # Install everything else we need, and configure + sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils sudo service mysql stop sudo service etcd stop sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ @@ -94,7 +102,7 @@ jobs: set -x # run the tests however you normally do, then produce a JUnit XML file - eatmydata -- go run test.go -docker=false -follow -shard 19 | tee -a output.txt | go-junit-report -set-exit-code > report.xml + eatmydata -- go run test.go -docker=false -follow -shard vtbackup_transform | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable if: steps.changes.outputs.end_to_end == 'true' && always() From 61b2c082bad447c4c7c83d8e121f8a826171f720 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 13 Jul 2022 21:17:26 -0400 Subject: [PATCH 13/25] Split the xbstream tests so the workflow doesn't time out Otherwise it was going over the 10min limit and getting killed. Signed-off-by: Matt Lord --- test/config.json | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/config.json b/test/config.json index 0bde9e9cb63..c4db71985fb 100644 --- a/test/config.json +++ b/test/config.json @@ -114,7 +114,7 @@ "Args": ["vitess.io/vitess/go/test/endtoend/backup/vtbackup"], "Command": [], "Manual": false, - "Shard": "19", + "Shard": "vtbackup_transform", "RetryMax": 1, "Tags": ["upgrade_downgrade_backups"] }, @@ -123,7 +123,7 @@ "Args": ["vitess.io/vitess/go/test/endtoend/backup/transform"], "Command": [], "Manual": false, - "Shard": "19", + "Shard": "vtbackup_transform", "RetryMax": 1, "Tags": ["upgrade_downgrade_backups"] }, @@ -147,7 +147,16 @@ }, "backup_xtrabackup_xbstream": { "File": "unused.go", - "Args": ["vitess.io/vitess/go/test/endtoend/backup/xtrabackupstream"], + "Args": ["vitess.io/vitess/go/test/endtoend/backup/xtrabackupstream", "-run", "XtrabackupStream"], + "Command": [], + "Manual": false, + "Shard": "xb_backup", + "RetryMax": 1, + "Tags": [] + }, + "backup_xtrabackup_xbstream_lz4": { + "File": "unused.go", + "Args": ["vitess.io/vitess/go/test/endtoend/backup/xtrabackupstream", "-run", "XtrabackupStreamWithlz4Compression"], "Command": [], "Manual": false, "Shard": "xb_backup", From 3900baed1fa4a4f19d8d176380129ba755db558b Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 13 Jul 2022 21:57:06 -0400 Subject: [PATCH 14/25] Use MySQL 8 compat method for setting passwords Signed-off-by: Matt Lord --- go/test/endtoend/cluster/cluster_util.go | 43 ++++-------------------- test/ci_workflow_gen.go | 6 +++- 2 files changed, 12 insertions(+), 37 deletions(-) diff --git a/go/test/endtoend/cluster/cluster_util.go b/go/test/endtoend/cluster/cluster_util.go index eb6e8c2b2f4..62d82f41735 100644 --- a/go/test/endtoend/cluster/cluster_util.go +++ b/go/test/endtoend/cluster/cluster_util.go @@ -317,44 +317,15 @@ func WriteDbCredentialToTmp(tmpDir string) string { func GetPasswordUpdateSQL(localCluster *LocalProcessCluster) string { pwdChangeCmd := ` # Set real passwords for all users. - UPDATE mysql.user SET %s = PASSWORD('RootPass') - WHERE User = 'root' AND Host = 'localhost'; - UPDATE mysql.user SET %s = PASSWORD('VtDbaPass') - WHERE User = 'vt_dba' AND Host = 'localhost'; - UPDATE mysql.user SET %s = PASSWORD('VtAppPass') - WHERE User = 'vt_app' AND Host = 'localhost'; - UPDATE mysql.user SET %s = PASSWORD('VtAllprivsPass') - WHERE User = 'vt_allprivs' AND Host = 'localhost'; - UPDATE mysql.user SET %s = PASSWORD('VtReplPass') - WHERE User = 'vt_repl' AND Host = '%%'; - UPDATE mysql.user SET %s = PASSWORD('VtFilteredPass') - WHERE User = 'vt_filtered' AND Host = 'localhost'; + SET PASSWORD FOR 'root'@'localhost' = 'RootPass'; + SET PASSWORD FOR 'vt_dba'@'localhost' = 'VtDbaPass'; + SET PASSWORD FOR 'vt_app'@'localhost' = 'VtAppPass'; + SET PASSWORD FOR 'vt_allprivs'@'localhost' = 'VtAllprivsPass'; + SET PASSWORD FOR 'vt_repl'@'localhost' = 'VtReplPass'; + SET PASSWORD FOR 'vt_filtered'@'localhost' = 'VtFilteredPass'; FLUSH PRIVILEGES; ` - pwdCol, _ := getPasswordField(localCluster) - return fmt.Sprintf(pwdChangeCmd, pwdCol, pwdCol, pwdCol, pwdCol, pwdCol, pwdCol) -} - -// getPasswordField determines which column is used for user passwords in this MySQL version. -func getPasswordField(localCluster *LocalProcessCluster) (pwdCol string, err error) { - tablet := &Vttablet{ - Type: "relpica", - TabletUID: 100, - MySQLPort: 15000, - MysqlctlProcess: *MysqlCtlProcessInstance(100, 15000, localCluster.TmpDirectory), - } - if err = tablet.MysqlctlProcess.Start(); err != nil { - return "", err - } - tablet.VttabletProcess = VttabletProcessInstance(tablet.HTTPPort, tablet.GrpcPort, tablet.TabletUID, "", "", "", 0, tablet.Type, localCluster.TopoPort, "", "", nil, false, localCluster.DefaultCharset) - result, err := tablet.VttabletProcess.QueryTablet("select password from mysql.user limit 0", "", false) - if err == nil && len(result.Rows) > 0 { - return "password", nil - } - tablet.MysqlctlProcess.Stop() - os.RemoveAll(path.Join(tablet.VttabletProcess.Directory)) - return "authentication_string", nil - + return pwdChangeCmd } // CheckSrvKeyspace confirms that the cell and keyspace contain the expected diff --git a/test/ci_workflow_gen.go b/test/ci_workflow_gen.go index 9c44d20b54a..5b3173c8e59 100644 --- a/test/ci_workflow_gen.go +++ b/test/ci_workflow_gen.go @@ -74,7 +74,7 @@ var ( "ers_prs_newfeatures_heavy", "15", "vtgate_general_heavy", - "19", + "vtbackup_transform", "xb_backup", "21", "22", @@ -179,6 +179,10 @@ func clusterMySQLVersions(clusterName string) mysqlVersions { return []mysqlVersion{mysql80} case clusterName == "xb_backup": return allMySQLVersions + case clusterName == "vtctlbackup_sharded_clustertest_heavy": + return []mysqlVersion{mysql80} + case clusterName == "vtbackup_transform": + return []mysqlVersion{mysql80} default: return defaultMySQLVersions } From 3c3a0e6a680f37573a253432b14e8f84f4eaf745 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 13 Jul 2022 22:06:07 -0400 Subject: [PATCH 15/25] Test increasing timeout at another level Signed-off-by: Matt Lord --- .github/workflows/cluster_endtoend_xb_backup_mysql80.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml b/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml index a4fee7119a1..0ac5ccfaa10 100644 --- a/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml +++ b/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml @@ -15,6 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (xb_backup) mysql80 runs-on: ubuntu-20.04 + timeout-minutes: 30 steps: - name: Check out code @@ -78,7 +79,7 @@ jobs: # install JUnit report formatter go install github.com/jstemmer/go-junit-report@latest - sudo apt-get install percona-server-server percona-xtrabackup-80 lz4 + sudo apt-get install percona-xtrabackup-80 lz4 - name: Setup launchable dependencies if: steps.changes.outputs.end_to_end == 'true' From 80f32a9ff22795a7c4ea73561561613ec5c2a5ae Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 13 Jul 2022 22:32:32 -0400 Subject: [PATCH 16/25] Don't use the init passwords file with 8.0 mysqlctl doesn't start... This is likely due to the change in initialization behavior with MySQL 8.0 as it goes though two phases and you can't simply start up mysqld and pass it data, it has to initialize and restart first. Signed-off-by: Matt Lord --- go/test/endtoend/backup/vtbackup/main_test.go | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/go/test/endtoend/backup/vtbackup/main_test.go b/go/test/endtoend/backup/vtbackup/main_test.go index ce0720e77c4..6fc868ba479 100644 --- a/go/test/endtoend/backup/vtbackup/main_test.go +++ b/go/test/endtoend/backup/vtbackup/main_test.go @@ -21,7 +21,6 @@ import ( "fmt" "os" "os/exec" - "path" "testing" "vitess.io/vitess/go/test/endtoend/cluster" @@ -38,7 +37,7 @@ var ( hostname = "localhost" keyspaceName = "ks" shardName = "0" - dbPassword = "VtDbaPass" + dbPassword = "" shardKsName = fmt.Sprintf("%s/%s", keyspaceName, shardName) dbCredentialFile string commonTabletArg = []string{ @@ -84,21 +83,6 @@ func TestMain(m *testing.M) { return 1, err } - // Create a new init_db.sql file that sets up passwords for all users. - // Then we use a db-credentials-file with the passwords. - dbCredentialFile = cluster.WriteDbCredentialToTmp(localCluster.TmpDirectory) - initDb, _ := os.ReadFile(path.Join(os.Getenv("VTROOT"), "/config/init_db.sql")) - sql := string(initDb) - newInitDBFile = path.Join(localCluster.TmpDirectory, "init_db_with_passwords.sql") - sql = sql + cluster.GetPasswordUpdateSQL(localCluster) - err = os.WriteFile(newInitDBFile, []byte(sql), 0666) - if err != nil { - return 1, err - } - - extraArgs := []string{"--db-credentials-file", dbCredentialFile} - commonTabletArg = append(commonTabletArg, "--db-credentials-file", dbCredentialFile) - primary = localCluster.NewVttabletInstance("replica", 0, "") replica1 = localCluster.NewVttabletInstance("replica", 0, "") replica2 = localCluster.NewVttabletInstance("replica", 0, "") @@ -115,7 +99,6 @@ func TestMain(m *testing.M) { tablet.MysqlctlProcess = *cluster.MysqlCtlProcessInstance(tablet.TabletUID, tablet.MySQLPort, localCluster.TmpDirectory) tablet.MysqlctlProcess.InitDBFile = newInitDBFile - tablet.MysqlctlProcess.ExtraArgs = extraArgs proc, err := tablet.MysqlctlProcess.StartProcess() if err != nil { return 1, err From 9dcce727849eaed26266bd0f718ab9a43624581f Mon Sep 17 00:00:00 2001 From: Rohit Nayak Date: Thu, 14 Jul 2022 11:50:19 +0200 Subject: [PATCH 17/25] Fix incorrect password update statement for vt_repl user Signed-off-by: Rohit Nayak --- go/test/endtoend/cluster/cluster_util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/test/endtoend/cluster/cluster_util.go b/go/test/endtoend/cluster/cluster_util.go index 62d82f41735..83e4f4ea243 100644 --- a/go/test/endtoend/cluster/cluster_util.go +++ b/go/test/endtoend/cluster/cluster_util.go @@ -321,7 +321,7 @@ func GetPasswordUpdateSQL(localCluster *LocalProcessCluster) string { SET PASSWORD FOR 'vt_dba'@'localhost' = 'VtDbaPass'; SET PASSWORD FOR 'vt_app'@'localhost' = 'VtAppPass'; SET PASSWORD FOR 'vt_allprivs'@'localhost' = 'VtAllprivsPass'; - SET PASSWORD FOR 'vt_repl'@'localhost' = 'VtReplPass'; + SET PASSWORD FOR 'vt_repl'@'%' = 'VtReplPass'; SET PASSWORD FOR 'vt_filtered'@'localhost' = 'VtFilteredPass'; FLUSH PRIVILEGES; ` From bc96897ca5d217267843a4e446fe52cfd054683f Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Thu, 14 Jul 2022 10:04:16 -0400 Subject: [PATCH 18/25] Bump timeouts for 8.0 backup tests Signed-off-by: Matt Lord --- ...toend_vtctlbackup_sharded_clustertest_heavy.yml | 1 + .../cluster_endtoend_xb_backup_mysql80.yml | 2 +- test/config.json | 14 +++++++------- test/templates/cluster_endtoend_test_mysql80.tpl | 1 + 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml b/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml index 5b96131dca4..4d195b5525f 100644 --- a/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml +++ b/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml @@ -15,6 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (vtctlbackup_sharded_clustertest_heavy) runs-on: ubuntu-20.04 + timeout-minutes: 45 steps: - name: Check out code diff --git a/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml b/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml index 0ac5ccfaa10..fd64640e483 100644 --- a/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml +++ b/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml @@ -15,7 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (xb_backup) mysql80 runs-on: ubuntu-20.04 - timeout-minutes: 30 + timeout-minutes: 45 steps: - name: Check out code diff --git a/test/config.json b/test/config.json index c4db71985fb..ea6b7724ddf 100644 --- a/test/config.json +++ b/test/config.json @@ -93,7 +93,7 @@ }, "backup": { "File": "unused.go", - "Args": ["vitess.io/vitess/go/test/endtoend/backup/vtctlbackup", "-timeout", "15m"], + "Args": ["vitess.io/vitess/go/test/endtoend/backup/vtctlbackup", "-timeout", "30m"], "Command": [], "Manual": false, "Shard": "vtctlbackup_sharded_clustertest_heavy", @@ -102,7 +102,7 @@ }, "backup_mysqlctld": { "File": "unused.go", - "Args": ["vitess.io/vitess/go/test/endtoend/backup/mysqlctld", "-timeout", "15m"], + "Args": ["vitess.io/vitess/go/test/endtoend/backup/mysqlctld", "-timeout", "30m"], "Command": [], "Manual": false, "Shard": "21", @@ -111,7 +111,7 @@ }, "backup_only": { "File": "unused.go", - "Args": ["vitess.io/vitess/go/test/endtoend/backup/vtbackup"], + "Args": ["vitess.io/vitess/go/test/endtoend/backup/vtbackup", "-timeout", "15m"], "Command": [], "Manual": false, "Shard": "vtbackup_transform", @@ -147,7 +147,7 @@ }, "backup_xtrabackup_xbstream": { "File": "unused.go", - "Args": ["vitess.io/vitess/go/test/endtoend/backup/xtrabackupstream", "-run", "XtrabackupStream"], + "Args": ["vitess.io/vitess/go/test/endtoend/backup/xtrabackupstream", "-run", "XtrabackupStream", "-timeout", "30m"], "Command": [], "Manual": false, "Shard": "xb_backup", @@ -156,7 +156,7 @@ }, "backup_xtrabackup_xbstream_lz4": { "File": "unused.go", - "Args": ["vitess.io/vitess/go/test/endtoend/backup/xtrabackupstream", "-run", "XtrabackupStreamWithlz4Compression"], + "Args": ["vitess.io/vitess/go/test/endtoend/backup/xtrabackupstream", "-run", "XtrabackupStreamWithlz4Compression", "-timeout", "30m"], "Command": [], "Manual": false, "Shard": "xb_backup", @@ -1127,7 +1127,7 @@ }, "vreplication_v2": { "File": "unused.go", - "Args": ["vitess.io/vitess/go/test/endtoend/vreplication", "-run", "TestBasicV2Workflows"], + "Args": ["vitess.io/vitess/go/test/endtoend/vreplication", "-run", "TestBasicV2Workflows", "-timeout", "20m"], "Command": [], "Manual": false, "Shard": "vreplication_v2", @@ -1136,7 +1136,7 @@ }, "vreplication_across_db_versions": { "File": "unused.go", - "Args": ["vitess.io/vitess/go/test/endtoend/vreplication", "-run", "TestV2WorkflowsAcrossDBVersions"], + "Args": ["vitess.io/vitess/go/test/endtoend/vreplication", "-run", "TestV2WorkflowsAcrossDBVersions", "-timeout", "20m"], "Command": [], "Manual": false, "Shard": "vreplication_across_db_versions", diff --git a/test/templates/cluster_endtoend_test_mysql80.tpl b/test/templates/cluster_endtoend_test_mysql80.tpl index 907e83dfe3e..d124e55c5d2 100644 --- a/test/templates/cluster_endtoend_test_mysql80.tpl +++ b/test/templates/cluster_endtoend_test_mysql80.tpl @@ -13,6 +13,7 @@ jobs: build: name: Run endtoend tests on {{.Name}} {{if .Ubuntu20}}runs-on: ubuntu-20.04{{else}}runs-on: ubuntu-18.04{{end}} + timeout-minutes: 45 steps: - name: Check out code From 0ff6fd0f1d461d6fd79acce5f6a3584fd2193c8c Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Thu, 14 Jul 2022 10:49:26 -0400 Subject: [PATCH 19/25] Bump it more :( Signed-off-by: Matt Lord --- test/config.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/config.json b/test/config.json index ea6b7724ddf..795da7d1f73 100644 --- a/test/config.json +++ b/test/config.json @@ -93,7 +93,7 @@ }, "backup": { "File": "unused.go", - "Args": ["vitess.io/vitess/go/test/endtoend/backup/vtctlbackup", "-timeout", "30m"], + "Args": ["vitess.io/vitess/go/test/endtoend/backup/vtctlbackup", "-timeout", "45m"], "Command": [], "Manual": false, "Shard": "vtctlbackup_sharded_clustertest_heavy", @@ -111,7 +111,7 @@ }, "backup_only": { "File": "unused.go", - "Args": ["vitess.io/vitess/go/test/endtoend/backup/vtbackup", "-timeout", "15m"], + "Args": ["vitess.io/vitess/go/test/endtoend/backup/vtbackup", "-timeout", "30m"], "Command": [], "Manual": false, "Shard": "vtbackup_transform", @@ -120,7 +120,7 @@ }, "backup_transform": { "File": "unused.go", - "Args": ["vitess.io/vitess/go/test/endtoend/backup/transform"], + "Args": ["vitess.io/vitess/go/test/endtoend/backup/transform", "-timeout", "30m"], "Command": [], "Manual": false, "Shard": "vtbackup_transform", @@ -418,7 +418,7 @@ }, "sharded": { "File": "unused.go", - "Args": ["vitess.io/vitess/go/test/endtoend/sharded"], + "Args": ["vitess.io/vitess/go/test/endtoend/sharded", "-timeout", "30m"], "Command": [], "Manual": false, "Shard": "vtctlbackup_sharded_clustertest_heavy", From 94cd96355014ec00b831e386a6d99cfaca51fc4a Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Thu, 14 Jul 2022 11:26:34 -0400 Subject: [PATCH 20/25] Increase backup/restore timeout in backup_utils Signed-off-by: Matt Lord --- go/test/endtoend/backup/vtctlbackup/backup_utils.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/go/test/endtoend/backup/vtctlbackup/backup_utils.go b/go/test/endtoend/backup/vtctlbackup/backup_utils.go index c0ef340363a..942d6ecfca2 100644 --- a/go/test/endtoend/backup/vtctlbackup/backup_utils.go +++ b/go/test/endtoend/backup/vtctlbackup/backup_utils.go @@ -47,6 +47,7 @@ const ( Mysqlctld useXBStream = "--xtrabackup_stream_mode=xbstream" useTar = "--xtrabackup_stream_mode=tar" + timeout = time.Duration(60 * time.Second) ) var ( @@ -304,7 +305,7 @@ func primaryBackup(t *testing.T) { require.NoError(t, err) restoreWaitForBackup(t, "replica") - err = replica2.VttabletProcess.WaitForTabletStatusesForTimeout([]string{"SERVING"}, 25*time.Second) + err = replica2.VttabletProcess.WaitForTabletStatusesForTimeout([]string{"SERVING"}, timeout) require.NoError(t, err) // Verify that we have all the new data -- we should have 2 records now... @@ -369,7 +370,7 @@ func primaryReplicaSameBackup(t *testing.T) { // now bring up the other replica, letting it restore from backup. restoreWaitForBackup(t, "replica") - err = replica2.VttabletProcess.WaitForTabletStatusesForTimeout([]string{"SERVING"}, 25*time.Second) + err = replica2.VttabletProcess.WaitForTabletStatusesForTimeout([]string{"SERVING"}, timeout) require.NoError(t, err) // check the new replica has the data @@ -605,7 +606,7 @@ func vtctlBackup(t *testing.T, tabletType string) { _, err = primary.VttabletProcess.QueryTablet("insert into vt_insert_test (msg) values ('test2')", keyspaceName, true) require.NoError(t, err) - err = replica2.VttabletProcess.WaitForTabletStatusesForTimeout([]string{"SERVING"}, 25*time.Second) + err = replica2.VttabletProcess.WaitForTabletStatusesForTimeout([]string{"SERVING"}, timeout) require.NoError(t, err) cluster.VerifyRowsInTablet(t, replica2, keyspaceName, 2) @@ -667,7 +668,7 @@ func verifyRestoreTablet(t *testing.T, tablet *cluster.Vttablet, status string) err := tablet.VttabletProcess.Setup() require.NoError(t, err) if status != "" { - err = tablet.VttabletProcess.WaitForTabletStatusesForTimeout([]string{status}, 25*time.Second) + err = tablet.VttabletProcess.WaitForTabletStatusesForTimeout([]string{status}, timeout) require.NoError(t, err) } // We restart replication here because semi-sync will not be set correctly on tablet startup since From 7e2c847ec8af15344c9c372175df1ea5f482d929 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Thu, 14 Jul 2022 12:08:18 -0400 Subject: [PATCH 21/25] Apply new 8.0 template everywhere Signed-off-by: Matt Lord --- .github/workflows/cluster_endtoend_mysql80.yml | 16 ++++++++-------- ...er_endtoend_onlineddl_declarative_mysql80.yml | 16 ++++++++-------- .../cluster_endtoend_onlineddl_ghost_mysql80.yml | 16 ++++++++-------- ...cluster_endtoend_onlineddl_revert_mysql80.yml | 16 ++++++++-------- ...ter_endtoend_onlineddl_revertible_mysql80.yml | 16 ++++++++-------- ...ster_endtoend_onlineddl_scheduler_mysql80.yml | 16 ++++++++-------- ...ster_endtoend_onlineddl_singleton_mysql80.yml | 16 ++++++++-------- .../cluster_endtoend_onlineddl_vrepl_mysql80.yml | 16 ++++++++-------- ...r_endtoend_onlineddl_vrepl_stress_mysql80.yml | 16 ++++++++-------- ...oend_onlineddl_vrepl_stress_suite_mysql80.yml | 16 ++++++++-------- ...er_endtoend_onlineddl_vrepl_suite_mysql80.yml | 16 ++++++++-------- ...cluster_endtoend_schemadiff_vrepl_mysql80.yml | 16 ++++++++-------- ...er_endtoend_tabletmanager_tablegc_mysql80.yml | 16 ++++++++-------- ..._endtoend_vreplication_across_db_versions.yml | 16 ++++++++-------- .../cluster_endtoend_vtbackup_transform.yml | 1 + .github/workflows/cluster_endtoend_vtorc_8.0.yml | 16 ++++++++-------- 16 files changed, 121 insertions(+), 120 deletions(-) diff --git a/.github/workflows/cluster_endtoend_mysql80.yml b/.github/workflows/cluster_endtoend_mysql80.yml index 2bcbaed3be1..73f4bc38a47 100644 --- a/.github/workflows/cluster_endtoend_mysql80.yml +++ b/.github/workflows/cluster_endtoend_mysql80.yml @@ -15,6 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (mysql80) runs-on: ubuntu-20.04 + timeout-minutes: 30 steps: - name: Check out code @@ -59,17 +60,16 @@ jobs: - name: Get dependencies if: steps.changes.outputs.end_to_end == 'true' run: | - # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - - # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb - echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections - sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* + # Setup Percona Server for MySQL 8.0 + sudo apt-get update + sudo apt-get install -y lsb-release gnupg2 curl + wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb + sudo percona-release setup ps80 sudo apt-get update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils + sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils sudo service mysql stop sudo service etcd stop sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ diff --git a/.github/workflows/cluster_endtoend_onlineddl_declarative_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_declarative_mysql80.yml index 80de852474d..bdb7c086b89 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_declarative_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_declarative_mysql80.yml @@ -15,6 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (onlineddl_declarative) mysql80 runs-on: ubuntu-20.04 + timeout-minutes: 30 steps: - name: Check out code @@ -59,17 +60,16 @@ jobs: - name: Get dependencies if: steps.changes.outputs.end_to_end == 'true' run: | - # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - - # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb - echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections - sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* + # Setup Percona Server for MySQL 8.0 + sudo apt-get update + sudo apt-get install -y lsb-release gnupg2 curl + wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb + sudo percona-release setup ps80 sudo apt-get update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils + sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils sudo service mysql stop sudo service etcd stop sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ diff --git a/.github/workflows/cluster_endtoend_onlineddl_ghost_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_ghost_mysql80.yml index 7036fbabd8c..4007238ef40 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_ghost_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_ghost_mysql80.yml @@ -15,6 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (onlineddl_ghost) mysql80 runs-on: ubuntu-20.04 + timeout-minutes: 30 steps: - name: Check out code @@ -59,17 +60,16 @@ jobs: - name: Get dependencies if: steps.changes.outputs.end_to_end == 'true' run: | - # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - - # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb - echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections - sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* + # Setup Percona Server for MySQL 8.0 + sudo apt-get update + sudo apt-get install -y lsb-release gnupg2 curl + wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb + sudo percona-release setup ps80 sudo apt-get update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils + sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils sudo service mysql stop sudo service etcd stop sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ diff --git a/.github/workflows/cluster_endtoend_onlineddl_revert_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_revert_mysql80.yml index 58f796718ec..794876776e1 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_revert_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_revert_mysql80.yml @@ -15,6 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (onlineddl_revert) mysql80 runs-on: ubuntu-20.04 + timeout-minutes: 30 steps: - name: Check out code @@ -59,17 +60,16 @@ jobs: - name: Get dependencies if: steps.changes.outputs.end_to_end == 'true' run: | - # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - - # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb - echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections - sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* + # Setup Percona Server for MySQL 8.0 + sudo apt-get update + sudo apt-get install -y lsb-release gnupg2 curl + wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb + sudo percona-release setup ps80 sudo apt-get update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils + sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils sudo service mysql stop sudo service etcd stop sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ diff --git a/.github/workflows/cluster_endtoend_onlineddl_revertible_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_revertible_mysql80.yml index f200e1a4d52..3318fbc45bb 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_revertible_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_revertible_mysql80.yml @@ -15,6 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (onlineddl_revertible) mysql80 runs-on: ubuntu-20.04 + timeout-minutes: 30 steps: - name: Check out code @@ -59,17 +60,16 @@ jobs: - name: Get dependencies if: steps.changes.outputs.end_to_end == 'true' run: | - # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - - # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb - echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections - sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* + # Setup Percona Server for MySQL 8.0 + sudo apt-get update + sudo apt-get install -y lsb-release gnupg2 curl + wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb + sudo percona-release setup ps80 sudo apt-get update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils + sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils sudo service mysql stop sudo service etcd stop sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ diff --git a/.github/workflows/cluster_endtoend_onlineddl_scheduler_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_scheduler_mysql80.yml index c9ec2d2e3f0..d565071d844 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_scheduler_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_scheduler_mysql80.yml @@ -15,6 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (onlineddl_scheduler) mysql80 runs-on: ubuntu-20.04 + timeout-minutes: 30 steps: - name: Check out code @@ -59,17 +60,16 @@ jobs: - name: Get dependencies if: steps.changes.outputs.end_to_end == 'true' run: | - # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - - # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb - echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections - sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* + # Setup Percona Server for MySQL 8.0 + sudo apt-get update + sudo apt-get install -y lsb-release gnupg2 curl + wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb + sudo percona-release setup ps80 sudo apt-get update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils + sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils sudo service mysql stop sudo service etcd stop sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ diff --git a/.github/workflows/cluster_endtoend_onlineddl_singleton_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_singleton_mysql80.yml index 2482c80622d..e63122364eb 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_singleton_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_singleton_mysql80.yml @@ -15,6 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (onlineddl_singleton) mysql80 runs-on: ubuntu-20.04 + timeout-minutes: 30 steps: - name: Check out code @@ -59,17 +60,16 @@ jobs: - name: Get dependencies if: steps.changes.outputs.end_to_end == 'true' run: | - # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - - # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb - echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections - sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* + # Setup Percona Server for MySQL 8.0 + sudo apt-get update + sudo apt-get install -y lsb-release gnupg2 curl + wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb + sudo percona-release setup ps80 sudo apt-get update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils + sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils sudo service mysql stop sudo service etcd stop sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql80.yml index 9c396c932eb..c8974f10394 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql80.yml @@ -15,6 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (onlineddl_vrepl) mysql80 runs-on: ubuntu-20.04 + timeout-minutes: 30 steps: - name: Check out code @@ -59,17 +60,16 @@ jobs: - name: Get dependencies if: steps.changes.outputs.end_to_end == 'true' run: | - # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - - # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb - echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections - sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* + # Setup Percona Server for MySQL 8.0 + sudo apt-get update + sudo apt-get install -y lsb-release gnupg2 curl + wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb + sudo percona-release setup ps80 sudo apt-get update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils + sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils sudo service mysql stop sudo service etcd stop sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_mysql80.yml index b56f4455704..29358d6ced0 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_mysql80.yml @@ -15,6 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (onlineddl_vrepl_stress) mysql80 runs-on: ubuntu-20.04 + timeout-minutes: 30 steps: - name: Check out code @@ -59,17 +60,16 @@ jobs: - name: Get dependencies if: steps.changes.outputs.end_to_end == 'true' run: | - # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - - # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb - echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections - sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* + # Setup Percona Server for MySQL 8.0 + sudo apt-get update + sudo apt-get install -y lsb-release gnupg2 curl + wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb + sudo percona-release setup ps80 sudo apt-get update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils + sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils sudo service mysql stop sudo service etcd stop sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite_mysql80.yml index f352d2e7769..717c532adfd 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite_mysql80.yml @@ -15,6 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (onlineddl_vrepl_stress_suite) mysql80 runs-on: ubuntu-20.04 + timeout-minutes: 30 steps: - name: Check out code @@ -59,17 +60,16 @@ jobs: - name: Get dependencies if: steps.changes.outputs.end_to_end == 'true' run: | - # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - - # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb - echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections - sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* + # Setup Percona Server for MySQL 8.0 + sudo apt-get update + sudo apt-get install -y lsb-release gnupg2 curl + wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb + sudo percona-release setup ps80 sudo apt-get update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils + sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils sudo service mysql stop sudo service etcd stop sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite_mysql80.yml index da7f7f26101..848718fd865 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite_mysql80.yml @@ -15,6 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (onlineddl_vrepl_suite) mysql80 runs-on: ubuntu-20.04 + timeout-minutes: 30 steps: - name: Check out code @@ -59,17 +60,16 @@ jobs: - name: Get dependencies if: steps.changes.outputs.end_to_end == 'true' run: | - # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - - # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb - echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections - sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* + # Setup Percona Server for MySQL 8.0 + sudo apt-get update + sudo apt-get install -y lsb-release gnupg2 curl + wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb + sudo percona-release setup ps80 sudo apt-get update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils + sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils sudo service mysql stop sudo service etcd stop sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ diff --git a/.github/workflows/cluster_endtoend_schemadiff_vrepl_mysql80.yml b/.github/workflows/cluster_endtoend_schemadiff_vrepl_mysql80.yml index 5941a736fa7..adbb8591d58 100644 --- a/.github/workflows/cluster_endtoend_schemadiff_vrepl_mysql80.yml +++ b/.github/workflows/cluster_endtoend_schemadiff_vrepl_mysql80.yml @@ -15,6 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (schemadiff_vrepl) mysql80 runs-on: ubuntu-20.04 + timeout-minutes: 30 steps: - name: Check out code @@ -59,17 +60,16 @@ jobs: - name: Get dependencies if: steps.changes.outputs.end_to_end == 'true' run: | - # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - - # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb - echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections - sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* + # Setup Percona Server for MySQL 8.0 + sudo apt-get update + sudo apt-get install -y lsb-release gnupg2 curl + wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb + sudo percona-release setup ps80 sudo apt-get update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils + sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils sudo service mysql stop sudo service etcd stop sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ diff --git a/.github/workflows/cluster_endtoend_tabletmanager_tablegc_mysql80.yml b/.github/workflows/cluster_endtoend_tabletmanager_tablegc_mysql80.yml index 6ba5ebf6729..498e55b5ca3 100644 --- a/.github/workflows/cluster_endtoend_tabletmanager_tablegc_mysql80.yml +++ b/.github/workflows/cluster_endtoend_tabletmanager_tablegc_mysql80.yml @@ -15,6 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (tabletmanager_tablegc) mysql80 runs-on: ubuntu-20.04 + timeout-minutes: 30 steps: - name: Check out code @@ -59,17 +60,16 @@ jobs: - name: Get dependencies if: steps.changes.outputs.end_to_end == 'true' run: | - # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - - # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb - echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections - sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* + # Setup Percona Server for MySQL 8.0 + sudo apt-get update + sudo apt-get install -y lsb-release gnupg2 curl + wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb + sudo percona-release setup ps80 sudo apt-get update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils + sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils sudo service mysql stop sudo service etcd stop sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ diff --git a/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml b/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml index ab3d8b6c47a..2b938dd9775 100644 --- a/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml +++ b/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml @@ -15,6 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (vreplication_across_db_versions) runs-on: ubuntu-20.04 + timeout-minutes: 30 steps: - name: Check out code @@ -59,17 +60,16 @@ jobs: - name: Get dependencies if: steps.changes.outputs.end_to_end == 'true' run: | - # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - - # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb - echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections - sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* + # Setup Percona Server for MySQL 8.0 + sudo apt-get update + sudo apt-get install -y lsb-release gnupg2 curl + wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb + sudo percona-release setup ps80 sudo apt-get update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils + sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils sudo service mysql stop sudo service etcd stop sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ diff --git a/.github/workflows/cluster_endtoend_vtbackup_transform.yml b/.github/workflows/cluster_endtoend_vtbackup_transform.yml index 971a6e41b9b..404e5d2f98e 100644 --- a/.github/workflows/cluster_endtoend_vtbackup_transform.yml +++ b/.github/workflows/cluster_endtoend_vtbackup_transform.yml @@ -15,6 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (vtbackup_transform) runs-on: ubuntu-20.04 + timeout-minutes: 30 steps: - name: Check out code diff --git a/.github/workflows/cluster_endtoend_vtorc_8.0.yml b/.github/workflows/cluster_endtoend_vtorc_8.0.yml index 9362ab6e1b6..00208676200 100644 --- a/.github/workflows/cluster_endtoend_vtorc_8.0.yml +++ b/.github/workflows/cluster_endtoend_vtorc_8.0.yml @@ -15,6 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (vtorc_8.0) runs-on: ubuntu-20.04 + timeout-minutes: 30 steps: - name: Check out code @@ -59,17 +60,16 @@ jobs: - name: Get dependencies if: steps.changes.outputs.end_to_end == 'true' run: | - # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - - # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb - echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections - sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* + # Setup Percona Server for MySQL 8.0 + sudo apt-get update + sudo apt-get install -y lsb-release gnupg2 curl + wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb + sudo percona-release setup ps80 sudo apt-get update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils + sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils sudo service mysql stop sudo service etcd stop sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ From a91130b380869c00df1f2b08b662dfeb89d33ff0 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Thu, 14 Jul 2022 18:47:03 -0400 Subject: [PATCH 22/25] Fix bugs around how the compression flags were getting passed Signed-off-by: Matt Lord --- .../backup/vtctlbackup/backup_utils.go | 259 ++++++++++++------ test/config.json | 2 +- 2 files changed, 170 insertions(+), 91 deletions(-) diff --git a/go/test/endtoend/backup/vtctlbackup/backup_utils.go b/go/test/endtoend/backup/vtctlbackup/backup_utils.go index 942d6ecfca2..09ccf8025c2 100644 --- a/go/test/endtoend/backup/vtctlbackup/backup_utils.go +++ b/go/test/endtoend/backup/vtctlbackup/backup_utils.go @@ -45,9 +45,7 @@ const ( XtraBackup = iota Backup Mysqlctld - useXBStream = "--xtrabackup_stream_mode=xbstream" - useTar = "--xtrabackup_stream_mode=tar" - timeout = time.Duration(60 * time.Second) + timeout = time.Duration(60 * time.Second) ) var ( @@ -55,15 +53,17 @@ var ( replica1 *cluster.Vttablet replica2 *cluster.Vttablet localCluster *cluster.LocalProcessCluster + newInitDBFile string useXtrabackup bool cell = cluster.DefaultCell hostname = "localhost" keyspaceName = "ks" - dbPassword = "" + dbPassword = "VtDbaPass" shardKsName = fmt.Sprintf("%s/%s", keyspaceName, shardName) + dbCredentialFile string shardName = "0" - commonTabletArgs = []string{ + commonTabletArg = []string{ "--vreplication_healthcheck_topology_refresh", "1s", "--vreplication_healthcheck_retry_delay", "1s", "--vreplication_retry_delay", "1s", @@ -71,8 +71,6 @@ var ( "--lock_tables_timeout", "5s", "--watch_replication_stream", "--enable_replication_reporter", - "--enable_semi_sync", - "--restore_from_backup", "--serving_state_grace_period", "1s", } @@ -93,14 +91,40 @@ type CompressionDetails struct { } // LaunchCluster : starts the cluster as per given params. -func LaunchCluster(t *testing.T, setupType int, streamMode string, stripes int, cDetails *CompressionDetails) { +func LaunchCluster(setupType int, streamMode string, stripes int, cDetails *CompressionDetails) (int, error) { localCluster = cluster.NewCluster(cell, hostname) - keyspace := cluster.Keyspace{Name: keyspaceName} - shards := []string{shardName} // Start topo server err := localCluster.StartTopo() - require.NoError(t, err) + if err != nil { + return 1, err + } + + // Start keyspace + localCluster.Keyspaces = []cluster.Keyspace{ + { + Name: keyspaceName, + Shards: []cluster.Shard{ + { + Name: shardName, + }, + }, + }, + } + shard := &localCluster.Keyspaces[0].Shards[0] + + dbCredentialFile = cluster.WriteDbCredentialToTmp(localCluster.TmpDirectory) + initDb, _ := os.ReadFile(path.Join(os.Getenv("VTROOT"), "/config/init_db.sql")) + sql := string(initDb) + newInitDBFile = path.Join(localCluster.TmpDirectory, "init_db_with_passwords.sql") + sql = sql + cluster.GetPasswordUpdateSQL(localCluster) + err = os.WriteFile(newInitDBFile, []byte(sql), 0666) + if err != nil { + return 1, err + } + + extraArgs := []string{"--db-credentials-file", dbCredentialFile} + commonTabletArg = append(commonTabletArg, "--db-credentials-file", dbCredentialFile) // Update arguments for xtrabackup if setupType == XtraBackup { @@ -108,6 +132,7 @@ func LaunchCluster(t *testing.T, setupType int, streamMode string, stripes int, xtrabackupArgs := []string{ "--backup_engine_implementation", "xtrabackup", + fmt.Sprintf("--xtrabackup_stream_mode=%s", streamMode), "--xtrabackup_user=vt_dba", fmt.Sprintf("--xtrabackup_stripes=%d", stripes), "--xtrabackup_backup_flags", fmt.Sprintf("--password=%s", dbPassword), @@ -115,35 +140,84 @@ func LaunchCluster(t *testing.T, setupType int, streamMode string, stripes int, // if streamMode is xbstream, add some additional args to test other xtrabackup flags if streamMode == "xbstream" { - xtrabackupArgs = append(xtrabackupArgs, - useXBStream, - "--xtrabackup_prepare_flags", - "--use-memory=100M", - ) - localCluster.VtTabletExtraArgs = append(localCluster.VtTabletExtraArgs, useXBStream) - localCluster.VtctldExtraArgs = append(localCluster.VtctldExtraArgs, useXBStream) - } else { - xtrabackupArgs = append(xtrabackupArgs, useTar) + xtrabackupArgs = append(xtrabackupArgs, "--xtrabackup_prepare_flags", fmt.Sprintf("--use-memory=100M")) //nolint } - localCluster.VtTabletExtraArgs = append(localCluster.VtTabletExtraArgs, xtrabackupArgs...) + commonTabletArg = append(commonTabletArg, xtrabackupArgs...) } - localCluster.VtTabletExtraArgs = append(localCluster.VtTabletExtraArgs, commonTabletArgs...) - localCluster.VtTabletExtraArgs = append(localCluster.VtTabletExtraArgs, getCompressorArgs(cDetails)...) + commonTabletArg = append(commonTabletArg, getCompressorArgs(cDetails)...) - localCluster.StartKeyspace(keyspace, shards, 2, false) - require.NoError(t, err) - localCluster.VtgateProcess.WaitForStatusOfTabletInShard("primary", 1) - localCluster.VtgateProcess.WaitForStatusOfTabletInShard("replica", 2) + var mysqlProcs []*exec.Cmd + for i := 0; i < 3; i++ { + tabletType := "replica" + if i == 0 { + tabletType = "primary" + } + tablet := localCluster.NewVttabletInstance(tabletType, 0, cell) + tablet.VttabletProcess = localCluster.VtprocessInstanceFromVttablet(tablet, shard.Name, keyspaceName) + tablet.VttabletProcess.DbPassword = dbPassword + tablet.VttabletProcess.ExtraArgs = commonTabletArg + tablet.VttabletProcess.SupportsBackup = true + tablet.VttabletProcess.EnableSemiSync = true + + if setupType == Mysqlctld { + tablet.MysqlctldProcess = *cluster.MysqlCtldProcessInstance(tablet.TabletUID, tablet.MySQLPort, localCluster.TmpDirectory) + tablet.MysqlctldProcess.InitDBFile = newInitDBFile + tablet.MysqlctldProcess.ExtraArgs = extraArgs + tablet.MysqlctldProcess.Password = tablet.VttabletProcess.DbPassword + if err := tablet.MysqlctldProcess.Start(); err != nil { + return 1, err + } + shard.Vttablets = append(shard.Vttablets, tablet) + continue + } + + tablet.MysqlctlProcess = *cluster.MysqlCtlProcessInstance(tablet.TabletUID, tablet.MySQLPort, localCluster.TmpDirectory) + tablet.MysqlctlProcess.InitDBFile = newInitDBFile + tablet.MysqlctlProcess.ExtraArgs = extraArgs + proc, err := tablet.MysqlctlProcess.StartProcess() + if err != nil { + return 1, err + } + mysqlProcs = append(mysqlProcs, proc) + + shard.Vttablets = append(shard.Vttablets, tablet) + } + for _, proc := range mysqlProcs { + if err := proc.Wait(); err != nil { + return 1, err + } + } + primary = shard.Vttablets[0] + replica1 = shard.Vttablets[1] + replica2 = shard.Vttablets[2] + if err := localCluster.VtctlclientProcess.InitTablet(primary, cell, keyspaceName, hostname, shard.Name); err != nil { + return 1, err + } + if err := localCluster.VtctlclientProcess.InitTablet(replica1, cell, keyspaceName, hostname, shard.Name); err != nil { + return 1, err + } vtctldClientProcess := cluster.VtctldClientProcessInstance("localhost", localCluster.VtctldProcess.GrpcPort, localCluster.TmpDirectory) _, err = vtctldClientProcess.ExecuteCommandWithOutput("SetKeyspaceDurabilityPolicy", keyspaceName, "--durability-policy=semi_sync") - require.NoError(t, err) + if err != nil { + return 1, err + } + + for _, tablet := range []cluster.Vttablet{*primary, *replica1} { + if err := tablet.VttabletProcess.CreateDB(keyspaceName); err != nil { + return 1, err + } + if err := tablet.VttabletProcess.Setup(); err != nil { + return 1, err + } + } - primary = localCluster.Keyspaces[0].Shards[0].Vttablets[0] - replica1 = localCluster.Keyspaces[0].Shards[0].Vttablets[1] - replica2 = localCluster.Keyspaces[0].Shards[0].Vttablets[2] + if err := localCluster.VtctlclientProcess.InitShardPrimary(keyspaceName, shard.Name, cell, primary.TabletUID); err != nil { + return 1, err + } + return 0, nil } func getCompressorArgs(cDetails *CompressionDetails) []string { @@ -187,12 +261,15 @@ func TestBackup(t *testing.T, setupType int, streamMode string, stripes int, cDe switch streamMode { case "xbstream": if vers.Major < 8 { - t.Logf("Skipping streaming xtrabackup tests as those are only tested on MySQL 8.0+") + t.Logf("Skipping xtrabackup tests with --xtrabackup_stream_mode=xbstream as those are only tested on XtraBackup/MySQL 8.0+") return nil } - case "tar": + case "", "tar": // streaming method of tar is the default for the vttablet --xtrabackup_stream_mode flag + // XtraBackup 8.0 must be used with MySQL 8.0 and it no longer supports tar as a stream method: + // https://docs.percona.com/percona-xtrabackup/2.4/innobackupex/streaming_backups_innobackupex.html + // https://docs.percona.com/percona-xtrabackup/8.0/xtrabackup_bin/backup.streaming.html if vers.Major > 5 { - t.Logf("Skipping tar based xtrabackup tests as those are no longer supported on MySQL 8.0+") + t.Logf("Skipping xtrabackup tests with --xtrabackup_stream_mode=tar as tar is no longer a streaming option in XtraBackup 8.0") return nil } default: @@ -239,7 +316,8 @@ func TestBackup(t *testing.T, setupType int, streamMode string, stripes int, cDe defer cluster.PanicHandler(t) // setup cluster for the testing - LaunchCluster(t, setupType, streamMode, stripes, cDetails) + code, err := LaunchCluster(setupType, streamMode, stripes, cDetails) + require.Nilf(t, err, "setup failed with status code %d", code) // Teardown the cluster defer TearDownCluster() @@ -293,7 +371,7 @@ func primaryBackup(t *testing.T) { localCluster.VerifyBackupCount(t, shardKsName, 0) err = localCluster.VtctlclientProcess.ExecuteCommand("Backup", "--", "--allow_primary=true", primary.Alias) - require.NoError(t, err) + require.Nil(t, err) // We'll restore this on the primary later to test restores using a backup timestamp firstBackupTimestamp := time.Now().UTC().Format(mysqlctl.BackupTimestampFormat) @@ -302,11 +380,11 @@ func primaryBackup(t *testing.T) { assert.Contains(t, backups[0], primary.Alias) _, err = primary.VttabletProcess.QueryTablet("insert into vt_insert_test (msg) values ('test2')", keyspaceName, true) - require.NoError(t, err) + require.Nil(t, err) restoreWaitForBackup(t, "replica") err = replica2.VttabletProcess.WaitForTabletStatusesForTimeout([]string{"SERVING"}, timeout) - require.NoError(t, err) + require.Nil(t, err) // Verify that we have all the new data -- we should have 2 records now... // And only 1 record after we restore using the first backup timestamp @@ -314,7 +392,7 @@ func primaryBackup(t *testing.T) { cluster.VerifyLocalMetadata(t, replica2, keyspaceName, shardName, cell) err = localCluster.VtctlclientProcess.ExecuteCommand("Backup", "--", "--allow_primary=true", primary.Alias) - require.NoError(t, err) + require.Nil(t, err) backups = localCluster.VerifyBackupCount(t, shardKsName, 2) assert.Contains(t, backups[1], primary.Alias) @@ -324,32 +402,32 @@ func primaryBackup(t *testing.T) { err = localCluster.VtctlclientProcess.ExecuteCommand("PlannedReparentShard", "--", "--keyspace_shard", shardKsName, "--new_primary", replica2.Alias) - require.NoError(t, err) + require.Nil(t, err) // Delete the current primary tablet (replica2) so that the original primary tablet (primary) can be restored from the // older/first backup w/o it replicating the subsequent insert done after the first backup was taken err = localCluster.VtctlclientProcess.ExecuteCommand("DeleteTablet", "--", "--allow_primary=true", replica2.Alias) - require.NoError(t, err) + require.Nil(t, err) err = replica2.VttabletProcess.TearDown() - require.NoError(t, err) + require.Nil(t, err) // Restore the older/first backup -- using the timestamp we saved -- on the original primary tablet (primary) err = localCluster.VtctlclientProcess.ExecuteCommand("RestoreFromBackup", "--", "--backup_timestamp", firstBackupTimestamp, primary.Alias) - require.NoError(t, err) + require.Nil(t, err) // Re-init the shard -- making the original primary tablet (primary) primary again -- for subsequent tests err = localCluster.VtctlclientProcess.InitShardPrimary(keyspaceName, shardName, cell, primary.TabletUID) - require.NoError(t, err) + require.Nil(t, err) // Verify that we don't have the record created after the older/first backup cluster.VerifyRowsInTablet(t, primary, keyspaceName, 1) cluster.VerifyLocalMetadata(t, primary, keyspaceName, shardName, cell) verifyAfterRemovingBackupNoBackupShouldBePresent(t, backups) - require.NoError(t, err) + require.Nil(t, err) _, err = primary.VttabletProcess.QueryTablet("DROP TABLE vt_insert_test", keyspaceName, true) - require.NoError(t, err) + require.Nil(t, err) } // Test a primary and replica from the same backup. @@ -362,16 +440,16 @@ func primaryReplicaSameBackup(t *testing.T) { // backup the replica err := localCluster.VtctlclientProcess.ExecuteCommand("Backup", replica1.Alias) - require.NoError(t, err) + require.Nil(t, err) // insert more data on the primary _, err = primary.VttabletProcess.QueryTablet("insert into vt_insert_test (msg) values ('test2')", keyspaceName, true) - require.NoError(t, err) + require.Nil(t, err) // now bring up the other replica, letting it restore from backup. restoreWaitForBackup(t, "replica") err = replica2.VttabletProcess.WaitForTabletStatusesForTimeout([]string{"SERVING"}, timeout) - require.NoError(t, err) + require.Nil(t, err) // check the new replica has the data cluster.VerifyRowsInTablet(t, replica2, keyspaceName, 2) @@ -380,11 +458,11 @@ func primaryReplicaSameBackup(t *testing.T) { err = localCluster.VtctlclientProcess.ExecuteCommand("PlannedReparentShard", "--", "--keyspace_shard", shardKsName, "--new_primary", replica2.Alias) - require.NoError(t, err) + require.Nil(t, err) // insert more data on replica2 (current primary) _, err = replica2.VttabletProcess.QueryTablet("insert into vt_insert_test (msg) values ('test3')", keyspaceName, true) - require.NoError(t, err) + require.Nil(t, err) // Force replica1 to restore from backup. verifyRestoreTablet(t, replica1, "SERVING") @@ -398,18 +476,18 @@ func primaryReplicaSameBackup(t *testing.T) { // // Take another backup on the replica. err = localCluster.VtctlclientProcess.ExecuteCommand("Backup", replica1.Alias) - require.NoError(t, err) + require.Nil(t, err) // Insert more data on replica2 (current primary). _, err = replica2.VttabletProcess.QueryTablet("insert into vt_insert_test (msg) values ('test4')", keyspaceName, true) - require.NoError(t, err) + require.Nil(t, err) // Force replica1 to restore from backup. verifyRestoreTablet(t, replica1, "SERVING") cluster.VerifyRowsInTablet(t, replica1, keyspaceName, 4) err = replica2.VttabletProcess.TearDown() - require.NoError(t, err) + require.Nil(t, err) restartPrimaryAndReplica(t) } @@ -442,21 +520,21 @@ func testRestoreOldPrimary(t *testing.T, method restoreMethod) { // backup the replica err := localCluster.VtctlclientProcess.ExecuteCommand("Backup", replica1.Alias) - require.NoError(t, err) + require.Nil(t, err) // insert more data on the primary _, err = primary.VttabletProcess.QueryTablet("insert into vt_insert_test (msg) values ('test2')", keyspaceName, true) - require.NoError(t, err) + require.Nil(t, err) // reparent to replica1 err = localCluster.VtctlclientProcess.ExecuteCommand("PlannedReparentShard", "--", "--keyspace_shard", shardKsName, "--new_primary", replica1.Alias) - require.NoError(t, err) + require.Nil(t, err) // insert more data to new primary _, err = replica1.VttabletProcess.QueryTablet("insert into vt_insert_test (msg) values ('test3')", keyspaceName, true) - require.NoError(t, err) + require.Nil(t, err) // force the old primary to restore at the latest backup. method(t, primary) @@ -470,13 +548,13 @@ func testRestoreOldPrimary(t *testing.T, method restoreMethod) { func restoreUsingRestart(t *testing.T, tablet *cluster.Vttablet) { err := tablet.VttabletProcess.TearDown() - require.NoError(t, err) + require.Nil(t, err) verifyRestoreTablet(t, tablet, "SERVING") } func restoreInPlace(t *testing.T, tablet *cluster.Vttablet) { err := localCluster.VtctlclientProcess.ExecuteCommand("RestoreFromBackup", tablet.Alias) - require.NoError(t, err) + require.Nil(t, err) } func restartPrimaryAndReplica(t *testing.T) { @@ -490,7 +568,7 @@ func restartPrimaryAndReplica(t *testing.T) { for _, tablet := range []*cluster.Vttablet{primary, replica1, replica2} { if tablet.MysqlctldProcess.TabletUID > 0 { err := tablet.MysqlctldProcess.Start() - require.NoErrorf(t, err, "error while starting mysqlctld, tabletUID %v", tablet.TabletUID) + require.Nilf(t, err, "error while starting mysqlctld, tabletUID %v", tablet.TabletUID) continue } proc, _ := tablet.MysqlctlProcess.StartProcess() @@ -501,14 +579,14 @@ func restartPrimaryAndReplica(t *testing.T) { } for _, tablet := range []*cluster.Vttablet{primary, replica1} { err := localCluster.VtctlclientProcess.InitTablet(tablet, cell, keyspaceName, hostname, shardName) - require.NoError(t, err) + require.Nil(t, err) err = tablet.VttabletProcess.CreateDB(keyspaceName) - require.NoError(t, err) + require.Nil(t, err) err = tablet.VttabletProcess.Setup() - require.NoError(t, err) + require.Nil(t, err) } err := localCluster.VtctlclientProcess.InitShardPrimary(keyspaceName, shardName, cell, primary.TabletUID) - require.NoError(t, err) + require.Nil(t, err) } func stopAllTablets() { @@ -543,33 +621,33 @@ func terminatedRestore(t *testing.T) { // backup the replica err := localCluster.VtctlclientProcess.ExecuteCommand("Backup", replica1.Alias) - require.NoError(t, err) + require.Nil(t, err) // insert more data on the primary _, err = primary.VttabletProcess.QueryTablet("insert into vt_insert_test (msg) values ('test2')", keyspaceName, true) - require.NoError(t, err) + require.Nil(t, err) // reparent to replica1 err = localCluster.VtctlclientProcess.ExecuteCommand("PlannedReparentShard", "--", "--keyspace_shard", shardKsName, "--new_primary", replica1.Alias) - require.NoError(t, err) + require.Nil(t, err) // insert more data to new primary _, err = replica1.VttabletProcess.QueryTablet("insert into vt_insert_test (msg) values ('test3')", keyspaceName, true) - require.NoError(t, err) + require.Nil(t, err) terminateRestore(t) err = localCluster.VtctlclientProcess.ExecuteCommand("RestoreFromBackup", primary.Alias) - require.NoError(t, err) + require.Nil(t, err) output, err := localCluster.VtctlclientProcess.ExecuteCommandWithOutput("GetTablet", primary.Alias) - require.NoError(t, err) + require.Nil(t, err) var tabletPB topodata.Tablet err = json.Unmarshal([]byte(output), &tabletPB) - require.NoError(t, err) + require.Nil(t, err) assert.Equal(t, tabletPB.Type, topodata.TabletType_REPLICA) _, err = os.Stat(path.Join(primary.VttabletProcess.Directory, "restore_in_progress")) @@ -599,36 +677,36 @@ func vtctlBackup(t *testing.T, tabletType string) { verifyInitialReplication(t) err := localCluster.VtctlclientProcess.ExecuteCommand("Backup", replica1.Alias) - require.NoError(t, err) + require.Nil(t, err) backups := localCluster.VerifyBackupCount(t, shardKsName, 1) _, err = primary.VttabletProcess.QueryTablet("insert into vt_insert_test (msg) values ('test2')", keyspaceName, true) - require.NoError(t, err) + require.Nil(t, err) - err = replica2.VttabletProcess.WaitForTabletStatusesForTimeout([]string{"SERVING"}, timeout) - require.NoError(t, err) + err = replica2.VttabletProcess.WaitForTabletStatusesForTimeout([]string{"SERVING"}, 25*time.Second) + require.Nil(t, err) cluster.VerifyRowsInTablet(t, replica2, keyspaceName, 2) cluster.VerifyLocalMetadata(t, replica2, keyspaceName, shardName, cell) verifyAfterRemovingBackupNoBackupShouldBePresent(t, backups) err = replica2.VttabletProcess.TearDown() - require.NoError(t, err) + require.Nil(t, err) err = localCluster.VtctlclientProcess.ExecuteCommand("DeleteTablet", replica2.Alias) - require.NoError(t, err) + require.Nil(t, err) _, err = primary.VttabletProcess.QueryTablet("DROP TABLE vt_insert_test", keyspaceName, true) - require.NoError(t, err) + require.Nil(t, err) } // This will create schema in primary, insert some data to primary and verify the same data in replica func verifyInitialReplication(t *testing.T) { _, err := primary.VttabletProcess.QueryTablet(vtInsertTest, keyspaceName, true) - require.NoError(t, err) + require.Nil(t, err) _, err = primary.VttabletProcess.QueryTablet("insert into vt_insert_test (msg) values ('test1')", keyspaceName, true) - require.NoError(t, err) + require.Nil(t, err) cluster.VerifyRowsInTablet(t, replica1, keyspaceName, 1) } @@ -641,21 +719,21 @@ func verifyInitialReplication(t *testing.T) { func restoreWaitForBackup(t *testing.T, tabletType string) { replica2.Type = tabletType replica2.ValidateTabletRestart(t) - replicaTabletArgs := commonTabletArgs + replicaTabletArgs := commonTabletArg replicaTabletArgs = append(replicaTabletArgs, "--backup_engine_implementation", "fake_implementation") replicaTabletArgs = append(replicaTabletArgs, "--wait_for_backup_interval", "1s") replicaTabletArgs = append(replicaTabletArgs, "--init_tablet_type", tabletType) replica2.VttabletProcess.ExtraArgs = replicaTabletArgs replica2.VttabletProcess.ServingStatus = "" err := replica2.VttabletProcess.Setup() - require.NoError(t, err) + require.Nil(t, err) } func verifyAfterRemovingBackupNoBackupShouldBePresent(t *testing.T, backups []string) { // Remove the backup for _, backup := range backups { err := localCluster.VtctlclientProcess.ExecuteCommand("RemoveBackup", shardKsName, backup) - require.NoError(t, err) + require.Nil(t, err) } // Now, there should not be no backup @@ -663,13 +741,14 @@ func verifyAfterRemovingBackupNoBackupShouldBePresent(t *testing.T, backups []st } func verifyRestoreTablet(t *testing.T, tablet *cluster.Vttablet, status string) { + tablet.ValidateTabletRestart(t) tablet.VttabletProcess.ServingStatus = "" err := tablet.VttabletProcess.Setup() - require.NoError(t, err) + require.Nil(t, err) if status != "" { - err = tablet.VttabletProcess.WaitForTabletStatusesForTimeout([]string{status}, timeout) - require.NoError(t, err) + err = tablet.VttabletProcess.WaitForTabletStatusesForTimeout([]string{status}, 25*time.Second) + require.Nil(t, err) } // We restart replication here because semi-sync will not be set correctly on tablet startup since // we deprecated enable_semi_sync. StartReplication RPC fixes the semi-sync settings by consulting the @@ -688,10 +767,10 @@ func verifyRestoreTablet(t *testing.T, tablet *cluster.Vttablet, status string) func verifySemiSyncStatus(t *testing.T, vttablet *cluster.Vttablet, expectedStatus string) { status, err := vttablet.VttabletProcess.GetDBVar("rpl_semi_sync_slave_enabled", keyspaceName) - require.NoError(t, err) + require.Nil(t, err) assert.Equal(t, status, expectedStatus) status, err = vttablet.VttabletProcess.GetDBStatus("rpl_semi_sync_slave_status", keyspaceName) - require.NoError(t, err) + require.Nil(t, err) assert.Equal(t, status, expectedStatus) } @@ -710,7 +789,7 @@ func terminateRestore(t *testing.T) { reader, _ := tmpProcess.StderrPipe() err := tmpProcess.Start() - require.NoError(t, err) + require.Nil(t, err) found := false scanner := bufio.NewScanner(reader) diff --git a/test/config.json b/test/config.json index 795da7d1f73..65dd26aa05d 100644 --- a/test/config.json +++ b/test/config.json @@ -93,7 +93,7 @@ }, "backup": { "File": "unused.go", - "Args": ["vitess.io/vitess/go/test/endtoend/backup/vtctlbackup", "-timeout", "45m"], + "Args": ["vitess.io/vitess/go/test/endtoend/backup/vtctlbackup", "-timeout", "30m"], "Command": [], "Manual": false, "Shard": "vtctlbackup_sharded_clustertest_heavy", From eeee707df080f669899fe5a64003afb181a2b830 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Thu, 14 Jul 2022 18:55:21 -0400 Subject: [PATCH 23/25] Use 45m timeout for the workflow, 30m for the run. Signed-off-by: Matt Lord --- .github/workflows/cluster_endtoend_mysql80.yml | 2 +- .../cluster_endtoend_onlineddl_declarative_mysql80.yml | 2 +- .github/workflows/cluster_endtoend_onlineddl_ghost_mysql80.yml | 2 +- .github/workflows/cluster_endtoend_onlineddl_revert_mysql80.yml | 2 +- .../workflows/cluster_endtoend_onlineddl_revertible_mysql80.yml | 2 +- .../workflows/cluster_endtoend_onlineddl_scheduler_mysql80.yml | 2 +- .../workflows/cluster_endtoend_onlineddl_singleton_mysql80.yml | 2 +- .github/workflows/cluster_endtoend_onlineddl_vrepl_mysql80.yml | 2 +- .../cluster_endtoend_onlineddl_vrepl_stress_mysql80.yml | 2 +- .../cluster_endtoend_onlineddl_vrepl_stress_suite_mysql80.yml | 2 +- .../cluster_endtoend_onlineddl_vrepl_suite_mysql80.yml | 2 +- .github/workflows/cluster_endtoend_schemadiff_vrepl_mysql80.yml | 2 +- .../cluster_endtoend_tabletmanager_tablegc_mysql80.yml | 2 +- .../cluster_endtoend_vreplication_across_db_versions.yml | 2 +- .github/workflows/cluster_endtoend_vtbackup_transform.yml | 2 +- .github/workflows/cluster_endtoend_vtorc_8.0.yml | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cluster_endtoend_mysql80.yml b/.github/workflows/cluster_endtoend_mysql80.yml index 73f4bc38a47..e4a80c95220 100644 --- a/.github/workflows/cluster_endtoend_mysql80.yml +++ b/.github/workflows/cluster_endtoend_mysql80.yml @@ -15,7 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (mysql80) runs-on: ubuntu-20.04 - timeout-minutes: 30 + timeout-minutes: 45 steps: - name: Check out code diff --git a/.github/workflows/cluster_endtoend_onlineddl_declarative_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_declarative_mysql80.yml index bdb7c086b89..bb27067b1d6 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_declarative_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_declarative_mysql80.yml @@ -15,7 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (onlineddl_declarative) mysql80 runs-on: ubuntu-20.04 - timeout-minutes: 30 + timeout-minutes: 45 steps: - name: Check out code diff --git a/.github/workflows/cluster_endtoend_onlineddl_ghost_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_ghost_mysql80.yml index 4007238ef40..bb93c5819d2 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_ghost_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_ghost_mysql80.yml @@ -15,7 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (onlineddl_ghost) mysql80 runs-on: ubuntu-20.04 - timeout-minutes: 30 + timeout-minutes: 45 steps: - name: Check out code diff --git a/.github/workflows/cluster_endtoend_onlineddl_revert_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_revert_mysql80.yml index 794876776e1..f9bbb15c7ea 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_revert_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_revert_mysql80.yml @@ -15,7 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (onlineddl_revert) mysql80 runs-on: ubuntu-20.04 - timeout-minutes: 30 + timeout-minutes: 45 steps: - name: Check out code diff --git a/.github/workflows/cluster_endtoend_onlineddl_revertible_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_revertible_mysql80.yml index 3318fbc45bb..5b2e600de61 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_revertible_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_revertible_mysql80.yml @@ -15,7 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (onlineddl_revertible) mysql80 runs-on: ubuntu-20.04 - timeout-minutes: 30 + timeout-minutes: 45 steps: - name: Check out code diff --git a/.github/workflows/cluster_endtoend_onlineddl_scheduler_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_scheduler_mysql80.yml index d565071d844..d5232ef4347 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_scheduler_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_scheduler_mysql80.yml @@ -15,7 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (onlineddl_scheduler) mysql80 runs-on: ubuntu-20.04 - timeout-minutes: 30 + timeout-minutes: 45 steps: - name: Check out code diff --git a/.github/workflows/cluster_endtoend_onlineddl_singleton_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_singleton_mysql80.yml index e63122364eb..0a7f4767f2c 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_singleton_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_singleton_mysql80.yml @@ -15,7 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (onlineddl_singleton) mysql80 runs-on: ubuntu-20.04 - timeout-minutes: 30 + timeout-minutes: 45 steps: - name: Check out code diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql80.yml index c8974f10394..354dc70ed7a 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql80.yml @@ -15,7 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (onlineddl_vrepl) mysql80 runs-on: ubuntu-20.04 - timeout-minutes: 30 + timeout-minutes: 45 steps: - name: Check out code diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_mysql80.yml index 29358d6ced0..23844578470 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_mysql80.yml @@ -15,7 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (onlineddl_vrepl_stress) mysql80 runs-on: ubuntu-20.04 - timeout-minutes: 30 + timeout-minutes: 45 steps: - name: Check out code diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite_mysql80.yml index 717c532adfd..a0fae9df35b 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite_mysql80.yml @@ -15,7 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (onlineddl_vrepl_stress_suite) mysql80 runs-on: ubuntu-20.04 - timeout-minutes: 30 + timeout-minutes: 45 steps: - name: Check out code diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite_mysql80.yml index 848718fd865..fade18be3a9 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite_mysql80.yml @@ -15,7 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (onlineddl_vrepl_suite) mysql80 runs-on: ubuntu-20.04 - timeout-minutes: 30 + timeout-minutes: 45 steps: - name: Check out code diff --git a/.github/workflows/cluster_endtoend_schemadiff_vrepl_mysql80.yml b/.github/workflows/cluster_endtoend_schemadiff_vrepl_mysql80.yml index adbb8591d58..5a320bbabad 100644 --- a/.github/workflows/cluster_endtoend_schemadiff_vrepl_mysql80.yml +++ b/.github/workflows/cluster_endtoend_schemadiff_vrepl_mysql80.yml @@ -15,7 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (schemadiff_vrepl) mysql80 runs-on: ubuntu-20.04 - timeout-minutes: 30 + timeout-minutes: 45 steps: - name: Check out code diff --git a/.github/workflows/cluster_endtoend_tabletmanager_tablegc_mysql80.yml b/.github/workflows/cluster_endtoend_tabletmanager_tablegc_mysql80.yml index 498e55b5ca3..6a80ac68480 100644 --- a/.github/workflows/cluster_endtoend_tabletmanager_tablegc_mysql80.yml +++ b/.github/workflows/cluster_endtoend_tabletmanager_tablegc_mysql80.yml @@ -15,7 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (tabletmanager_tablegc) mysql80 runs-on: ubuntu-20.04 - timeout-minutes: 30 + timeout-minutes: 45 steps: - name: Check out code diff --git a/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml b/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml index 2b938dd9775..14139eb1514 100644 --- a/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml +++ b/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml @@ -15,7 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (vreplication_across_db_versions) runs-on: ubuntu-20.04 - timeout-minutes: 30 + timeout-minutes: 45 steps: - name: Check out code diff --git a/.github/workflows/cluster_endtoend_vtbackup_transform.yml b/.github/workflows/cluster_endtoend_vtbackup_transform.yml index 404e5d2f98e..9745646fe11 100644 --- a/.github/workflows/cluster_endtoend_vtbackup_transform.yml +++ b/.github/workflows/cluster_endtoend_vtbackup_transform.yml @@ -15,7 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (vtbackup_transform) runs-on: ubuntu-20.04 - timeout-minutes: 30 + timeout-minutes: 45 steps: - name: Check out code diff --git a/.github/workflows/cluster_endtoend_vtorc_8.0.yml b/.github/workflows/cluster_endtoend_vtorc_8.0.yml index 00208676200..74d0bf60e0a 100644 --- a/.github/workflows/cluster_endtoend_vtorc_8.0.yml +++ b/.github/workflows/cluster_endtoend_vtorc_8.0.yml @@ -15,7 +15,7 @@ jobs: build: name: Run endtoend tests on Cluster (vtorc_8.0) runs-on: ubuntu-20.04 - timeout-minutes: 30 + timeout-minutes: 45 steps: - name: Check out code From 0c9303de8a17d22f67694e10b37554b6542c6728 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Thu, 14 Jul 2022 19:06:17 -0400 Subject: [PATCH 24/25] These changes were no longer needed so limiting diff. Signed-off-by: Matt Lord --- go/test/endtoend/backup/vtbackup/main_test.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/go/test/endtoend/backup/vtbackup/main_test.go b/go/test/endtoend/backup/vtbackup/main_test.go index 6fc868ba479..ce0720e77c4 100644 --- a/go/test/endtoend/backup/vtbackup/main_test.go +++ b/go/test/endtoend/backup/vtbackup/main_test.go @@ -21,6 +21,7 @@ import ( "fmt" "os" "os/exec" + "path" "testing" "vitess.io/vitess/go/test/endtoend/cluster" @@ -37,7 +38,7 @@ var ( hostname = "localhost" keyspaceName = "ks" shardName = "0" - dbPassword = "" + dbPassword = "VtDbaPass" shardKsName = fmt.Sprintf("%s/%s", keyspaceName, shardName) dbCredentialFile string commonTabletArg = []string{ @@ -83,6 +84,21 @@ func TestMain(m *testing.M) { return 1, err } + // Create a new init_db.sql file that sets up passwords for all users. + // Then we use a db-credentials-file with the passwords. + dbCredentialFile = cluster.WriteDbCredentialToTmp(localCluster.TmpDirectory) + initDb, _ := os.ReadFile(path.Join(os.Getenv("VTROOT"), "/config/init_db.sql")) + sql := string(initDb) + newInitDBFile = path.Join(localCluster.TmpDirectory, "init_db_with_passwords.sql") + sql = sql + cluster.GetPasswordUpdateSQL(localCluster) + err = os.WriteFile(newInitDBFile, []byte(sql), 0666) + if err != nil { + return 1, err + } + + extraArgs := []string{"--db-credentials-file", dbCredentialFile} + commonTabletArg = append(commonTabletArg, "--db-credentials-file", dbCredentialFile) + primary = localCluster.NewVttabletInstance("replica", 0, "") replica1 = localCluster.NewVttabletInstance("replica", 0, "") replica2 = localCluster.NewVttabletInstance("replica", 0, "") @@ -99,6 +115,7 @@ func TestMain(m *testing.M) { tablet.MysqlctlProcess = *cluster.MysqlCtlProcessInstance(tablet.TabletUID, tablet.MySQLPort, localCluster.TmpDirectory) tablet.MysqlctlProcess.InitDBFile = newInitDBFile + tablet.MysqlctlProcess.ExtraArgs = extraArgs proc, err := tablet.MysqlctlProcess.StartProcess() if err != nil { return 1, err From 5ab4af7fa3d06672c2b08ab84b03321b40807bbe Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 20 Jul 2022 10:52:16 -0400 Subject: [PATCH 25/25] Explicitly skip new linter check Signed-off-by: Matt Lord --- go/mysql/collations/tools/makecolldata/contractions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/mysql/collations/tools/makecolldata/contractions.go b/go/mysql/collations/tools/makecolldata/contractions.go index 8ac5b27c328..ef8a08fe27d 100644 --- a/go/mysql/collations/tools/makecolldata/contractions.go +++ b/go/mysql/collations/tools/makecolldata/contractions.go @@ -58,7 +58,7 @@ func printContraction1(g *codegen.Generator, wa *weightarray, incont []uca.Contr trie[r] = append(trie[r], cont) } if depth == len(cont.Path) { - leaf = &cont + leaf = &cont // nolint:exportloopref } }