You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/command-line-flags.md
+25-1Lines changed: 25 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,15 @@ It is not reliable to parse the `ALTER` statement to determine if it is instant
64
64
### binlogsyncer-max-reconnect-attempts
65
65
`--binlogsyncer-max-reconnect-attempts=0`, the maximum number of attempts to re-establish a broken inspector connection for sync binlog. `0` or `negative number` means infinite retry, default `0`
66
66
67
+
### checkpoint
68
+
69
+
`--checkpoint` enables periodic checkpoints of the gh-ost's state so that gh-ost can resume a migration from the checkpoint with `--resume`. Checkpoints are written to a separate table named `_${original_table_name}_ghk`. It is recommended to use with `--gtid` for checkpoints.
70
+
See also: [`resuming-migrations`](resume.md)
71
+
72
+
### checkpoint-seconds
73
+
74
+
`--checkpoint-seconds` specifies the seconds between checkpoints. Default is 300.
75
+
67
76
### conf
68
77
69
78
`--conf=/path/to/my.cnf`: file where credentials are specified. Should be in (or contain) the following format:
@@ -119,7 +128,7 @@ See also: [`skip-foreign-key-checks`](#skip-foreign-key-checks)
119
128
120
129
`gh-ost` reads event from the binary log and applies them onto the _ghost_ table. It does so in batched writes: grouping multiple events to apply in a single transaction. This gives better write throughput as we don't need to sync the transaction log to disk for each event.
121
130
122
-
The `--dml-batch-size` flag controls the size of the batched write. Allowed values are `1 - 100`, where `1` means no batching (every event from the binary log is applied onto the _ghost_ table on its own transaction). Default value is `10`.
131
+
The `--dml-batch-size` flag controls the size of the batched write. Allowed values are `1 - 1000`, where `1` means no batching (every event from the binary log is applied onto the _ghost_ table on its own transaction). Default value is `10`.
123
132
124
133
Why is this behavior configurable? Different workloads have different characteristics. Some workloads have very large writes, such that aggregating even `50` writes into a transaction makes for a significant transaction size. On other workloads write rate is high such that one just can't allow for a hundred more syncs to disk per second. The default value of `10` is a modest compromise that should probably work very well for most workloads. Your mileage may vary.
125
134
@@ -160,6 +169,10 @@ Table name prefix to be used on the temporary tables.
160
169
161
170
Add this flag when executing on a 1st generation Google Cloud Platform (GCP).
162
171
172
+
### gtid
173
+
174
+
Add this flag to enable support for [MySQL replication GTIDs](https://dev.mysql.com/doc/refman/5.7/en/replication-gtids-concepts.html) for replication positioning. This requires `gtid_mode` and `enforce_gtid_consistency` to be set to `ON`.
175
+
163
176
### heartbeat-interval-millis
164
177
165
178
Default 100. See [`subsecond-lag`](subsecond-lag.md) for details.
@@ -202,6 +215,12 @@ List of metrics and threshold values; topping the threshold of any will cause th
202
215
203
216
Typically `gh-ost` is used to migrate tables on a master. If you wish to only perform the migration in full on a replica, connect `gh-ost` to said replica and pass `--migrate-on-replica`. `gh-ost` will briefly connect to the master but otherwise will make no changes on the master. Migration will be fully executed on the replica, while making sure to maintain a small replication lag.
204
217
218
+
### panic-on-warnings
219
+
220
+
When this flag is set, `gh-ost` will panic when SQL warnings indicating data loss are encountered when copying data. This flag helps prevent data loss scenarios with migrations touching unique keys, column collation and types, as well as `NOT NULL` constraints, where `MySQL` will silently drop inserted rows that no longer satisfy the updated constraint (also dependent on the configured `sql_mode`).
221
+
222
+
While `panic-on-warnings` is currently disabled by defaults, it will default to `true` in a future version of `gh-ost`.
223
+
205
224
### postpone-cut-over-flag-file
206
225
207
226
Indicate a file name, such that the final [cut-over](cut-over.md) step does not take place as long as the file exists.
@@ -216,6 +235,11 @@ Optionally involve the process ID, for example: `--replica-server-id=$((10000000
216
235
It's on you to choose a number that does not collide with another `gh-ost` or another running replica.
217
236
See also: [`concurrent-migrations`](cheatsheet.md#concurrent-migrations) on the cheatsheet.
218
237
238
+
### resume
239
+
240
+
`--resume` attempts to resume a migration that was previously interrupted from the last checkpoint. The first `gh-ost` invocation must run with `--checkpoint` and have successfully written a checkpoint in order for `--resume` to work.
241
+
See also: [`resuming-migrations`](resume.md)
242
+
219
243
### serve-socket-file
220
244
221
245
Defaults to an auto-determined and advertised upon startup file. Defines Unix socket file to serve on.
Copy file name to clipboardExpand all lines: doc/interactive-commands.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,7 @@ Both interfaces may serve at the same time. Both respond to simple text command,
41
41
-`throttle-control-replicas='replica1,replica2'`: change list of throttle-control replicas, these are replicas `gh-ost` will check. This takes a comma separated list of replica's to check and replaces the previous list.
42
42
-`throttle`: force migration suspend
43
43
-`no-throttle`: cancel forced suspension (though other throttling reasons may still apply)
44
+
-`postpone-cut-over-flag-file=<path>`: Postpone the [cut-over](cut-over.md) phase, writing a cut over flag file to the given path
44
45
-`unpostpone`: at a time where `gh-ost` is postponing the [cut-over](cut-over.md) phase, instruct `gh-ost` to stop postponing and proceed immediately to cut-over.
Copy file name to clipboardExpand all lines: doc/local-tests.md
+24-2Lines changed: 24 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
`gh-ost` is continuously tested in production via `--test-on-replica alter='engine=innodb'`. These tests check the GitHub workload and usage, but not necessarily the general case.
4
4
5
-
Local tests are an additional layer of tests. They will eventually be part of continuous integration tests.
5
+
Local tests are an additional layer of tests used for continuous integration tests and local development.
6
6
7
7
Local tests test explicit use cases, such as column renames, mix of time zones, special types and alters. Traits of a single test:
8
8
@@ -19,4 +19,26 @@ Tests are found under [localtests](https://github.com/github/gh-ost/tree/master/
19
19
20
20
New data-integrity, synchronization issues or otherwise concerns are expected to be tested by new test cases.
21
21
22
-
While this is merged work is still ongoing.
22
+
## Run with docker compose
23
+
24
+
Local tests can be run locally with docker compose using the helper script [script/docker-gh-ost-replica-tests](https://github.com/github/gh-ost/tree/master/script/docker-gh-ost-replica-tests).
25
+
26
+
Example usage:
27
+
```shell
28
+
# create primary-replica containers with specified mysql image
29
+
TEST_MYSQL_IMAGE="mysql-server:8.0.16" ./script/docker-gh-ost-replica-tests up
30
+
31
+
# run all tests
32
+
./script/docker-gh-ost-replica-tests run
33
+
34
+
# cleanup containers
35
+
./script/docker-gh-ost-replica-tests down
36
+
```
37
+
38
+
Pass the `-t` flag to run the tests with a toxiproxy between gh-ost and the MySQL replica. This simulates network conditions where MySQL connections are closed unexpectedly.
0 commit comments