-
Notifications
You must be signed in to change notification settings - Fork 65
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
Conversation
1a8f533
to
43e5f6b
Compare
r.logger.WithField("error", err).Errorf("could not open connection to master replica") | ||
r.Ferry.ErrorHandler.Fatal("sharding", err) | ||
} | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
Simplifies the logger passing in a little bit as nowhere else use these methods.
c513b58
to
fc57718
Compare
Can I get a review on this PR soon? |
- Use two example configurations - Fixed import alias typo
I'm merging this for now as agreed upon for now so we can unblock further work. |
https://shopify.github.io/ghostferry/master/copydbinprod.html#prerequisites
Maybe the document should be updated? |
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.