Comments (11)
The tool allows master-master if executed with
gh-ost --allow-master-master ...
The reason this flag is required is that gh-ost cannot confirm your master-master setup is an active-passive one. For all it knows it may be an active-active one, where both masters accept writes to the migrated table, in which case it cannot reliably determine all changes are propagated to the ghost table upon cutover phase.
If you know for sure your setup is active-passive, you should be on safe grounds.
from gh-ost.
Excellent, thanks!
Possibly worth adding to the help or a doc file for future curious folks?
James Brown,
currently mobile
On Aug 6, 2016, at 12:40, Shlomi Noach [email protected] wrote:
The tool allows master-master if executed with
gh-ost --allow-master-master ...
The reason this flag is required is that gh-ost cannot confirm your master-master setup is an active-passive one. For all it knows it may be an active-active one, where both masters accept writes to the migrated table, in which case it cannot reliably determine all changes are propagated to the ghost table upon cutover phase.If you know for sure your setup is active-passive, you should be on safe grounds.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
from gh-ost.
What if we have an active-active multimaster topology? Does it mean we can't use this tool?
from gh-ost.
@thedrow I need to wrap my head around this some more; right now I will update the docs to indicate active-active is not supported. Whether it would actually work or not is what I'll be thinking of. I've worked a lot with active-active setups and there was such a variety of corner cases that I'm afraid to be missing something.
from gh-ost.
See #148
from gh-ost.
Need to fix error message to indicate --allow-master-master
as a hint for successful execution
from gh-ost.
So, one weird thing with passive/active master/master configs is that gh-ost finds the master that's "furthest" away from the current replica, which means that it sometimes applies changes to the passive side of the master/master pair.
It would be nice to either (a) be able to specify --master-address
, or (b) have gh-ost look at which database is read_only and apply it on the one that isn't.
Thoughts?
from gh-ost.
That is to say, given the following configuration:
Where only (A) is writable, if gh-ost is invoked on (D) or (E), it will attempt to do the migration on (C). This proceeds if the user has SUPER (since SUPER users can override read_only
unless you're on WebScaleSQL or Percona with the super_read_only patch), but can cause data corruption if there are writes being served on (A), since there won't actually be a READ LOCK acquired on the table on the correct host during the swap.
Obviously there are other issues with this kind of setup, but it seems plausible to either look at read_only
or allow the user to specify the master host.
from gh-ost.
@Roguelazer I've similarly found the same.
A simple solution would be: if master-master, then force user to specify active master. Operationally though, I'm not sure this is easy on the user. Sometimes the user herself is unaware who the active master is as it is obscured by virtual IP.
- outlining this solution: if
gh-ost
sees a master-master setup, and the connected server is not one of the two (so, a normal replica), it will bail out. --allow-master-master
would perhaps change to something like--yes-this-really-is-the-active-master-trust-me
.
Detecting read_only
is a sensible approach. Operationally again, this can flip throughout the migration anyhow.
Lastly, I really want to wrap my head around whether active-active is valid. It may actually be valid -- I'm unsure as yet but a few scenarios I ran in my mind seem fine.
from gh-ost.
I do actually like being able to run on a replica instead of the master, though, so it would be kind of a bummer if the only supported configuration for --allow-master-master
required me to run gh-ost on the current master.
The biggest problem with active-active seems the be the lock to flip the tables. You'd need to get a lock on both masters before you could safely do the swap, right?
from gh-ost.
The one problem I'm positive of right now is that of:
M1 <--> M2 --> R1
such that R1 is the replica, M1 is the master gh-ost
chooses to operate on, and while table is locked in M1, M2 still writes to the table.
Placing a lock on both masters -- sounds feasible. I'm going to spend some time thinking about this.
from gh-ost.
Related Issues (20)
- Lock wait timeout exceeded during cutover HOT 2
- "--attempt-instant-ddl" flag causing some issues with hooks and is incompatible with --execute flag HOT 1
- When the binlog file is larger than 4G, data loss occurs HOT 2
- Incorrect max retries in streamer
- Status message is not properly formatted and contains MISSING on STDERR HOT 1
- # Set the sshd service to be started automatically
- 👋 Hey there spelunker. It looks like you've modified some files that we can't accept as contributions:
- support create-table flag for simplified gh-ost migration
- [TASK] Confirm if your service is required for Proxima
- "attempt-instant-ddl" should support lock_wait_timeout HOT 1
- max-lag-millis parameter description is misleading when running on master HOT 3
- When will the throttled state be triggered HOT 1
- Does gh-ost support distributed databases? HOT 2
- binlog syncer closes unexpectedly
- PR HOT 2
- Feature request: support setting the `wait_timeout` of `gh-ost` HOT 1
- cut-over locks not released when gh-ost pauses mid-cut-over
- Aliii HOT 1
- FATAL invalid sequence 8 != 1
- Cannot log in to mysql DB by ghost user
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gh-ost.