Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow CopyDB to run on a read only replica #35

Merged
merged 7 commits into from
Aug 2, 2018

Conversation

shuhaowu
Copy link
Contributor

@shuhaowu shuhaowu commented Jun 4, 2018

This refactored the sanity check logic for the replication config into ghostferry.Ferry so that both sharding and copydb can benefit from it. This PR also adds the necessary configuration to copydb to allow it to run off of a read only replica.

I've also updated the local docker-compose setup to three nodes so people can test it easily with the example config.

@shuhaowu shuhaowu force-pushed the copydb-integration branch 3 times, most recently from 1a8f533 to 43e5f6b Compare June 4, 2018 21:27
r.logger.WithField("error", err).Errorf("could not open connection to master replica")
r.Ferry.ErrorHandler.Fatal("sharding", err)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason this was here is that we pt-kill idle connections on the db. So, if we open the connection too soon it might get killed by the server by the time we need it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the Go driver reconnect automatically?

@shuhaowu
Copy link
Contributor Author

Can I get a review on this PR soon?

- Use two example configurations
- Fixed import alias typo
@shuhaowu
Copy link
Contributor Author

shuhaowu commented Aug 2, 2018

I'm merging this for now as agreed upon for now so we can unblock further work.

@tclh123
Copy link
Contributor

tclh123 commented Nov 6, 2018

https://shopify.github.io/ghostferry/master/copydbinprod.html#prerequisites

In cases of a multi-node replication setup, Ghostferry should only be run on the master database where writes occur. Otherwise there may be a race condition causing some binlog entries to be missed.
There may be a way to fix this in the future.

Maybe the document should be updated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants