From b08223455327a6a82408f6fe1af1553172d69904 Mon Sep 17 00:00:00 2001 From: "vitess-bot[bot]" <108069721+vitess-bot[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 12:48:20 +0200 Subject: [PATCH] Cherry-pick 8952b5af4e10c42b6ef366f2118428d31fe6eb29 with conflicts --- go/vt/vttablet/onlineddl/executor.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/go/vt/vttablet/onlineddl/executor.go b/go/vt/vttablet/onlineddl/executor.go index 5dd1811affd..c7f271dd1a4 100644 --- a/go/vt/vttablet/onlineddl/executor.go +++ b/go/vt/vttablet/onlineddl/executor.go @@ -966,9 +966,22 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream, sh lockConn, err := e.pool.Get(ctx, nil) if err != nil { +<<<<<<< HEAD return err } defer lockConn.Recycle() +======= + return vterrors.Wrapf(err, "failed getting locking connection") + } + defer lockConn.Recycle() + // Set large enough `@@lock_wait_timeout` so that it does not interfere with the cut-over operation. + // The code will ensure everything that needs to be terminated by `migrationCutOverThreshold` will be terminated. + lockConnRestoreLockWaitTimeout, err := e.initConnectionLockWaitTimeout(ctx, lockConn.Conn, 5*migrationCutOverThreshold) + if err != nil { + return vterrors.Wrapf(err, "failed setting lock_wait_timeout on locking connection") + } + defer lockConnRestoreLockWaitTimeout() +>>>>>>> 8952b5af4e (Online DDL: fix defer function, potential connection pool exhaustion (#17207)) defer lockConn.Conn.Exec(ctx, sqlUnlockTables, 1, false) renameCompleteChan := make(chan error)