Query cache should be invalidated in non-PRIMARY

Bug #1296403 reported by Raghavendra D Prabhu on 2014-03-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL patches by Codership
High
Unassigned
5.5
High
Unassigned
Percona XtraDB Cluster
Status tracked in 5.6
5.5
Undecided
Unassigned
5.6
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

lp:~percona-core/percona-xtradb-cluster/trunk-25-Bug1296403
Merged into lp:percona-xtradb-cluster/5.5 at revision 729
Raghavendra D Prabhu: Approve on 2014-04-22

=== 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.

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

Other bug subscribers