Query cache should be invalidated in non-PRIMARY

Bug #1296403 reported by Raghavendra D Prabhu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL patches by Codership
New
High
Unassigned
5.5
New
High
Unassigned
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
Status tracked in 5.6
5.5
Fix Released
Undecided
Unassigned
5.6
Fix Released
Undecided
Unassigned

Bug Description

When query cache is used and a node goes into non-PRIM state, queries which returned results earlier (and cached into query cache) still return results whereas newer queries (or the ones not cached) return 'unknown command'. This inconsistent return of results should be prevented by invalidating query cache when a node becomes non-PRIM (or when wsrep_ready is OFF).

Related branches

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

=== modified file 'sql/wsrep_mysqld.cc'
--- sql/wsrep_mysqld.cc 2014-04-20 17:19:52 +0000
+++ sql/wsrep_mysqld.cc 2014-04-20 18:36:58 +0000
@@ -230,6 +230,10 @@

   /* Proceed further only if view is PRIMARY */
   if (WSREP_VIEW_PRIMARY != view->status) {
+#ifdef HAVE_QUERY_CACHE
+ // query cache must be initialised by now
+ query_cache.flush();
+#endif /*HAVE_QUERY_CACHE*/
     wsrep_ready_set(FALSE);
     new_status= WSREP_MEMBER_UNDEFINED;
     /* Always record local_uuid and local_seqno in non-prim since this

in wsrep_view_handler_cb should do.

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/PXC-1655

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.