Commit Graph

124 Commits

Author SHA1 Message Date
Shlomi Noach
087a6cc0cb Merge branch 'master' into touch-postpone-flag-file 2017-10-17 16:02:11 +03:00
Shlomi Noach
c2186db527 Merge branch 'master' into touch-postpone-flag-file 2017-10-02 15:55:21 +03:00
Zach Moazeni
df27c5b76f Allow gh-ost to modify the server using extra port
Both Percona and Maria allow MySQL to be configured to listen on an extra port when their thread pool is enable.

* https://www.percona.com/doc/percona-server/5.7/performance/threadpool.html
* https://mariadb.com/kb/en/the-mariadb-library/thread-pool-in-mariadb-51-53/

This is valuable because if the table has a lot of traffic (read or write load), gh-ost can end up starving the thread pool as incomming connections are immediately blocked.

By using gh-ost on the extra port, MySQL locking will still behave the same, but MySQL will keep a dedicated thread for each gh-ost connection.

When doing this, it's important to inspect the extra-max-connections variable. Both Percona and Maria default to 1, so gh-ost may easily exceed with its threads.

An example local run using this

```
$ mysql -S /tmp/mysql_sandbox20393.sock -e "select @@global.port, @@global.extra_port"
+---------------+---------------------+
| @@global.port | @@global.extra_port |
+---------------+---------------------+
|         20393 |               30393 |
+---------------+---------------------+

./bin/gh-ost \
--initially-drop-ghost-table \
--initially-drop-old-table \
--assume-rbr \
--port="20395" \
--assume-master-host="127.0.0.1:30393" \
--max-load=Threads_running=25 \
--critical-load=Threads_running=1000 \
--chunk-size=1000 \
--max-lag-millis=1500 \
--user="gh-ost" \
--password="gh-ost" \
--database="test" \
--table="mytable" \
--verbose \
--alter="ADD mynewcol decimal(11,2) DEFAULT 0.0 NOT NULL" \
--exact-rowcount \
--concurrent-rowcount \
--default-retries=120 \
--panic-flag-file=/tmp/ghost.panic.flag \
--postpone-cut-over-flag-file=/tmp/ghost.postpone.flag \
--execute
```
2017-09-20 16:05:20 -04:00
Shlomi Noach
6362dbe51a Clearer error message on config file read error 2017-09-10 08:20:01 +03:00
Arthur Neves
02359b2a79
Dont share the same context in the table name tests 2017-07-24 06:26:31 -04:00
Arthur Neves
843c74f960
Add a force-table-names command flag
usage example:
```
gh-ost  ...  --force-table-names=migration_tbl
```

The force-table-names flag will receive a table name and use that name
when creating the _del, _gho, _ghc tables.
For instance for that example above, the tables would be:

_migration_tbl_del
_migration_tbl_gho
_migration_tbl_ghc

[fixes #399]
2017-07-21 15:37:57 -04:00
Shlomi Noach
e2c14f5aba Merge branch 'master' into dynamic-dml-batch-size 2017-07-20 16:47:22 +03:00
Shlomi Noach
6da0b8af3d Dynamic DML batch size; apadting buffer size to match 2017-07-19 16:44:18 +03:00
Shlomi Noach
39e73e37d0 testing context.TimestampOldTable 2017-07-19 15:22:46 +03:00
Shlomi Noach
168676bd9d ghost/changelog/del table names support max characters limit 2017-07-19 15:14:03 +03:00
Shlomi Noach
095863b774 dml-batch-size capped at 1000 2017-07-04 08:50:25 +03:00
Shlomi Noach
e8b384e43c supporting greater batch size 2017-06-28 19:35:55 +03:00
Shlomi Noach
cb3c7f3e20 Merge branch 'master' into touch-postpone-flag-file 2017-06-11 08:57:45 +03:00
Shlomi Noach
ad47f7c147 throttling just prior to leaving hibernation, so as to allow re-throttle checks to apply 2017-05-24 10:42:47 +03:00
Shlomi Noach
3955a6d67f hibernate on critical-load 2017-05-24 08:32:13 +03:00
Shlomi Noach
aca288e88d -postpone-cut-over-flag-file implies touching indicated file 2017-05-07 14:58:18 +03:00
Shlomi Noach
eaa3489fe0 Merge branch 'master' into server-report-coordinates 2017-05-01 07:50:13 +03:00
Shlomi Noach
79cee99f57 support for 'coordinates' command 2017-04-28 15:50:51 -07:00
Shlomi Noach
8a0f1413eb dropped columns are not 'shared' and no data copy attempted for such columns 2017-04-23 08:38:35 +03:00
Shlomi Noach
23ce390d69 supporting throttle-http 2017-03-26 13:10:34 +03:00
Shlomi Noach
8db8e127eb supporting --timestamp-old-table 2017-02-21 10:34:24 -07:00
Shlomi Noach
b289041ccb Merge branch 'master' into fix-reappearing-throttled-reasons 2017-02-08 13:11:34 +02:00
Shlomi Noach
ed5dd7f049 Collecting and presenting MySQL versions of applier and inspector 2017-02-07 09:41:33 +02:00
Shlomi Noach
baee4f69f9 fixing phantom throttle-control-replicas lag result 2017-01-29 10:18:39 +02:00
Shlomi Noach
220bf83a5b Merge branch 'master' into batch-apply-dml-events 2017-01-04 08:37:08 +02:00
Shlomi Noach
445c67635d batching DML writes, configurable --dml-batch-size 2017-01-03 14:31:19 +02:00
Shlomi Noach
9177f7553f Merge branch 'master' into heartbeat-control-replicas-unified 2016-12-30 08:07:07 +02:00
Cyprian Nosek
2bfc672b03 Add possibility to set serverId as gh-ost argument
Signed-off-by: Cyprian Nosek <cyprian.nosek@pearson.com>
2016-12-28 11:49:41 +01:00
Shlomi Noach
c66356bd05 --replication-lag-query is deprecated. 2016-12-26 21:38:37 +02:00
Shlomi Noach
ba2a9d9e55 support for --master-user and --master-password 2016-12-13 16:09:34 +01:00
Shlomi Noach
7126b28169 support for --skip-foreign-key-checks 2016-11-21 09:18:40 +01:00
Shlomi Noach
7ab6af8f5f never throttling inside cut-over critical section 2016-11-17 17:22:13 +01:00
Shlomi Noach
034683f482 Merge branch 'master' into close-streamer-connection 2016-11-01 12:22:21 +01:00
Shlomi Noach
7fa5e405d4 avoid writing heartbeat when throttle commanded by user
when throttling on user command there really is no need for injecting heartbeat. The user commanded, therefore gh-ost complies and trusts the reasoning for throttling. What this will allow is complete quiet time. This, in turn, will allow such features as relocating via orchestrator/pseudo-gtid at time of throttling
2016-10-27 14:51:38 +02:00
Shlomi Noach
7b63b4a275 proper cleanup of streamer connection 2016-10-27 13:52:37 +02:00
Shlomi Noach
bf92eec214 validating table structure on applier and migrator
- reading column list on applier
- comparing original table on applier and migrator, expecting exact column list
- or else bailing out
2016-10-20 11:29:30 +02:00
Shlomi Noach
f988309800 no need for Inspector timezone; it is irrelevant 2016-10-13 13:08:23 +02:00
Shlomi Noach
184643157b Merge branch 'master' into tz-a-different-approach 2016-10-12 08:33:19 +02:00
Shlomi Noach
c11c611755 Merge pull request #260 from github/hooks-nil-check
safe access to applier/inspector hostnames for hooks
2016-10-12 08:16:50 +02:00
Shlomi Noach
4d903d0119 Merge pull request #264 from github/discard-foreign-keys
Discard foreign keys
2016-10-12 08:16:27 +02:00
Shlomi Noach
5d92da4a74 Merge branch 'master' into tz-a-different-approach 2016-10-11 17:17:42 +02:00
Shlomi Noach
dbf50afbc7 reading time_zone settings for Inspector and Applier separately.
--time-zone overrides both of them, if given
2016-10-11 16:00:26 +02:00
Shlomi Noach
15f4ddfd8a support for --critical-load-interval-millis
this optional flag gives --critical-load a second chance. When configured to positive value, meeting with critical-load spawns a timer. When this timer expires a second check for critical-load is made; if still met, gh-ost bails out.
By default the interval is zero, in which case gh-ost bails out immediately on meeting critical load.
2016-10-10 13:21:01 +02:00
Shlomi Noach
6750959e1a configurable time-zone, native time parsing 2016-10-10 11:39:57 +02:00
Shlomi Noach
1f65473e69 support for --discard-foreign-keys
This flag makes migration silently and happily discard any existing foreign keys on migrated table. This is useful for intentional dropping of foreign keys, as gh-ost does not otherwise have support for foreign key migration.
At some time in the future gh-ost may support foreign key migration, at which time this flag will be removed
2016-10-07 10:20:50 +02:00
Shlomi Noach
72f63d3042 safe access to applier/inspector hostnames for hooks 2016-10-04 21:18:44 +02:00
Shlomi Noach
e5e0444cc6 supporting --force-named-cut-over
- when given, user _must_ specify table name
  and of course table name must match migrated table
2016-09-12 19:17:36 +02:00
Shlomi Noach
1c6f828091 refactored server command into server.go
- added support for cut-over=<tablename>
- refactored more code into context
2016-09-12 12:38:14 +02:00
Shlomi Noach
88f2af8111 support for --assume-master-host, master-master/tungsten 2016-09-02 13:09:18 +02:00
randall
82110fcfcf Add -override-applier-host for use with -allow-master-master
for configurations where writes are meant to go to one master, but gh-ost can't automatically determine which
2016-09-01 20:29:26 -07:00