Error 1290 executing flush logs in read-only slave

Bug #1652852 reported by Juan Pablo Arruti
6
This bug affects 1 person
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
New
Undecided
Unassigned
5.6
New
Undecided
Unassigned
5.7
Fix Released
High
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 in read-only for a user without super privilege:

ERROR 1290 (HY000): The MySQL server is running with the --read-only option so it cannot execute this statement

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
read_only = ON

Requirements:

A) Master/slave configuration using GTIDs.
B) User with reload privilege and without super privilege.

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.02 sec)

2) In Slave instance execute flush logs:

mysql> show grants ;
+------------------------------------------------+
| Grants for test_user@localhost |
+------------------------------------------------+
| GRANT RELOAD ON *.* TO 'test_user'@'localhost' |
+------------------------------------------------+

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

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

-- Terminal 1

mysql> show master status ;
+------------------+----------+--------------+------------------+-------------------------------------------------------------------------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+----------+--------------+------------------+-------------------------------------------------------------------------------------+
| mysql-bin.000006 | 726 | | | 3bc8c55f-cc7b-11e6-8186-020846607241:1-10,
42f9d661-cc7b-11e6-8175-020846607241:1-2 |
+------------------+----------+--------------+------------------+-------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

-- Terminal 2

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

-- Terminal 1

mysql> show master status ;
+------------------+----------+--------------+------------------+-------------------------------------------------------------------------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+----------+--------------+------------------+-------------------------------------------------------------------------------------+
| mysql-bin.000007 | 234 | | | 3bc8c55f-cc7b-11e6-8186-020846607241:1-10,
42f9d661-cc7b-11e6-8175-020846607241:1-2 |
+------------------+----------+--------------+------------------+-------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

Revision history for this message
Juan Pablo Arruti (juanarru) wrote :

Persona Server 5.7.16

description: updated
Changed in percona-server:
status: New → Confirmed
tags: added: regression super-read-only upstream
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

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

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

Other bug subscribers

Remote bug watches

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