Skip to content

Commit

Permalink
Online DDL: fix defer function, potential connection pool exhaustion (v…
Browse files Browse the repository at this point in the history
…itessio#17207)

Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Renan Rangel <[email protected]>
  • Loading branch information
shlomi-noach authored and rvrangel committed Nov 21, 2024
1 parent a16af51 commit a3255b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion go/vt/vttablet/onlineddl/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -967,13 +967,13 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream, sh
if err != nil {
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 lockConn.Recycle()
defer lockConnRestoreLockWaitTimeout()
defer lockConn.Conn.Exec(ctx, sqlUnlockTables, 1, false)

Expand Down

0 comments on commit a3255b7

Please sign in to comment.