-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixes query cache so that it is aware of wsrep_sync_wait. Query cache would return (possibly stale) results to the client, regardless of the value of wsrep_sync_wait. - Includes the test case that reproduced the issue.
- Loading branch information
Showing
8 changed files
with
77 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; | ||
INSERT INTO t1 VALUES (DEFAULT); | ||
SET GLOBAL query_cache_size=1355776; | ||
SET SESSION wsrep_sync_wait = 7; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--query_cache_type=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--source include/galera_cluster.inc | ||
--source include/have_innodb.inc | ||
--source include/have_query_cache.inc | ||
|
||
CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; | ||
INSERT INTO t1 VALUES (DEFAULT); | ||
|
||
--connection node_2 | ||
--let $qcache_size_orig = `SELECT @@GLOBAL.query_cache_size` | ||
SET GLOBAL query_cache_size=1355776; | ||
SET SESSION wsrep_sync_wait = 7; | ||
|
||
--disable_query_log | ||
|
||
--let $count = 10000 | ||
while ($count) | ||
{ | ||
--connection node_1 | ||
INSERT INTO t1 VALUES (DEFAULT); | ||
--let $val1 = `SELECT LAST_INSERT_ID()` | ||
--connection node_2 | ||
--let $val2 = `SELECT MAX(id) FROM t1` | ||
--let $val3 = `SELECT $val1 != $val2` | ||
if ($val3) | ||
{ | ||
--echo $val1 $val2 | ||
--die wsrep_sync_wait failed | ||
} | ||
--dec $count | ||
} | ||
|
||
--eval SET GLOBAL query_cache_size = $qcache_size_orig | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters