-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
initial, simple solution to our-of-order applying of DML events #31
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Operation would terminate after events lock noticed but before applying all events: race condition where the event would be captured asynchronously. The event is now handled sequentially with the DML events, hence now safe. - Multiple rowcopy operations would still write to `rowCopyComplete` channel. This is still the case, but now we only wait for the first and then just flush (read and discard) any others, to avoid blocking - Events DML listener is only added after table creation: the problem was that with very busy tables, the events func buffer would fill up, and the "tables-created" event would be blocked. - `waitForEventsUpToLock()` unifies the waiting on all variants of complete-migration - With `--test-on-replica`, now stopping replication "nicely", using `master_pos_wait()` - With `--test-on-replica`, not throttling on replication after replication is stopped (duh) - More debug output
Solved various race conditions:
|
timvaillancourt
pushed a commit
to timvaillancourt/gh-ost
that referenced
this pull request
Aug 4, 2022
Support zero date and zero in date, via dedicated command line flag
timvaillancourt
pushed a commit
to timvaillancourt/gh-ost
that referenced
this pull request
Aug 4, 2022
Support zero date and zero in date, via dedicated command line flag
timvaillancourt
pushed a commit
to timvaillancourt/gh-ost
that referenced
this pull request
Aug 4, 2022
Support zero date and zero in date, via dedicated command line flag
timvaillancourt
added a commit
that referenced
this pull request
Aug 10, 2022
* Merge pull request #31 from openark/zero-date Support zero date and zero in date, via dedicated command line flag * Merge pull request #32 from openark/existing-date-with-zero Support tables with existing zero dates * Remove un-needed ignore_versions file * Fix new lint errors from golang-ci update Co-authored-by: Shlomi Noach <[email protected]>
RainbowDashy
referenced
this pull request
in bytebase/gh-ost
Dec 13, 2022
* Merge pull request #31 from openark/zero-date Support zero date and zero in date, via dedicated command line flag * Merge pull request #32 from openark/existing-date-with-zero Support tables with existing zero dates * Remove un-needed ignore_versions file * Fix new lint errors from golang-ci update Co-authored-by: Shlomi Noach <[email protected]>
d-bytebase
referenced
this pull request
in bytebase/gh-ost
Dec 13, 2022
* Add script and docs for linter (github#1151) * Enable more `golang-ci` linters (github#1149) * Only build RPM and deb packages for amd64 * Convert character to bytes and insert into table using latin1 * delete junk files * restore connection charset to utf8mb4 * Allow zero in dates (github#1161) * Merge pull request #31 from openark/zero-date Support zero date and zero in date, via dedicated command line flag * Merge pull request #32 from openark/existing-date-with-zero Support tables with existing zero dates * Remove un-needed ignore_versions file * Fix new lint errors from golang-ci update Co-authored-by: Shlomi Noach <[email protected]> * Add missing doc from PR github#1131 (github#1162) * Set a transaction isolation level for MySQL connections (github#1156) * Set transaction isolation in connections * Revert load_map.go change * Var rename * Restore comment * Some fix to unit tests. * convert to bytes if character string without charsetConversion. * chore: remove duplicate word in comments (github#1175) Signed-off-by: Abirdcfly <[email protected]> Signed-off-by: Abirdcfly <[email protected]> * Improve applier `.ReadMigrationRangeValues()` func accuracy (github#1164) * Use a transaction in applier `ReadMigrationRangeValues` func * Private func names * Add basic tests for applier (github#1165) * Add basic tests for applier * Add header * Add basic test for inspector (github#1166) * Add basic test for inspector * Add header * Fix return * Add basic tests to migrator (github#1168) * add-rocksdb-as-transactional-engine * Add basic test for hooks (github#1179) * Enable more `golangci-lint` linters (github#1181) * Print status to migration context logger * fix CI tests to ubuntu-20.04 because ubuntu-22.04 (current -latest) doesn't support MySQL 5.7 * temp commit to investigate datetime-with-zero test failure * more testing * add extra debugging output * debugging * add error detection for test setup, sort tests to make it easier to track progress * fix broken test by removing invalid insert statement * Fix: Change table name table name is 'tbl' not 'tble' * Attempt instant DDL if supported * minor cleanup * Add tests, incorporate feedback * Improve docs * Address PR feedback * Make it clear in docs it is disabled by default but safe. * Update go/logic/migrator.go Co-authored-by: dm-2 <[email protected]> * remove useless func per review * support rocksdb as transactional engine * Modify tests to support rocksdb tests * SetConnectionConfig * add support for rocksdb * add support for rocksdb * add percona to versions in workflows * add description and optimize tests * Apply suggestions from code review Co-authored-by: dm-2 <[email protected]> * Apply suggestions from code review Co-authored-by: Tim Vaillancourt <[email protected]> * Update go/logic/applier.go Signed-off-by: Abirdcfly <[email protected]> Co-authored-by: Tim Vaillancourt <[email protected]> Co-authored-by: dm-2 <[email protected]> Co-authored-by: wangzihuacool <[email protected]> Co-authored-by: wangzihuacool <[email protected]> Co-authored-by: Shlomi Noach <[email protected]> Co-authored-by: Abirdcfly <[email protected]> Co-authored-by: Nicholas Calugar <[email protected]> Co-authored-by: Hasan Mshawrab <[email protected]> Co-authored-by: Morgan Tocker <[email protected]> Co-authored-by: Morgan Tocker <[email protected]> Co-authored-by: lukelewang <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Storyline: #30
This is the first and potentially last change so as to solve the out-of-order issue.
The change is to not have the DML event func run asynchronously. They were originally introduced to run synchronously when the heartbeat mechanism was using binlog events as well. That turned out to be a wrong implementation, and heartbeat now uses plain old table queries.
There is a buffer of
100
event entries that will allow for a queue buildup of DML events. See https://github.com/github/gh-osc/blob/master/go/logic/migrator.go#L34 and https://github.com/github/gh-osc/blob/master/go/logic/migrator.go#L69So up to
100
unhandled events can still build up without further blocking DML events such asstatus
entries. I'm not at all sure at this point we should care about the DML events blocking other events. Running with this small change.