Commit Graph

84 Commits

Author SHA1 Message Date
Shlomi Noach
ae899bd65c Merge pull request #41 from github/master-pos-wait-fix2
Various problem fixes
2016-05-20 12:53:34 +02:00
Shlomi Noach
5375aa4f69 - Removed use of master_pos_wait(). It was unneccessary in the first place and introduced new problems.
- Supporting `--allow-nullable-unique-key`
  - Tool will bail out if chosen key has nullable columns and the above is not provided
- Fixed `OriginalBinlogRowImage` comaprison (lower/upper case issue)
- Introduced reasonable streamer reconnect sleep time
2016-05-20 12:52:14 +02:00
Shlomi Noach
9b54d0208f - Handling gomysql.replication connection timeouts: reconnecting on last known position
- `printStatus()` takes ETA into account
- More info around `master_pos_wait()`
2016-05-19 15:11:36 +02:00
Shlomi Noach
ec34a5ef75 master_pos_wait is now OK to return NULL. We only care if it returns with -1 2016-05-18 15:08:47 +02:00
Shlomi Noach
079f1c0f98 Merge pull request #40 from github/fix-single-row-copy
Fixing single-row table migration
2016-05-18 14:53:52 +02:00
Shlomi Noach
9f56a84b57 Fixing single-row table migration
- `BuildUniqueKeyRangeEndPreparedQuery` supports `includeRangeStartValues` argument
- `applier` sends `this.migrationContext.GetIteration() == 0` as argument
2016-05-18 14:53:09 +02:00
Shlomi Noach
45371d9374 Merge pull request #36 from github/master-pos-wait-fix
some messagages are now Info instead of Debug
2016-05-18 12:21:22 +02:00
Shlomi Noach
55e463350b Merge pull request #38 from github/credentials-config-cli
This closes #25
2016-05-17 15:37:04 +02:00
Shlomi Noach
df0a7513f5 - user/password provided in CLI override those in config file
- user no longer defaults to .
- config is now part of Context, and is protected by mutex
2016-05-17 15:35:44 +02:00
Shlomi Noach
fbfe0c71ff Merge pull request #37 from github/postpone-swap-tables-flag-file
postpone-swap-tables-flag-file
2016-05-17 14:42:12 +02:00
Shlomi Noach
879b2b425e - Support for --postpone-swap-tables-flag-file: while this file exists, final table swap does not take place, and the ghost table keeps being synchronized
- Fixed version printing
- `rowCopyCompleteFlag` is a hint that allows us to escape the infinite loop of rowcopy once we are sure we have reached the end
2016-05-17 14:40:37 +02:00
Shlomi Noach
065d9c40ec some messagages are now Info instead of Debug 2016-05-17 11:57:43 +02:00
Shlomi Noach
9a3c607665 Merge pull request #35 from github/app-version
supporting --version
2016-05-17 11:51:55 +02:00
Shlomi Noach
41b0a4f317 supporting --version 2016-05-17 11:51:21 +02:00
Shlomi Noach
c6a371e6db Merge pull request #34 from github/rename-gh-ost
Rename to gh-ost
2016-05-16 11:11:55 +02:00
Shlomi Noach
21f6ae9dca renaming to gh-ost 2016-05-16 11:10:12 +02:00
Shlomi Noach
9d055dbda7 renaming to gh-ost 2016-05-16 11:09:17 +02:00
Shlomi Noach
92d09dbcf6 Merge pull request #31 from github/fix-out-of-order-dml-apply
initial, simple solution to our-of-order applying of DML events
2016-05-16 11:03:50 +02:00
Shlomi Noach
1e10f1f29e Solved various race conditions:
- 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
2016-05-16 11:03:15 +02:00
Shlomi Noach
134bf385fd initial, simple solution to our-of-order applying of DML events 2016-05-05 17:14:55 +03:00
Shlomi Noach
619be65524 Merge pull request #29 from github/status-eta
Adding ETA starting at 2% progress
2016-05-05 09:19:11 +03:00
Shlomi Noach
6528010742 Adding ETA starting at 2% progress 2016-05-05 09:18:19 +03:00
Shlomi Noach
ee673e2f2e Merge pull request #28 from github/fix-statistics-query
fixed statistics query
2016-05-04 09:50:31 +03:00
Shlomi Noach
800c1109b0 fixed statistics query: getting the correct column names by unique key 2016-05-04 09:50:00 +03:00
Shlomi Noach
dfdac964f1 Merge pull request #27 from github/exact-rowcount
exact-rowcount implices updating number of rows as we make progress
2016-05-04 08:26:17 +03:00
Shlomi Noach
74d8b06db1 exact-rowcount implices updating number of rows as we make progress 2016-05-04 08:23:34 +03:00
Shlomi Noach
567cd32ef0 Merge pull request #24 from github/initially-dropping-tables
old/ghost drop tables
2016-05-03 12:58:35 +03:00
Shlomi Noach
bd741371d0 Merge pull request #23 from github/cnf-file
initial support for config file
2016-05-03 12:55:59 +03:00
Shlomi Noach
36905d82e3 - supporting --initially-drop-old-table
- supporting `--initially-drop-ghost-table`
- validating existence of `old` and `ghost` before beginning operation
2016-05-03 12:55:17 +03:00
Shlomi Noach
627e412b6b fixed password assignment 2016-05-03 11:56:53 +03:00
Shlomi Noach
86fd2b617a initial support for config file 2016-05-03 10:28:48 +03:00
Shlomi Noach
93ac641455 Merge pull request #22 from github/throttle-control-replicas
throttle via control replicas
2016-05-01 21:37:12 +03:00
Shlomi Noach
07063a4181 - added throttle-control-replicas flag, a list of control replicas
- when `--test-on-replica`, the tested replica is implicitly a control replica
- added `replication-lag-query`, an alternate query to `SHOW SLAVE STATUS` to get replication lag
- throttling takes both the above into consideration
2016-05-01 21:36:36 +03:00
Shlomi Noach
128658579a Merge pull request #21 from github/lossless-swap-tables
Lossless, atomic swap tables
2016-05-01 21:32:46 +03:00
Shlomi Noach
421ab0fc83 woohoo, logic complete
- Introduced `SwapTablesTimeoutSeconds`; `RENAME` is limited by this timeout
- If `RENAME` fails (due to the above), we throttle and retry
- `SwapTablesAtomic()` sets `lock_wait_timeout` and notifies with connection id
- `GrabVoluntaryLock()` intentionally grabs (and later releases) voluntary lock. It notifies when it is taken and awaits instructions as for when it could be released.
- `IssueBlockingQueryOnVoluntaryLock()` does what it says. It notifies with its connection_id so that it can be easily traced
- `stopWritesAndCompleteMigrationOnMasterViaLock()` does the thang. Oh dear this was agonizing and the code is a pain to look at, though under the limitations I do believe it is as clean as I could hope for.
2016-04-22 19:46:34 -07:00
Shlomi Noach
1ed1b0d156 - quick-and-bumpy-swap-tables uses quicker swap tables, at the expense of a period where the table does not exist (non atomic renames)
- refactored lock-and-swap code, in preparation for atomic swap
2016-04-22 13:41:20 -07:00
Shlomi Noach
54c6d059b5 - quick-and-bumpy-swap-tables uses quicker swap tables, at the expense of a period where the table does not exist (non atomic renames)
- refactored lock-and-swap code, in preparation for atomic swap
2016-04-22 13:18:56 -07:00
Shlomi Noach
fbe226ebb2 Merge pull request #20 from github/noop-replica-and-stuff
NOOP code cleanup
2016-04-19 04:26:22 -07:00
Shlomi Noach
3c85298b77 - Better, fewer NOOP checks around the code
- Keeping track of `TotalDMLEventsApplied`
2016-04-19 04:25:32 -07:00
Shlomi Noach
4efbfd6e0f Merge pull request #19 from github/oops-leftovers
oops, leftover file
2016-04-18 10:59:58 -07:00
Shlomi Noach
9dce88e6c0 oops, leftover file 2016-04-18 10:59:34 -07:00
Shlomi Noach
bb264fdc2b Merge pull request #18 from github/ongoing-initial-work-3
Full cycle works!
2016-04-18 10:58:59 -07:00
Shlomi Noach
eeffa701d6 - Added ok-to-drop-table flag
- Added `switch-to-rbr` flag; applying binlog format change if needed
- Using dedicated db instance for locking & renaming on applier (must be used from within same connection)
- Heartbeat now uses `time.RFC3339Nano`
- Swap tables works! Caveat: short table outage
- `--test-on-replica` works!
- retries: using `panicAbort`: from any goroutine, regardless of context, it is possible to terminate the operation
- Reintroduced changelog events listener on streamer. This is the correct implementation.
2016-04-18 10:57:18 -07:00
Shlomi Noach
75c3fe0bee Merge pull request #16 from github/ongoing-initial-work-2
ongoing development:
2016-04-14 13:39:48 +02:00
Shlomi Noach
a4ee80df13 - Building and applying queries from binlog event data!
- `INSERT`, `DELETE`, `UPDATE` statements
- support for `--noop`
- initial support for `--test-on-replica`. Verifying against `--allow-on-master`
- Changelog events no longer read from binlog stream, because reading it may be throttled, and we have to be able to keep reading the heartbeat and state events.
  They are now being read directly from table, mapping already-seen-events to avoid confusion
  Changlelog listener pools table in 2*frequency of heartbeat injection
2016-04-14 13:37:56 +02:00
Shlomi Noach
0d25d11b40 added types_test 2016-04-11 19:06:47 +02:00
Shlomi Noach
04525887f3 - Throttling-check is now an async routine running once per second
- Throttling variables protected by mutex
- Added `--throttle-additional-flag-file`: `operation pauses when this file exists; hint: keep default, use for throttling multiple gh-osc operations`
- ColumnList is not a `struct` which contains ordinal mapping
- More implicit write changelog + audit changelog
- builder now builds `DELETE` and `INSERT` queries from data it will eventually get from DML event
- Sanity check for binlog_row_image
- Restarting replication to be sure binlog settings apply
- Prepare for accepting `SIGHUP` (reloading configuration)
2016-04-11 17:27:16 +02:00
Shlomi Noach
80163b35b6 extracted on-throttle functions outside loop 2016-04-08 14:44:36 +02:00
Shlomi Noach
a1a34b8150 ongoing development:
- accepts --max-load
- accepts multiple conditions in --max-load
- throttle includes reason
- chunk-size sanity check
- change log state writes both in appending (history) mode and in replacing (current) mode
- more atomic checks
- inspecting ghost table columns, unique key
- comparing unique keys between tables; sanity
- intersecting columns between tables
- prettify status
- refactored throttle() and retries()
2016-04-08 14:35:06 +02:00
Shlomi Noach
4652bb7728 Merge pull request #14 from github/ongoing-initial-work
WIP, ongoing basics
2016-04-08 10:35:57 +02:00