From e4d7f05c100275c127e44b867e0fe69e95bd8b2c Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Mon, 15 Jul 2024 20:21:39 +0200 Subject: [PATCH 1/3] `slack-15.0`: fix crash in `vtbench` (#451) Signed-off-by: Tim Vaillancourt --- go/cmd/vtbench/vtbench.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/go/cmd/vtbench/vtbench.go b/go/cmd/vtbench/vtbench.go index 13c024fdd8e..d1b67cc4314 100644 --- a/go/cmd/vtbench/vtbench.go +++ b/go/cmd/vtbench/vtbench.go @@ -103,10 +103,7 @@ func initFlags(fs *pflag.FlagSet) { fs.StringVar(&sql, "sql", sql, "SQL statement to execute") fs.IntVar(&threads, "threads", threads, "Number of parallel threads to run") fs.IntVar(&count, "count", count, "Number of queries per thread") - grpccommon.RegisterFlags(fs) - log.RegisterFlags(fs) - logutil.RegisterFlags(fs) acl.RegisterFlags(fs) servenv.RegisterMySQLServerFlags(fs) } From 106be4cf6283e6621c86a9fbd049a4bd6ce19f6e Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Thu, 18 Jul 2024 20:25:50 +0200 Subject: [PATCH 2/3] percona-xtrabackup-24 problem fix attempt 2 (#460) Signed-off-by: Tim Vaillancourt --- .github/workflows/codeql_analysis.yml | 1 + .github/workflows/upgrade_downgrade_test_backups_e2e.yml | 1 + .../upgrade_downgrade_test_backups_e2e_next_release.yml | 1 + .github/workflows/upgrade_downgrade_test_backups_manual.yml | 1 + .../upgrade_downgrade_test_backups_manual_next_release.yml | 1 + .../workflows/upgrade_downgrade_test_query_serving_queries.yml | 1 + ...upgrade_downgrade_test_query_serving_queries_next_release.yml | 1 + .../workflows/upgrade_downgrade_test_query_serving_schema.yml | 1 + .../upgrade_downgrade_test_query_serving_schema_next_release.yml | 1 + .github/workflows/upgrade_downgrade_test_reparent_new_vtctl.yml | 1 + .../workflows/upgrade_downgrade_test_reparent_new_vttablet.yml | 1 + .github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml | 1 + .../workflows/upgrade_downgrade_test_reparent_old_vttablet.yml | 1 + test/templates/cluster_endtoend_test_mysql57.tpl | 1 + test/templates/dockerfile.tpl | 1 + 15 files changed, 15 insertions(+) diff --git a/.github/workflows/codeql_analysis.yml b/.github/workflows/codeql_analysis.yml index 327e59e8791..969af82038d 100644 --- a/.github/workflows/codeql_analysis.yml +++ b/.github/workflows/codeql_analysis.yml @@ -75,6 +75,7 @@ jobs: 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 percona-release enable-only pxb-24 sudo apt-get update sudo apt-get install -y percona-xtrabackup-24 diff --git a/.github/workflows/upgrade_downgrade_test_backups_e2e.yml b/.github/workflows/upgrade_downgrade_test_backups_e2e.yml index 5435f1dac70..2853f76f45b 100644 --- a/.github/workflows/upgrade_downgrade_test_backups_e2e.yml +++ b/.github/workflows/upgrade_downgrade_test_backups_e2e.yml @@ -108,6 +108,7 @@ jobs: 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 percona-release enable-only pxb-24 sudo apt-get update sudo apt-get install -y percona-xtrabackup-24 diff --git a/.github/workflows/upgrade_downgrade_test_backups_e2e_next_release.yml b/.github/workflows/upgrade_downgrade_test_backups_e2e_next_release.yml index 4965eebdd94..4f05cf9144b 100644 --- a/.github/workflows/upgrade_downgrade_test_backups_e2e_next_release.yml +++ b/.github/workflows/upgrade_downgrade_test_backups_e2e_next_release.yml @@ -111,6 +111,7 @@ jobs: 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 percona-release enable-only pxb-24 sudo apt-get update sudo apt-get install -y percona-xtrabackup-24 diff --git a/.github/workflows/upgrade_downgrade_test_backups_manual.yml b/.github/workflows/upgrade_downgrade_test_backups_manual.yml index c0d562b8471..e5a6603a3e8 100644 --- a/.github/workflows/upgrade_downgrade_test_backups_manual.yml +++ b/.github/workflows/upgrade_downgrade_test_backups_manual.yml @@ -128,6 +128,7 @@ jobs: 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 percona-release enable-only pxb-24 sudo apt-get update sudo apt-get install -y percona-xtrabackup-24 diff --git a/.github/workflows/upgrade_downgrade_test_backups_manual_next_release.yml b/.github/workflows/upgrade_downgrade_test_backups_manual_next_release.yml index f412a21e278..38a2236e74c 100644 --- a/.github/workflows/upgrade_downgrade_test_backups_manual_next_release.yml +++ b/.github/workflows/upgrade_downgrade_test_backups_manual_next_release.yml @@ -131,6 +131,7 @@ jobs: 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 percona-release enable-only pxb-24 sudo apt-get update sudo apt-get install -y percona-xtrabackup-24 diff --git a/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml b/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml index 142b7587f4e..204ef44f4fa 100644 --- a/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml +++ b/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml @@ -126,6 +126,7 @@ jobs: 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 percona-release enable-only pxb-24 sudo apt-get update sudo apt-get install -y percona-xtrabackup-24 diff --git a/.github/workflows/upgrade_downgrade_test_query_serving_queries_next_release.yml b/.github/workflows/upgrade_downgrade_test_query_serving_queries_next_release.yml index 277a4968c92..6a6f6850552 100644 --- a/.github/workflows/upgrade_downgrade_test_query_serving_queries_next_release.yml +++ b/.github/workflows/upgrade_downgrade_test_query_serving_queries_next_release.yml @@ -129,6 +129,7 @@ jobs: 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 percona-release enable-only pxb-24 sudo apt-get update sudo apt-get install -y percona-xtrabackup-24 diff --git a/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml b/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml index 2727f4186e6..e4787a5facf 100644 --- a/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml +++ b/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml @@ -126,6 +126,7 @@ jobs: 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 percona-release enable-only pxb-24 sudo apt-get update sudo apt-get install -y percona-xtrabackup-24 diff --git a/.github/workflows/upgrade_downgrade_test_query_serving_schema_next_release.yml b/.github/workflows/upgrade_downgrade_test_query_serving_schema_next_release.yml index b7a5b27e5a4..3c1b3d476f2 100644 --- a/.github/workflows/upgrade_downgrade_test_query_serving_schema_next_release.yml +++ b/.github/workflows/upgrade_downgrade_test_query_serving_schema_next_release.yml @@ -128,6 +128,7 @@ jobs: 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 percona-release enable-only pxb-24 sudo apt-get update sudo apt-get install -y percona-xtrabackup-24 diff --git a/.github/workflows/upgrade_downgrade_test_reparent_new_vtctl.yml b/.github/workflows/upgrade_downgrade_test_reparent_new_vtctl.yml index 3d04420dee1..5eb8f222587 100644 --- a/.github/workflows/upgrade_downgrade_test_reparent_new_vtctl.yml +++ b/.github/workflows/upgrade_downgrade_test_reparent_new_vtctl.yml @@ -129,6 +129,7 @@ jobs: 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 percona-release enable-only pxb-24 sudo apt-get update sudo apt-get install -y percona-xtrabackup-24 diff --git a/.github/workflows/upgrade_downgrade_test_reparent_new_vttablet.yml b/.github/workflows/upgrade_downgrade_test_reparent_new_vttablet.yml index c95f650816b..d63e2fa2d56 100644 --- a/.github/workflows/upgrade_downgrade_test_reparent_new_vttablet.yml +++ b/.github/workflows/upgrade_downgrade_test_reparent_new_vttablet.yml @@ -129,6 +129,7 @@ jobs: 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 percona-release enable-only pxb-24 sudo apt-get update sudo apt-get install -y percona-xtrabackup-24 diff --git a/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml b/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml index dfd95bdc8b8..3f8ac4c3045 100644 --- a/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml +++ b/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml @@ -126,6 +126,7 @@ jobs: 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 percona-release enable-only pxb-24 sudo apt-get update sudo apt-get install -y percona-xtrabackup-24 diff --git a/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml b/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml index 9050d0e3625..4166ec2bb7c 100644 --- a/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml +++ b/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml @@ -126,6 +126,7 @@ jobs: 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 percona-release enable-only pxb-24 sudo apt-get update sudo apt-get install -y percona-xtrabackup-24 diff --git a/test/templates/cluster_endtoend_test_mysql57.tpl b/test/templates/cluster_endtoend_test_mysql57.tpl index ed41e4d45b5..9741b789ef0 100644 --- a/test/templates/cluster_endtoend_test_mysql57.tpl +++ b/test/templates/cluster_endtoend_test_mysql57.tpl @@ -114,6 +114,7 @@ jobs: 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 percona-release enable-only pxb-24 sudo apt-get update if [[ -n $XTRABACKUP_VERSION ]]; then debfile="percona-xtrabackup-24_$XTRABACKUP_VERSION.$(lsb_release -sc)_amd64.deb" diff --git a/test/templates/dockerfile.tpl b/test/templates/dockerfile.tpl index 34e71bea774..c83ba3f7520 100644 --- a/test/templates/dockerfile.tpl +++ b/test/templates/dockerfile.tpl @@ -15,6 +15,7 @@ RUN wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_ RUN apt-get update RUN apt-get install -y gnupg2 RUN dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb +RUN percona-release enable-only pxb-24 RUN apt-get update RUN apt-get install -y percona-xtrabackup-24 {{end}} From 1b333dbed4dd57b40aeee952d76451921390910a Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Mon, 29 Jul 2024 17:44:25 +0200 Subject: [PATCH 3/3] `slack-15.0`: reset semi-sync in `setReplicationSourceRepairReplication` (#442) * `slack-15.0`: reset semi-sync in `setReplicationSourceRepairReplication` Signed-off-by: Tim Vaillancourt * reorder shard lock Signed-off-by: Tim Vaillancourt * try 100% percona-xtrabackup-80 Signed-off-by: Tim Vaillancourt * Revert "try 100% percona-xtrabackup-80" This reverts commit e67be76f3a223b529bb72acb452fc321a83d3808. * percona-xtrabackup-24 problem fix attempt 2 Signed-off-by: Tim Vaillancourt * remove currentPrimary Signed-off-by: Tim Vaillancourt * empty commit to fix CI --------- Signed-off-by: Tim Vaillancourt --- .../vttablet/tabletmanager/rpc_replication.go | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/go/vt/vttablet/tabletmanager/rpc_replication.go b/go/vt/vttablet/tabletmanager/rpc_replication.go index 3ef6b543f3c..2adde1a1bed 100644 --- a/go/vt/vttablet/tabletmanager/rpc_replication.go +++ b/go/vt/vttablet/tabletmanager/rpc_replication.go @@ -31,6 +31,7 @@ import ( "vitess.io/vitess/go/vt/mysqlctl" "vitess.io/vitess/go/vt/servenv" "vitess.io/vitess/go/vt/topo/topoproto" + "vitess.io/vitess/go/vt/vtctl/reparentutil" "vitess.io/vitess/go/vt/vterrors" replicationdatapb "vitess.io/vitess/go/vt/proto/replicationdata" @@ -706,6 +707,23 @@ func (tm *TabletManager) setReplicationSourceRepairReplication(ctx context.Conte return err } + durabilityName, err := tm.TopoServer.GetKeyspaceDurability(ctx, tm.Tablet().Keyspace) + if err != nil { + return vterrors.Wrapf(err, "cannot read keyspace durability policy %v", tm.Tablet().Keyspace) + } + log.Infof("Getting a new durability policy for %v", durabilityName) + durability, err := reparentutil.GetDurabilityPolicy(durabilityName) + if err != nil { + return vterrors.Wrapf(err, "cannot get durability policy %v", durabilityName) + } + + // If using semi-sync, we need to enable it before connecting to primary. + // We should set the correct type, since it is used in replica semi-sync. + semiSyncAction, err := tm.convertBoolToSemiSyncAction(reparentutil.IsReplicaSemiSync(durability, parent.Tablet, tm.Tablet())) + if err != nil { + return err + } + ctx, unlock, lockErr := tm.TopoServer.LockShard(ctx, parent.Tablet.GetKeyspace(), parent.Tablet.GetShard(), fmt.Sprintf("repairReplication to %v as parent)", topoproto.TabletAliasString(parentAlias))) if lockErr != nil { return lockErr @@ -713,7 +731,7 @@ func (tm *TabletManager) setReplicationSourceRepairReplication(ctx context.Conte defer unlock(&err) - return tm.setReplicationSourceLocked(ctx, parentAlias, timeCreatedNS, waitPosition, forceStartReplication, SemiSyncActionNone) + return tm.setReplicationSourceLocked(ctx, parentAlias, timeCreatedNS, waitPosition, forceStartReplication, semiSyncAction) } func (tm *TabletManager) setReplicationSourceSemiSyncNoAction(ctx context.Context, parentAlias *topodatapb.TabletAlias, timeCreatedNS int64, waitPosition string, forceStartReplication bool) error {