super-read-only not allow FLUSH LOGS on 5.7

Bug #1654682 reported by Juan Pablo Arruti on 2017-01-06
14
This bug affects 2 people
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
Invalid
Undecided
Unassigned
5.7
Fix Released
Medium
Laurynas Biveinis

Bug Description

Description:

Tested in Percona Server 5.7.16 and MySQL Community 5.7.17.

Flush logs command shows the following error when is executed in a slave instance with super-read-only by root user:
ERROR 1290 (HY000): The MySQL server is running with the --super-read-only option so it cannot execute this statement

This also affects mysqladmin flush-logs command.

How to repeat:

Variables for Master:

gtid-mode = ON
enforce-gtid-consistency = ON

Variables for Slave:

gtid-mode = ON
enforce-gtid-consistency = ON
log_slave_updates = ON
super_read_only = ON

Requirements:

A) Master/slave configuration using GTIDs.

Procedure:

1) In Master instance create a table and insert a row on it.

mysql> create table test (col integer) ;
Query OK, 0 rows affected (0.03 sec)

mysql> insert into test values (1);
Query OK, 1 row affected (0.01 sec)

2) In Slave instance log as root user and flush logs.

mysql> flush logs ;
ERROR 1290 (HY000): The MySQL server is running with the --super-read-only option so it cannot execute this statement

Regardless of the error message, the logs are flushed by the command:

mysql> show master status ;
+------------------+----------+--------------+------------------+----------------------------------------------------------------------------------------------------------------------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+----------+--------------+------------------+----------------------------------------------------------------------------------------------------------------------------------+
| mysql-bin.000079 | 690 | | | 3bc8c55f-cc7b-11e6-8186-020846607241:1-197,42f9d661-cc7b-11e6-8175-020846607241:1-5,bb73025c-d38a-11e6-8547-020846607241:2-125 |
+------------------+----------+--------------+------------------+----------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> flush logs ;
ERROR 1290 (HY000): The MySQL server is running with the --super-read-only option so it cannot execute this statement

mysql> show master status ;
+------------------+----------+--------------+------------------+----------------------------------------------------------------------------------------------------------------------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+----------+--------------+------------------+----------------------------------------------------------------------------------------------------------------------------------+
| mysql-bin.000080 | 274 | | | 3bc8c55f-cc7b-11e6-8186-020846607241:1-197,42f9d661-cc7b-11e6-8175-020846607241:1-5,bb73025c-d38a-11e6-8547-020846607241:2-125 |
+------------------+----------+--------------+------------------+----------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

Suggested fix: Avoid error message if all logs are flushed.

tags: added: upstream

Does it work on PS 5.6? (in which case it would be a regression due to implementation switch to upstream)

Sveta Smirnova (svetasmirnova) wrote :

Wit debug version I get crash when try to run FLUSH LOGS command:

mysqld: /home/sveta/src/percona-server/sql/sql_error.cc:380: void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*): Assertion `! is_set()' failed.
12:14:55 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.
Please help us make Percona Server better by reporting any
bugs at http://bugs.percona.com/

key_buffer_size=1048576
read_buffer_size=131072
max_used_connections=1
max_threads=152
thread_count=3
connection_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 61221 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x7fa158000950
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7fa1a0605e18 thread_stack 0x40000
/home/sveta/build/ps-5.7/bin/mysqld(my_print_stacktrace+0x47)[0x197c087]
/home/sveta/build/ps-5.7/bin/mysqld(handle_fatal_signal+0x440)[0xf06407]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fa1a62b4390]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7fa1a566d428]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7fa1a566f02a]
/lib/x86_64-linux-gnu/libc.so.6(+0x2dbd7)[0x7fa1a5665bd7]
/lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7fa1a5665c82]
/home/sveta/build/ps-5.7/bin/mysqld(_ZN16Diagnostics_area13set_ok_statusEyyPKc+0x75)[0x15cbb23]
/home/sveta/build/ps-5.7/bin/mysqld(_Z5my_okP3THDyyPKc+0x4e)[0xf1b7df]
/home/sveta/build/ps-5.7/bin/mysqld(_Z21mysql_execute_commandP3THDb+0x54cf)[0x161ed32]
/home/sveta/build/ps-5.7/bin/mysqld(_Z11mysql_parseP3THDP12Parser_state+0x720)[0x1622db1]
/home/sveta/build/ps-5.7/bin/mysqld(_Z16dispatch_commandP3THDPK8COM_DATA19enum_server_command+0xc41)[0x1617008]
/home/sveta/build/ps-5.7/bin/mysqld(_Z10do_commandP3THD+0x59e)[0x1615e8f]
/home/sveta/build/ps-5.7/bin/mysqld(handle_connection+0x2b1)[0x17655f6]
/home/sveta/build/ps-5.7/bin/mysqld(pfs_spawn_thread+0x173)[0x1e58e67]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7fa1a62aa6ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7fa1a573e82d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7fa1580043d0): flush logs
Connection ID (thread ID): 5
Status: NOT_KILLED

Sveta Smirnova (svetasmirnova) wrote :

Bug is not repeatable with version 5.6.34-79.0

So this is a regression for users upgrading from 5.6 (Percona feature implementation) to 5.7 (Oracle implementation)

tags: added: regression
tags: added: super-read-only

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1772

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.