Thanks Kristian, this is really useful for MaxScale. It should aid the read/write splitting a lot and give us a great advantage using MariaDB with MaxScale.
Mark On 6 Mar 2014, at 18:56, Kristian Nielsen <[email protected]> wrote: > Mark Riddoch <[email protected]> writes: > >> We have been looking for a cheap way to find this out and came up with an >> idea for MariaDB 10 that might be good to discuss. If we use the global >> transaction ID we can get the current master ID and the current GTID form >> each slave and use them to compare and discover if a slave is lagging based >> on a single connection from a client or the entire server. Clearly we can >> get this by jus asking in a polling monitor loop, but what would be really >> good would be to have a function in MariaDB that we could call that would >> wait for the GTID id to change and return the new GTID. THen we could have a >> monitor that makes this blocking call and get's to know the new GTID very >> quickly compered to having to have some form of poling loop, which would >> limit to the rate of change that could be detected to the polling rate of >> the monitor. > > See here: > > http://kristiannielsen.livejournal.com/18308.html > > It's similar to what you describe. MASTER_GTID_WAIT() is already in 10.0 (I > can't remember if it is in 10.0.8, else it will be in 10.0.9). > > Note that if you really want to wait for any change in GTID on a slave, you > can just take the current @@gtid_slave_pos, add one to every sequence number, > and wait for that. > > - Kristian. _______________________________________________ Mailing list: https://launchpad.net/~maria-developers Post to : [email protected] Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp

