Error 1290 executing flush logs in read-only slave
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-
Variables for Slave:
gtid-mode = ON
enforce-
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'
+------
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-
42f9d661-
+------
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-
42f9d661-
+------
1 row in set (0.00 sec)
tags: | added: regression super-read-only upstream |
Persona Server 5.7.16