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
* 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 <2607934+shlomi-noach@users.noreply.github.com>
* 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 <fp544037857@gmail.com>
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
* 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 <45519614+dm-2@users.noreply.github.com>
* 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 <45519614+dm-2@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Tim Vaillancourt <tim@timvaillancourt.com>
* Update go/logic/applier.go
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
Co-authored-by: Tim Vaillancourt <tim@timvaillancourt.com>
Co-authored-by: dm-2 <45519614+dm-2@users.noreply.github.com>
Co-authored-by: wangzihuacool <wangzihuacool@163.com>
Co-authored-by: wangzihuacool <47876169+wangzihuacool@users.noreply.github.com>
Co-authored-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Co-authored-by: Abirdcfly <fp544037857@gmail.com>
Co-authored-by: Nicholas Calugar <nicholas.calugar@gusto.com>
Co-authored-by: Hasan Mshawrab <63023909+hasanMshawrab@users.noreply.github.com>
Co-authored-by: Morgan Tocker <mtocker@squareup.com>
Co-authored-by: Morgan Tocker <tocker@gmail.com>
Co-authored-by: lukelewang <lukelewang@tencent.com>
Copy file name to clipboardExpand all lines: doc/coding-ghost.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
Getting started with gh-ost development is simple!
6
6
7
7
- First obtain the repository with `git clone` or `go get`.
8
-
- From inside of the repository run `script/cibuild`
8
+
- From inside of the repository run `script/cibuild`.
9
9
- This will bootstrap the environment if needed, format the code, build the code, and then run the unit test.
10
10
11
11
## CI build workflow
@@ -14,6 +14,12 @@ Getting started with gh-ost development is simple!
14
14
15
15
If additional steps are needed, please add them into this workflow so that the workflow remains simple.
16
16
17
+
## `golang-ci` linter
18
+
19
+
To enfore best-practices, Pull Requests are automatically linted by [`golang-ci`](https://golangci-lint.run/). The linter config is located at [`.golangci.yml`](https://github.com/github/gh-ost/blob/master/.golangci.yml) and the `golangci-lint` GitHub Action is located at [`.github/workflows/golangci-lint.yml`](https://github.com/github/gh-ost/blob/master/.github/workflows/golangci-lint.yml).
20
+
21
+
To run the `golang-ci` linters locally _(recommended before push)_, use `script/lint`.
22
+
17
23
## Notes:
18
24
19
25
Currently, `script/ensure-go-installed` will install `go` for Mac OS X and Linux. We welcome PR's to add other platforms.
Copy file name to clipboardExpand all lines: doc/command-line-flags.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,10 @@ A more in-depth discussion of various `gh-ost` command line flags: implementatio
6
6
7
7
Add this flag when executing on Aliyun RDS.
8
8
9
+
### allow-zero-in-date
10
+
11
+
Allows the user to make schema changes that include a zero date or zero in date (e.g. adding a `datetime default '0000-00-00 00:00:00'` column), even if global `sql_mode` on MySQL has `NO_ZERO_IN_DATE,NO_ZERO_DATE`.
12
+
9
13
### azure
10
14
11
15
Add this flag when executing on Azure Database for MySQL.
@@ -41,6 +45,22 @@ If you happen to _know_ your servers use RBR (Row Based Replication, i.e. `binlo
41
45
Skipping this step means `gh-ost` would not need the `SUPER` privilege in order to operate.
42
46
You may want to use this on Amazon RDS.
43
47
48
+
### attempt-instant-ddl
49
+
50
+
MySQL 8.0 supports "instant DDL" for some operations. If an alter statement can be completed with instant DDL, only a metadata change is required internally. Instant operations include:
51
+
52
+
- Adding a column
53
+
- Dropping a column
54
+
- Dropping an index
55
+
- Extending a varchar column
56
+
- Adding a virtual generated column
57
+
58
+
It is not reliable to parse the `ALTER` statement to determine if it is instant or not. This is because the table might be in an older row format, or have some other incompatibility that is difficult to identify.
59
+
60
+
`--attempt-instant-ddl` is disabled by default, but the risks of enabling it are relatively minor: `gh-ost` may need to acquire a metadata lock at the start of the operation. This is not a problem for most scenarios, but it could be a problem for users that start the DDL during a period with long running transactions.
61
+
62
+
`gh-ost` will automatically fallback to the normal DDL process if the attempt to use instant DDL is unsuccessful.
63
+
44
64
### conf
45
65
46
66
`--conf=/path/to/my.cnf`: file where credentials are specified. Should be in (or contain) the following format:
@@ -226,6 +246,18 @@ Allows `gh-ost` to connect to the MySQL servers using encrypted connections, but
226
246
227
247
`--ssl-key=/path/to/ssl-key.key`: SSL private key file (in PEM format).
228
248
249
+
### storage-engine
250
+
Default is `innodb`, and `rocksdb` support is currently experimental. InnoDB and RocksDB are both transactional engines, supporting both shared and exclusive row locks.
251
+
252
+
But RocksDB currently lacks a few features support compared to InnoDB:
253
+
- Gap Locks
254
+
- Foreign Key
255
+
- Generated Columns
256
+
- Spatial
257
+
- Geometry
258
+
259
+
When `--storage-engine=rocksdb`, `gh-ost` will make some changes necessary (e.g. sets isolation level to `READ_COMMITTED`) to support RocksDB.
260
+
229
261
### test-on-replica
230
262
231
263
Issue the migration on a replica; do not modify data on master. Useful for validating, testing and benchmarking. See [`testing-on-replica`](testing-on-replica.md)
@@ -242,6 +274,14 @@ Provide a command delimited list of replicas; `gh-ost` will throttle when any of
242
274
243
275
Provide an HTTP endpoint; `gh-ost` will issue `HEAD` requests on given URL and throttle whenever response status code is not `200`. The URL can be queried and updated dynamically via [interactive commands](interactive-commands.md). Empty URL disables the HTTP check.
244
276
277
+
### throttle-http-interval-millis
278
+
279
+
Defaults to 100. Configures the HTTP throttle check interval in milliseconds.
280
+
281
+
### throttle-http-timeout-millis
282
+
283
+
Defaults to 1000 (1 second). Configures the HTTP throttler check timeout in milliseconds.
284
+
245
285
### timestamp-old-table
246
286
247
287
Makes the _old_ table include a timestamp value. The _old_ table is what the original table is renamed to at the end of a successful migration. For example, if the table is `gh_ost_test`, then the _old_ table would normally be `_gh_ost_test_del`. With `--timestamp-old-table` it would be, for example, `_gh_ost_test_20170221103147_del`.
Copy file name to clipboardExpand all lines: doc/requirements-and-limitations.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,8 @@ The `SUPER` privilege is required for `STOP SLAVE`, `START SLAVE` operations. Th
20
20
- Switching your `binlog_format` to `ROW`, in the case where it is _not_`ROW` and you explicitly specified `--switch-to-rbr`
21
21
- If your replication is already in RBR (`binlog_format=ROW`) you can specify `--assume-rbr` to avoid the `STOP SLAVE/START SLAVE` operations, hence no need for `SUPER`.
22
22
23
+
-`gh-ost` uses the `REPEATABLE_READ` transaction isolation level for all MySQL connections, regardless of the server default.
24
+
23
25
- Running `--test-on-replica`: before the cut-over phase, `gh-ost` stops replication so that you can compare the two tables and satisfy that the migration is sound.
Copy file name to clipboardExpand all lines: doc/shared-key.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ CREATE TABLE tbl (
29
29
30
30
(This is also the definition of the _ghost_ table, except that that table would be called `_tbl_gho`).
31
31
32
-
In this migration, the _before_ and _after_ versions contain the same unique not-null key (the PRIMARY KEY). To run this migration, `gh-ost` would iterate through the `tbl` table using the primary key, copy rows from `tbl` to the _ghost_ table `_tbl_gho` in primary key order, while also applying the binlog event writes from `tble` onto `_tbl_gho`.
32
+
In this migration, the _before_ and _after_ versions contain the same unique not-null key (the PRIMARY KEY). To run this migration, `gh-ost` would iterate through the `tbl` table using the primary key, copy rows from `tbl` to the _ghost_ table `_tbl_gho` in primary key order, while also applying the binlog event writes from `tbl` onto `_tbl_gho`.
33
33
34
34
The applying of the binlog events is what requires the shared unique key. For example, an `UPDATE` statement to `tbl` translates to a `REPLACE` statement which `gh-ost` applies to `_tbl_gho`. A `REPLACE` statement expects to insert or replace an existing row based on its row's values and the table's unique key constraints. In particular, if inserting that row would result in a unique key violation (e.g., a row with that primary key already exists), it would _replace_ that existing row with the new values.
0 commit comments