Skip to content

Commit c660492

Browse files
reorder
Signed-off-by: Tim Vaillancourt <[email protected]>
1 parent d0854d6 commit c660492

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

go/logic/applier.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ func (this *Applier) CreateAtomicCutOverSentryTable() error {
940940
// InitAtomicCutOverWaitTimeout sets the cut-over session wait_timeout in order to reduce the
941941
// time an unresponsive (but still connected) gh-ost process can hold the cut-over lock.
942942
func (this *Applier) InitAtomicCutOverWaitTimeout(tx *gosql.Tx) error {
943-
cutOverWaitTimeoutSeconds := this.migrationContext.CutOverLockTimeoutSeconds * 2
943+
cutOverWaitTimeoutSeconds := this.migrationContext.CutOverLockTimeoutSeconds * 3
944944
this.migrationContext.Log.Infof("Setting cut-over idle timeout as %d seconds", cutOverWaitTimeoutSeconds)
945945
query := fmt.Sprintf(`set /* gh-ost */ session wait_timeout:=%d`, cutOverWaitTimeoutSeconds)
946946
_, err := tx.Exec(query)
@@ -998,16 +998,16 @@ func (this *Applier) AtomicCutOverMagicLock(sessionIdChan chan int64, tableLocke
998998
return err
999999
}
10001000

1001-
if err := this.InitAtomicCutOverWaitTimeout(tx); err != nil {
1001+
if err := this.CreateAtomicCutOverSentryTable(); err != nil {
10021002
tableLocked <- err
10031003
return err
10041004
}
1005-
defer this.RevertAtomicCutOverWaitTimeout()
10061005

1007-
if err := this.CreateAtomicCutOverSentryTable(); err != nil {
1006+
if err := this.InitAtomicCutOverWaitTimeout(tx); err != nil {
10081007
tableLocked <- err
10091008
return err
10101009
}
1010+
defer this.RevertAtomicCutOverWaitTimeout()
10111011

10121012
query = fmt.Sprintf(`lock /* gh-ost */ tables %s.%s write, %s.%s write`,
10131013
sql.EscapeName(this.migrationContext.DatabaseName),

0 commit comments

Comments
 (0)