replicate FLUSH QUERY CACHE command

Bug #1359801 reported by Seppo Jaakola on 2014-08-21
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL patches by Codership
Wishlist
Unassigned
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
Status tracked in 5.6
5.5
Won't Fix
Medium
Unassigned
5.6
Fix Committed
Medium
Unassigned

Bug Description

wsrep cluster supports query cache (QC) currently. However, the cache will be node local, each node maintains his own cache.
If application is using QC, there may be need to flush/freset the cache at some point.

Therefore the commands: FLUSH QUERY CACHE and RESET QUERY CACHE should be replicated to the cluster, to make sure that no old cached results will be returned to clients.

This can be implemented as TOI operation, although less synchronous implementation would be fine for this purpose as well.

Changed in codership-mysql:
importance: Undecided → Wishlist
Nirbhay Choubey (nirbhay) wrote :

"RESET" commands for some reason are never written to the binary log :
..
  case SQLCOM_RESET:
    /*
      RESET commands are never written to the binary log, so we have to
      initialize this variable because RESET shares the same code as FLUSH
    */
    lex->no_write_to_binlog= 1;
   /* fallthrough */
    case SQLCOM_FLUSH:
..

Verified with PXC 5.5 and 5.6. FLUSH QUERY CACHE is written in binlog but not RESET QUERY CACHE.

[root@percona-pxc55-1 ~]# mysql -uroot -p
Enter password:
...
mysql> create table nil (id int, name varchar(10));
Query OK, 0 rows affected (0.07 sec)

mysql> FLUSH QUERY CACHE;
Query OK, 0 rows affected (0.00 sec)

mysql> RESET QUERY CACHE;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye
[root@percona-pxc55-1 ~]#

[root@percona-pxc55-1 mysql]# mysqlbinlog mysql-bin.000018
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#140821 19:14:30 server id 3 end_log_pos 107 Start: binlog v 4, server v 5.5.37-35.0-55-log created 140821 19:14:30 at startup
...
# at 280
#140821 19:16:52 server id 3 end_log_pos 386 Query thread_id=5 exec_time=0 error_code=0
SET TIMESTAMP=1408628812/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
create table nil (id int, name varchar(10))
/*!*/;
# at 386
#140821 19:17:14 server id 3 end_log_pos 471 Query thread_id=5 exec_time=0 error_code=0
SET TIMESTAMP=1408628834/*!*/;
SET @@session.auto_increment_increment=2, @@session.auto_increment_offset=2/*!*/;
FLUSH QUERY CACHE
/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
[root@percona-pxc55-1 mysql]#

Krunal Bauskar (krunal-bauskar) wrote :

This is solved in latest 5.6. Please refresh.

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

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

Other bug subscribers