# sudo systemctl status mariadb -l -n 60 | grep 'Slave I/O thread exiting' | wc -l
|
20
|
# sudo systemctl status mariadb -l -n 60 | grep 'Error reading packet from server' | wc -l
|
14
|
# sudo systemctl status mariadb -l -n 60 | grep 'slave SQL thread was killed' | wc -l
|
20
|
|
# sudo systemctl status mariadb -l -n 60
|
● mariadb.service - MariaDB server
|
Loaded: loaded (/nix/store/zx1q5mdi1jfxf2gkyc0kf2xajyjqmf2l-unit-mariadb.service/mariadb.service)
|
Active: deactivating (stop-sigterm) since Fri 2016-02-26 18:52:37 SGT; 5min ago
|
Main PID: 15106 (mysqld)
|
CGroup: /system.slice/mariadb.service
|
└─15106 /nix/store/z7x0ndrckrsmqr3163hp9kgs9hwags61-mariadb-10.1.11/bin/mysqld --defaults-file=/nix/store/8xbdbp9646d0hkld1kjjkfzvlicwill4-mysqld.cnf
|
|
Feb 26 13:21:43 grumpycat mysqld[15106]: 2016-02-26 13:21:43 140357032143616 [Note] Master 'bob-au': InnoDB: Online DDL : Start applying row log
|
Feb 26 13:21:43 grumpycat mysqld[15106]: 2016-02-26 13:21:43 140357032143616 [Note] Master 'bob-au': InnoDB: Online DDL : End of applying row log
|
Feb 26 13:21:43 grumpycat mysqld[15106]: 2016-02-26 13:21:43 140357032143616 [Note] Master 'bob-au': InnoDB: Online DDL : Completed
|
Feb 26 18:52:37 grumpycat systemd[1]: Stopping MariaDB server...
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140355741813504 [Note] /nix/store/z7x0ndrckrsmqr3163hp9kgs9hwags61-mariadb-10.1.11/bin/mysqld: Normal shutdown
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140355741813504 [Note] Event Scheduler: Purging the queue. 0 events
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140357032446720 [Note] Master 'bob-au': Slave I/O thread exiting, read up to log 'mysql-bin-changelog.140993', position 2514261
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356062956288 [Note] Master 'sc': Slave I/O thread exiting, read up to log 'mysql-bin-changelog.055135', position 3899105
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356064471808 [Note] Master 'bob-th': Error reading relay log event: slave SQL thread was killed
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356064774912 [ERROR] Master 'bob-th': Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356064774912 [Note] Master 'bob-th': Slave I/O thread exiting, read up to log 'mysql-bin-changelog.029169', position 4014853
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140357032749824 [Note] Master 'zops': Error reading relay log event: slave SQL thread was killed
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356388342528 [Note] Master 'bob-vn': Slave I/O thread exiting, read up to log 'mysql-bin-changelog.031459', position 27519726
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140357033052928 [ERROR] Master 'zops': Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140357033052928 [Note] Master 'zops': Slave I/O thread exiting, read up to log 'mysql-bin-changelog.191525', position 144203
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356387736320 [Note] Master 'bob-id': Slave I/O thread exiting, read up to log 'mysql-bin-changelog.029404', position 11517216
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356709182208 [Note] Master 'bob-my': Error reading relay log event: slave SQL thread was killed
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356709485312 [ERROR] Master 'bob-my': Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356709485312 [Note] Master 'bob-my': Slave I/O thread exiting, read up to log 'mysql-bin-changelog.027500', position 8437840
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356388645632 [Note] Master 'bob-hk': Error reading relay log event: slave SQL thread was killed
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356708879104 [ERROR] Master 'bob-hk': Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356708879104 [Note] Master 'bob-hk': Slave I/O thread exiting, read up to log 'mysql-bin-changelog.032108', position 19164112
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356711000832 [Note] Master 'bob-ph': Error reading relay log event: slave SQL thread was killed
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356711303936 [ERROR] Master 'bob-ph': Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356711303936 [Note] Master 'bob-ph': Slave I/O thread exiting, read up to log 'mysql-bin-changelog.029561', position 37345365
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140355742722816 [Note] Master 'sc': Error reading relay log event: slave SQL thread was killed
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140357032143616 [Note] Master 'bob-au': Error reading relay log event: slave SQL thread was killed
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356709788416 [Note] Master 'bob-sg': Error reading relay log event: slave SQL thread was killed
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356710091520 [ERROR] Master 'bob-sg': Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356710091520 [Note] Master 'bob-sg': Slave I/O thread exiting, read up to log 'mysql-bin-changelog.029613', position 25842793
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356711607040 [Note] Master 'bob-tw': Error reading relay log event: slave SQL thread was killed
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140357031840512 [ERROR] Master 'bob-tw': Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140357031840512 [Note] Master 'bob-tw': Slave I/O thread exiting, read up to log 'mysql-bin-changelog.032533', position 1015256
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356388039424 [Note] Master 'bob-vn': Error reading relay log event: slave SQL thread was killed
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356387433216 [Note] Master 'bob-id': Error reading relay log event: slave SQL thread was killed
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140357914893056 [Note] Master 'oms-my': Slave I/O thread exiting, read up to log 'mysql-bin-changelog.027098', position 3658520
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356386827008 [Note] Master 'oms-id': Error reading relay log event: slave SQL thread was killed
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356387130112 [ERROR] Master 'oms-id': Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356387130112 [Note] Master 'oms-id': Slave I/O thread exiting, read up to log 'mysql-bin-changelog.028565', position 1862130
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356063259392 [Note] Master 'delivery': Slave I/O thread exiting, read up to log 'mysql-bin-changelog.036789', position 549027
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356386220800 [Note] Master 'oms-hk': Error reading relay log event: slave SQL thread was killed
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356386523904 [ERROR] Master 'oms-hk': Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356386523904 [Note] Master 'oms-hk': Slave I/O thread exiting, read up to log 'mysql-bin-changelog.027210', position 658686
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140355742116608 [Note] Master 'oms-tw': Error reading relay log event: slave SQL thread was killed
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140355742419712 [ERROR] Master 'oms-tw': Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140355742419712 [Note] Master 'oms-tw': Slave I/O thread exiting, read up to log 'mysql-bin-changelog.003260', position 15332
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356710394624 [Note] Master 'oms-ph': Error reading relay log event: slave SQL thread was killed
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356710697728 [ERROR] Master 'oms-ph': Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356710697728 [Note] Master 'oms-ph': Slave I/O thread exiting, read up to log 'mysql-bin-changelog.029009', position 2157019
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356065684224 [Note] Master 'oms-sg': Error reading relay log event: slave SQL thread was killed
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356385917696 [ERROR] Master 'oms-sg': Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356385917696 [Note] Master 'oms-sg': Slave I/O thread exiting, read up to log 'mysql-bin-changelog.029242', position 2189116
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356065078016 [Note] Master 'oms-vn': Error reading relay log event: slave SQL thread was killed
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356065381120 [ERROR] Master 'oms-vn': Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356065381120 [Note] Master 'oms-vn': Slave I/O thread exiting, read up to log 'mysql-bin-changelog.031309', position 1933682
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356063562496 [Note] Master 'delivery': Error reading relay log event: slave SQL thread was killed
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356063865600 [Note] Master 'oms-th': Error reading relay log event: slave SQL thread was killed
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356064168704 [ERROR] Master 'oms-th': Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140356064168704 [Note] Master 'oms-th': Slave I/O thread exiting, read up to log 'mysql-bin-changelog.029404', position 380272
|
Feb 26 18:52:37 grumpycat mysqld[15106]: 2016-02-26 18:52:37 140357033356032 [Note] Master 'oms-my': Error reading relay log event: slave SQL thread was killed
|
Do you have a suggestion for reproducing this? Setting up 20-way
multi-source replication is not trivial, and it's not clear what "seems
never-ending" means, exactly?
The error messages look like just the normal messages when a slave is
stopped, or did I miss something?
I can imagine that shutdown with such a setup could take a while. What
happens is that each of the 20 master-slave connections can have 8MB (your
value of slave_parallel_max_queued) of events queued up. At stop, a
conservative safe point to stop is selected in each of these queues, so
there might be a bunch of events still need to be executed before stop can
complete. And with slave_parallel_threads=40 and
slave_domain_parallel_threads=10, most of the 20 master-slave might have to
wait for the others to release their threads.
Though this is assuming everything is busy and catching up to their masters
... and "seems never-ending" sounds more that what would be expected.
I checked the code, and I did not immediately spot that parallel replication
stop would act differently for STOP ALL SLAVES and SIGTERM. The stop of
parallel replication threads happens the same way after the SQL thread is
stopped. But it is definitely possible that there could be a bug or race in
slave stop, it is just not clear what it could be from the information given
here...
Maybe you could do a detailed check of the error log to see if all SQL and
IO threads stopped? I mean, if each of your 20 master-slave connections say
something like "slave SQL thread was killed" and "Slave I/O thread exiting".
It would help understand if the problem is related to stopping the IO/SQL
threads, or if it is related to parallel replication completing its queue of
events...