-
Notifications
You must be signed in to change notification settings - Fork 928
Hook for take-master / GracefulIntermediateMasterTakeover #799
Comments
@daniel-2647 is there anything you'd want to do other than relocating those replicas under the promoted server? |
Thanks @shlomi-noach for the response, that would be wonderful. The reasoning for asking for a hook, is because we use proxysql, and at times, also haproxy with consul / consul-template. For instance, we would rather not have the intermediate master receive reads, and also, not have the secondary slaves receive any writes. Let's say in the scenario above, sm-ohq-applogdb-1 was the original intermediate master. That host can receive writes, it belongs to the writer hostgroup in proxysql, and all its slaves (which are read only) can only receive reads and belong to the readers hostgroup in proxysql. When we do a graceful promotion of sm-atl-applogdb-3 to become the new intermediate master, we would like to also make changes to proxysql, so this host is moved from the readers hostgroup to the writers hostgroup, and the old intermediate master, is moved to the readers hostgroup. We would also like to make changes to the consul store (via the hooks) when these changes took place. We can also make other policy changes and re-assign certain proxysql query rules to a given host via the hooks once the intermediate promotion takes place. Does that make sense? I also use the hooks to set the slaves read-only (including the old intermediate master) and the new intermediate master read/write. As always, thank you for your time and appreciate all the work, dedication and the effort into orchestrator. |
Hello Shlomi, we have the following test topology and db hosts:
1 MASTER --> shadowmaster (has all schemas)
3 SLAVES --> sm hosts (have only certain schemas being replicated, but they all have the same filter)
Initial topology:
We are using AutoPseudoGTID and everything is working as expected.
Here's a scenario I'm trying to make work, but so far have not been able to:
We would like to be able to drag/drop (promote) sm-atl-applogdb-3 so it becomes master of both sm-ohq-applogdb-1 and sm-ohq-applogdb-2, and have sm-atl-applogdb-3 replicate from shadowmaster, as shown below:
Unfortunately, this does not happen, and we end up with the following: (notice sm-ohq-applogdb-2 remained as slave of the old master)
I attempted to use a hook, as I thought this would fall under PostIntermediateMasterFailoverProcesses. I created a hook that would move all slaves of the old intermediary master (in this case sm-ohq-applogdb-1) as slaves of the new master (sm-atl-applogdb-3), but it never got called.
When troubleshooting the PostIntermediateMasterFailoverProcesses hook to find out why it was not being called, I noticed it never get's triggered, and maybe it is because this is being handled during the take-master call, and not as a graceful intermediate master promotion.
Here are the logs:
Would it be possible to create a GracefulIntermediateMasterTakeover hook or a hook for the take-master call above?
Thanks for your time, please let me know if you have any questions and I can try to explain more if needed.
The text was updated successfully, but these errors were encountered: