File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff 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.
942942func (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 ),
You can’t perform that action at this time.
0 commit comments