[MDEV-4990] Implement simple failover script using GTID Created: 2013-09-03  Updated: 2023-10-12

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Major
Reporter: Kristian Nielsen Assignee: Kristian Nielsen
Resolution: Unresolved Votes: 4
Labels: gtid


 Description   

GTID allows to automatically fail-over a master by promoting a slave as the
new master, bringing it up-to-date with any other slaves and switching
existing slaves to use the new master. The procedure is described in the
documentation.

https://mariadb.com/kb/en/global-transaction-id/#start-slave-until-master_gtid_posxxx

We need a script that implements this procedure. The user can then run this
script to promote a slave as a new master, simply by supplying connection
information for all involved servers.



 Comments   
Comment by VAROQUI Stephane [ 2013-09-03 ]

Could be possible to use the mysql.server table ? Could auto populate an information schema table when a slave connect and update a last seen date to produce warnings and errors in case of a outdated slave is picked by the command.

I would rather see a command more than a script as. One would like to create a corosync cluster plugin to be loaded inside MariaDB, synchronize all server information_schema.servers table with the corosync Totem Single Ring Ordering and Membership Protocol and can call such failover command on the Synchronization Engine plugin

Comment by VAROQUI Stephane [ 2013-09-03 ]

Possible to add an option to set last executed GTID in the information_schema.servers replicate with corosync cluster API any node could decide who is the most up to date slave in a consistante state, proxy and connection pools could enter the group member to make proper switch over without losing any command. Connection and SQL not in the group member could be refused.

Comment by Richard Bensley [ 2015-06-30 ]

Check this out, golang so no dependencies like perl/python/ruby needs at install:

https://github.com/tanji/mariadb-tools

Blog post:
http://varokism.blogspot.co.uk/2015/06/slave-election-is-welcoming-gtid.html

Comment by Ralf Gebhardt [ 2023-10-12 ]

I have removed the fixVersion for this task as it is one of 5.5, 10.1, 10.2, 10.3, which are EOLed.

Please add a new fixVersion if you plan to work on this task for a not EOLed versions.

Generated at Thu Feb 08 07:00:48 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.