mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-18450 Slaves wait shutdown
The patches features an optional shutdown behavior to hold on until after all connected slaves have been sent the last binlogged event. The connected slave is one whose START SLAVE has been acknowledged and that was not stopped since that though it could be technically reconnecting in background. The solution therefore disallows killing the dump thread until is has found EOF of the latest binlog file. It is up to the shutdown requester (DBA) to set up a sufficiently large shutdown timeout value for shudown to wait patiently until lagging behind slaves have been synchronized. On the other hand if a specific slave needs exclusion from synchronization the DBA would have to stop it manually which would terminate its dump thread. `mysqladmin shutdown' is extended with a `--wait_for_all_slaves' option which translates to `SHUTDOW WAIT FOR ALL SLAVES' sql query to enable the feature on the client side. The patch also performs a small refactoring of the server shutdown around close_connections() to introduce kill thread phases which are two as of current.
This commit is contained in:
committed by
Andrei Elkin
parent
e450527938
commit
3568427d11
@ -2168,6 +2168,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
||||
*/
|
||||
enum mysql_enum_shutdown_level level;
|
||||
level= (enum mysql_enum_shutdown_level) (uchar) packet[0];
|
||||
thd->lex->is_shutdown_wait_for_slaves= false; // "deferred" cleanup
|
||||
if (level == SHUTDOWN_DEFAULT)
|
||||
level= SHUTDOWN_WAIT_ALL_BUFFERS; // soon default will be configurable
|
||||
else if (level != SHUTDOWN_WAIT_ALL_BUFFERS)
|
||||
|
Reference in New Issue
Block a user