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

Support manual replication stop in --test-on-replica #162

Closed
pbitty opened this issue Aug 17, 2016 · 6 comments
Closed

Support manual replication stop in --test-on-replica #162

pbitty opened this issue Aug 17, 2016 · 6 comments

Comments

@pbitty
Copy link
Contributor

pbitty commented Aug 17, 2016

Hello, I am trying to use gh-ost with Amazon's RDS. Unfortunately, RDS doesn't give you SUPER privileges, so the stop slave statement doesn't work, when running it in --test-on-replica mode.

To work around this, I'm working off my own branch and I've patched it to wait for replication to stop.

RDS does have its own command for stopping replication: call mysql.rds_stop_replication However, I wanted to avoid polluting the tool with RDS-specific statements, so I opted for just manually running the replication stop command externally.

Do you have any thoughts on whether/how this could be supported? Perhaps a CLI argument like --manual-replication-stop?

I am happy to contribute a PR.

@shlomi-noach
Copy link
Contributor

@pbitty I suspect this can be solved via #62 (no work has begun on this)

So that gh-ost will call an external hook when it's ready to stop slave on replica, and that hook would be any process/script you will write on your own. Do you think that will satisfy the need?

shlomi-noach referenced this issue in Wattpad/gh-ost Aug 18, 2016
This will wait indefinitely for the replication status to change.
This allows us to run `--test-on-replica` in RDS without making
extensive modifications.
@pbitty
Copy link
Contributor Author

pbitty commented Aug 18, 2016

@shlomi-noach Yes, the approach of #62 sounds ideal! And much more flexible in terms of integrating with other tools and test workflows.

I think there is still the concern of whether gh-ost should issue the stop slave command in --test-on-replica mode. I would expect #62 not to change that behavior.

One possible approach (in --test-on-replica) would be to check replication status before trying to stop it (after the pre-cut-over hook has been executed), and if replication has been stopped, skip the stop slave command.

What do you think?

@shlomi-noach
Copy link
Contributor

If the only change is whether to stop slave or not to stop slave, I'm fine to add a command line flag saying --test-on-replica-avoid-stop-replication or similar.

Eventually, as we progress with RDS support we may consolidate some flags to --hey-this-is-rds-do-the-right-thing

or, we may just recognize this is rds from within MySQL itself (what does select VERSION() tell you?)

@pbitty
Copy link
Contributor Author

pbitty commented Aug 18, 2016

Ok, that sounds great. I will submit a PR with that setting.

Just to confirm, you would prefer a single flag like --test-on-replica-manual-replication-stop vs an add-on flag, requiring two flags? ie: --test-on-replica --manual-replication-stop.

Do I have that right?

@shlomi-noach
Copy link
Contributor

Yes, I'd rather have a single flag that clarifies its intention. Also,
please use your fluent English skills to find a good name!

Thanks

On Thursday, August 18, 2016, Paulo Bittencourt [email protected]
wrote:

Ok, that sounds great. I will submit a PR with that setting.

Just to confirm, you would prefer a single flag like
--test-on-replica-manual-replication-stop vs an add-on flag, requiring
two flags? ie: --test-on-replica --manual-replication-stop.

Do I have that right?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#162 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACfLPrvgqd7EQ89peuMDPkOIwJYX4Aieks5qhFC5gaJpZM4Jm5yZ
.

Shlomi Noach
Systems Engineer
GitHub

@pbitty
Copy link
Contributor Author

pbitty commented Aug 18, 2016

As for RDS, select VERSION() returns eg. 5.6.23-log. There are other hints, but they're indirect - like the global variable basedir=/rdsdbbin/mysql/.

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

No branches or pull requests

2 participants