Skip to content

Commit f11a39f

Browse files
author
Shlomi Noach
authored
Merge pull request #120 from github/the-fine-print
adding The Fine Print documentation
2 parents 5b0593c + d20a82c commit f11a39f

File tree

5 files changed

+109
-87
lines changed

5 files changed

+109
-87
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
77
Related issue: https://github.com/github/gh-ost/issues/0123456789
88

9+
> Further notes in https://github.com/github/gh-ost/blob/master/.github/CONTRIBUTING.md
910
> Thank you! We are open to PRs, but please understand if for technical reasons we are unable to accept each and any PR
1011
1112
### Description

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ In addition, it offers many [operational perks](doc/perks.md) that make it safer
3030
- Auditing: you may query `gh-ost` for status. `gh-ost` listens on unix socket or TCP.
3131
- Control over cut-over phase: `gh-ost` can be instructed to postpone what is probably the most critical step: the swap of tables, until such time that you're comfortably available. No need to worry about ETA being outside office hours.
3232

33-
Please meanwhile refer to the [docs](doc) for more information. No, really, read the [docs](doc).
33+
Please refer to the [docs](doc) for more information. No, really, read the [docs](doc).
3434

3535
## Usage
3636

@@ -54,14 +54,17 @@ More tips:
5454
- Use `--postpone-cut-over-flag-file` to gain control over cut-over timing
5555
- Get familiar with the [interactive commands](doc/interactive-commands.md)
5656

57-
Also see [requirements and limitations](doc/requirements-and-limitations.md), [what if?](doc/what-if.md)
57+
Also see:
58+
59+
- [requirements and limitations](doc/requirements-and-limitations.md)
60+
- [what if?](doc/what-if.md)
61+
- [the fine print](doc/the-fine-print.md)
5862

5963
## What's in a name?
6064

6165
Originally this was named `gh-osc`: GitHub Online Schema Change, in the likes of [Facebook online schema change](https://www.facebook.com/notes/mysql-at-facebook/online-schema-change-for-mysql/430801045932/) and [pt-online-schema-change](https://www.percona.com/doc/percona-toolkit/2.2/pt-online-schema-change.html).
6266

63-
But then a rare genetic mutation happened, and the `s` transformed into `t`. And that sent us down the path of trying to figure out a new acronym. Right now, `gh-ost` (pronounce: _Ghost_), stands for:
64-
- GitHub Online Schema Transmogrifier/Translator/Transformer/Transfigurator
67+
But then a rare genetic mutation happened, and the `s` transformed into `t`. And that sent us down the path of trying to figure out a new acronym. `gh-ost` (pronounce: _Ghost_), stands for GitHub's Online Schema Transmogrifier/Translator/Transformer/Transfigurator
6568

6669
## License
6770

doc/requirements-and-limitations.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
### Limitations
1313

1414
- Foreign keys not supported. They may be supported in the future, to some extent.
15-
- Triggers are not supported. they may be supported in the future.
15+
- Triggers are not supported. They may be supported in the future.
16+
- MySQL 5.7 generated columns are not supported. They may be supported in the future.
1617
- The two _before_ & _after_ tables must share some `UNIQUE KEY`. Such key would be used by `gh-ost` to iterate the table.
1718
- As an example, if your table has a single `UNIQUE KEY` and no `PRIMARY KEY`, and you wish to replace it with a `PRIMARY KEY`, you will need two migrations: one to add the `PRIMARY KEY` (this migration will use the existing `UNIQUE KEY`), another to drop the now redundant `UNIQUE KEY` (this migration will use the `PRIMARY KEY`).
1819
- The chosen migration key must not include columns with `NULL` values.

doc/the-fine-print.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# The Fine Print: What are You Not Telling Me?
2+
3+
Here are technical considerations you may be interested in. We write here things that are not an obvious [Requirements & Limitations](requirements-and-limitations.md)
4+
5+
# Connecting to replica
6+
7+
`gh-ost` prefers connecting to replica. If your master uses Statement Based Replication, this is a _requirement_.
8+
9+
What does "connect to replica" mean?
10+
11+
- `gh-ost` connects to the replica as a normal client
12+
- It additionally connects as a replica to the replica (pretends to be a MySQL replica itself)
13+
- It auto-detects master
14+
15+
`gh-ost` reads the RBR binary logs from the replica, and applies events onto the master as tables are being migrated.
16+
17+
THE FINE PRINT:
18+
19+
- You trust the replica's binary logs to represent events applied on master.
20+
If you don't trust the replica, if you suspect there's data drift between replica & master, take notice. If your master is RBR, do instead connect `gh-ost` to master, via `--allow-on-master` (see [cheatsheet](cheatsheet.md)).
21+
Our take: we trust replica data; if master dies in production, we promote a replica. Our read serving is based on replica(s).
22+
23+
- Replication needs to run.
24+
This is an obvious, but worth stating. You cannot perform a migration with "connect to replica" if your replica lags. `gh-ost` will actually do all it can so that replication does not lag, and avoid critical operations at such time when replication does lag.
25+
26+
# Network usage
27+
28+
`gh-ost` reads binary logs and then applies them onto the migrated server.
29+
30+
THE FINE PRINT:
31+
32+
- `gh-ost` delivers more network traffic than other online-schema-change tools, that let MySQL handle all data transfer internally. This is part of the [triggerless design](triggerless-design.md).
33+
Our take: we deal with cross-DC migration traffic and this is working well for us.
34+
35+
# Impersonating as a replica
36+
37+
`gh-ost` impersonates as a replica: connects to a MySQL server, says "oh hey, I'm a replica, please send me binary logs kthx".
38+
39+
THE FINE PRINT:
40+
41+
- `SHOW SLAVE HOSTS` or `SHOW PROCESSLIST` will list down this strange "replica" that you can't really connect to.

0 commit comments

Comments
 (0)