mysqladmin shutdown hangs after flush-logs error
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
| MySQL Server |
Unknown
|
Unknown
|
|||
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
| 5.5 |
Invalid
|
Undecided
|
Unassigned | ||
| 5.6 |
New
|
Undecided
|
Unassigned | ||
| 5.7 |
Triaged
|
High
|
Robert Golebiowski |
Bug Description
Description:
mysqladmin shutdown command hangs when it's called after flush error (ERROR 1290) on slave instance using super_read_only variable.
Instance does not accept more connections and the only way to stop it is killing mysql process.
Seems to be realted with upstream bugs #84332 (compression of mysql.gtid_executed has been prevented when super_read_only = 1) and #84437 (super-read-only does not allow FLUSH LOGS on 5.7).
How to repeat:
Variables for Master:
gtid_mode = ON
enforce_
Variables for Slave:
log_bin=mysql-bin
gtid_mode = ON
enforce_
log_slave_updates = ON
super_read_only = ON
Requirements:
A) Master/slave configuration using GTIDs.
B) Slave instance is using super_read_only.
C) High amount of transactions been executed on master.
Procedure:
A) Execute high amount of transactions on master, I've used following sysbench command:
sysbench --test=oltp.lua --mysql-
B) Table mysql.gtid_executed grows to a considerable amount of rows:
mysql> select count(*
+------
| count(*) | @@super_read_only | @@read_only |
+------
| 2684 | 1 | 1 |
+------
C) Execute flush logs using mysqladmin or using mysql cli till get 1290 error:
juan.arruti@
Enter password:
mysqladmin: refresh failed; error: 'The MySQL server is running with the --super-read-only option so it cannot execute this statement'
D) Shut down MySQL process:
juan.arruti@
Enter password:
^CWarning; Aborted waiting on pid file: '/home/
Here is output from pt-pmp, it seems that is waiting for gtid_table thread but we saw in upstream bug #84332 that this is not happening.
root@bm-
Sat Jan 21 13:14:04 EST 2017
92 pthread_join.c: No such file or directory.
10 __io_getevents_
3 pthread_
1 row_upd(
1 pthread_
1 pthread_
1 pthread_
1 pthread_
1 pthread_
1 pthread_
1 pthread_
1 pthread_
1 pthread_
1 pthread_
1 pthread_
1 poll,vio_
1 nanosleep,
1 nanosleep,
1 do_sigwaitinfo,
Workaround seems to be disable super_read_only to let mysql compress gtid_table ant then shutdown the instance.
Suggested fix: Let MySQL compress gtid_table when super_read_only is enable.
Juan Pablo Arruti (juanarru) wrote : | #1 |
tags: | added: upstream |
tags: | added: 162685 |
This should be fixed by commit:
commit b24fedd4a043088
Author: Sujatha Sivakumar <email address hidden>
Date: Tue Nov 15 12:01:05 2016 +0530
Bug#22857926: ASSERTION `! IS_SET()' AT SQL_ERROR.CC:38 IN
READ_ONLY MODE FOR MANY RPL CMDS.
Problem:
=======
This bug is opened to fix assertion `! is_set()' at
sql_
(ulonglong, ulonglong, const char*)" for many RPL commands.
This issue has been fixed for couple of commands with
Bug#22097534. But, still issue exists for few other
commands.
RPL commands affected:-
===
[PENDING] 1. FLUSH LOGS;
[PENDING] 2. RESET SLAVE ALL;
[PENDING] 3. SET GLOBAL gtid_purged=
[FIXED] 4. CHANGE MASTER TO..
[FIXED] 5. CHANGE REPLICATION FILTER
[FIXED] 6. START SLAVE;
[FIXED] 7. STOP SLAVE;
Analysis:
========
When the above set of commands are executed they will try
to update replication specific system tables. For example
mysql.
mysql.
mysql.
This scenario is applicable to all replication specific
internal system tables. During the fix for Bug22097534 it
was concluded that "read only" mode should prevent changes
to user data, but not to prevent normal Server operations or
to prevent a DBA from managing the state of the MySQL Server
itself.
Hence the above commands should be able to update data in
replication specific internal tables.
Fix:
===
There exists a flag named 'ignore_
intention is to ignore the read only option and allow
commits to replication specific system tables. Reused
this flag as part of fix. If this flag is set then the
additional check for 'read only' option is not done.
Hence 'read only' mode error will not be reported and
command will complete successfully.
Should be re-verified and closed?
Juan Pablo Arruti (juanarru) wrote : | #4 |
Upstream bugs #84332 (compression of mysql.gtid_executed has been prevented when super_read_only = 1) and #84437 (super-read-only does not allow FLUSH LOGS on 5.7) are not longer happening in Percona Server 5.7.18, these two bugs were related with this hung. So this bug, can't be reproduced in PS 5.7.18.
Peter Schwaller (peter-schwaller) wrote : | #5 |
Fixed upstream?
Shahriyar Rzayev (rzayev-sehriyar) wrote : | #6 |
Percona now uses JIRA for bug reports so this bug report is migrated to: https:/
Tested in PS 5.7.16 and MySQL Community 5.7.17