-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Prevent permanent worker deadlock when cutover times out waiting for binlog sentinel #1637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ff567e2
83a6830
17a6d5a
9bf9d5e
298d0ee
7d1825d
24c2cc3
55d483d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,14 +104,16 @@ type Migrator struct { | |
|
|
||
| func NewMigrator(context *base.MigrationContext, appVersion string) *Migrator { | ||
| migrator := &Migrator{ | ||
| appVersion: appVersion, | ||
| hooksExecutor: NewHooksExecutor(context), | ||
| migrationContext: context, | ||
| parser: sql.NewAlterTableParser(), | ||
| ghostTableMigrated: make(chan bool), | ||
| firstThrottlingCollected: make(chan bool, 3), | ||
| rowCopyComplete: make(chan error), | ||
| allEventsUpToLockProcessed: make(chan *lockProcessedStruct), | ||
| appVersion: appVersion, | ||
| hooksExecutor: NewHooksExecutor(context), | ||
| migrationContext: context, | ||
| parser: sql.NewAlterTableParser(), | ||
| ghostTableMigrated: make(chan bool), | ||
| firstThrottlingCollected: make(chan bool, 3), | ||
| rowCopyComplete: make(chan error), | ||
| // Buffered to MaxRetries() to prevent a deadlock when waitForEventsUpToLock times out. | ||
| // (see https://github.com/github/gh-ost/pull/1637) | ||
| allEventsUpToLockProcessed: make(chan *lockProcessedStruct, context.MaxRetries()), | ||
|
Comment on lines
+114
to
+116
|
||
|
|
||
| copyRowsQueue: make(chan tableWriteFunc), | ||
| applyEventsQueue: make(chan *applyEventStruct, base.MaxEventsBatchSize), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make(chan *lockProcessedStruct, context.MaxRetries())won’t compile because the channel buffer size parameter must be of typeint, butMigrationContext.MaxRetries()returnsint64(go/base/context.go:495). Convert toint(and consider guarding against overflow if you want to be extra defensive).