|
| 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