-
Notifications
You must be signed in to change notification settings - Fork 937
hook for graceful master switch #428
Comments
This makes sense. Assigning to myself. |
Hi @shlomi-noach just wondering if you have any plans to implement this in the near future? I understand if there are other priorities :) |
@igroene I haven't prioritized this yet. Let me look into it. |
@igroene this came up, for which a PR is ready and will It takes a different approach, but I think solves your case, too. You'll get a This was we can avoid specialized hooks. You will read the value of the What do you think? |
Hi @shlomi-noach unfortunately I think this does not solve the case I presented above.
I would suggest either change the order as follows:
or (probably better):
Thank you |
Ah, I see your point. Let me look into both options. |
@shlomi-noach yes, PreGracefulSwiftProcesses would like useful feature |
I hope to propose a PR this week. |
@shlomi-noach the hook worked perfectly! thank you for that. I am able to run sysbench and do a graceful switch without any errors :)
I also took the liberty of testing the other part of the PR:
That is not working for me via GUI by drag-dropping one of the 2 existing slaves to the left of the master in a simple 3 node topology (1 master, 2 direct slaves). I get this message:
|
@igroene could you share your orchestrator.conf.json with gracefull update proxysql commands? |
Here is orchestrator.conf.json I am using for testing:
and here is the graceful switch hook:
|
Great!
Thank you for testing! I think you might need a refresh to reload your JavaScript which is likely cached. But I'll double check. |
I tried the refresh but still getting the same error |
@igroene how you switch to new master ? |
I am switching by drag-dropping via GUI. PostFailoverProcesses is empty because I don't need a hook for that for this test. ProxySQL will detect the change in read-only that Orchestrator does and move hosts around hostgroups as needed. |
it will be over ProxySQL scheduler switch or over other functionality? |
Very good. The rest of the features are still work in progress. It will take a while to merge the branch. |
Thanks @shlomi-noach ! |
@igroene I'd like to suggest this isn't good practice. See my comment on https://mydbops.wordpress.com/2018/03/15/proxysql-series-seamless-replication-switchover-using-mha/, but I will write a more elaborate blog post. |
Thanks for the warning, I agree with your comment. Just to clarify this is just a testing playground, I wouldn't use this for a prod deployment. |
@igroene I still think this is a JavaScript issue. Can you please check the following? Source Does the entire line read:
or
? |
You are right, the version being displayed by the browser reads as the first example altought I can't find the reason for that. Tried deleting browser cache, 2 other browsers and still get the same. I double checked the version I compiled indeed has the correct version so I am clueless at this point. Will keep investigating. |
The first example is the desired one, actually 😛 |
No ideas yet. Seems like you're running GTID or pseudo GTID and that it should work. |
What happens if you relocate "mysql1" under "mysql2"? |
Sorry about the delay, I was out for a couple of days. I am indeed using GTID, and if I move mysql1 under mysql2, then try to promote mysql2 it works as expected.
I did a few more tests and I seem to "randomly" get the "too complex" message with one of the slaves. If I then try to promote the other slave it works. |
Can you please verify that |
I have been running some graceful master takeover testing using ProxySQL and Orchestrator together, and I believe it would be a good idea to have a hook that is triggered even earlier than
PreFailoverProcesses
.The issue with
PreFailoverProcesses
is that it is triggered after the demoted master has already been placed by Orchestrator in read_only mode, as shown by this extract from the log:For the ProxySQL use case, this returns errors to the application as soon as the host is set in read_only mode.
I would like to use the proposed hook to have ProxySQL set the old master to offline_soft and give active connections a chance to finish work to minimize errors the application is returned.
The text was updated successfully, but these errors were encountered: