-
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.
- Eliminates code duplication in query cache patch - Reduces the number of iterations in mysql-wsrep#201.test to shorten the execution time - Adds a new test case that exercises more scenarios
- Loading branch information
Showing
5 changed files
with
148 additions
and
12 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
mysql-test/suite/galera/r/galera_query_cache_sync_wait.result
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,45 @@ | ||
CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; | ||
INSERT INTO t1 VALUES (1); | ||
SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT1S"; | ||
SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb"; | ||
SET SESSION wsrep_sync_wait = 7; | ||
SELECT MAX(id) FROM t1; | ||
MAX(id) | ||
1 | ||
INSERT INTO t1 VALUES (2); | ||
SELECT MAX(id) FROM t1; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
SET GLOBAL DEBUG = ""; | ||
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; | ||
FLUSH QUERY CACHE; | ||
SET SESSION wsrep_sync_wait = 7; | ||
SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb"; | ||
INSERT INTO t1 VALUES (3); | ||
SELECT MAX(id) FROM t1; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
SET GLOBAL DEBUG = ""; | ||
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; | ||
INSERT INTO t1 VALUES (4); | ||
SET SESSION wsrep_sync_wait = 7; | ||
SELECT MAX(id) FROM t1; | ||
MAX(id) | ||
4 | ||
SET SESSION wsrep_sync_wait = 7; | ||
FLUSH STATUS; | ||
SELECT MAX(id) FROM t1; | ||
MAX(id) | ||
4 | ||
SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits'; | ||
VARIABLE_VALUE = 1 | ||
1 | ||
SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb"; | ||
INSERT INTO t1 VALUES (5); | ||
SET SESSION wsrep_sync_wait = 7; | ||
SELECT MAX(id) FROM t1 ; | ||
SET GLOBAL DEBUG = ""; | ||
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; | ||
MAX(id) | ||
5 | ||
SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits'; | ||
VARIABLE_VALUE = 1 | ||
1 |
1 change: 1 addition & 0 deletions
1
mysql-test/suite/galera/t/galera_query_cache_sync_wait-master.opt
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 |
90 changes: 90 additions & 0 deletions
90
mysql-test/suite/galera/t/galera_query_cache_sync_wait.test
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,90 @@ | ||
--source include/galera_cluster.inc | ||
--source include/have_innodb.inc | ||
--source include/have_debug_sync.inc | ||
--source include/have_query_cache.inc | ||
|
||
CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; | ||
INSERT INTO t1 VALUES (1); | ||
|
||
--connection node_2 | ||
--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options` | ||
SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT1S"; | ||
SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb"; | ||
SET SESSION wsrep_sync_wait = 7; | ||
SELECT MAX(id) FROM t1; # first lookup miss | ||
|
||
# | ||
# Query cache hit, wait timeout | ||
# | ||
|
||
--connection node_1 | ||
INSERT INTO t1 VALUES (2); | ||
|
||
--connection node_2 | ||
--error ER_LOCK_WAIT_TIMEOUT | ||
SELECT MAX(id) FROM t1; | ||
SET GLOBAL DEBUG = ""; | ||
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; | ||
|
||
FLUSH QUERY CACHE; | ||
SET SESSION wsrep_sync_wait = 7; | ||
SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb"; | ||
|
||
# | ||
# Query cache miss, wait timeout | ||
# | ||
|
||
--connection node_1 | ||
INSERT INTO t1 VALUES (3); | ||
|
||
--connection node_2 | ||
--error ER_LOCK_WAIT_TIMEOUT | ||
SELECT MAX(id) FROM t1; | ||
SET GLOBAL DEBUG = ""; | ||
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; | ||
|
||
# | ||
# Query cache miss | ||
# | ||
|
||
--connection node_1 | ||
INSERT INTO t1 VALUES (4); | ||
|
||
--connection node_2 | ||
SET SESSION wsrep_sync_wait = 7; | ||
SELECT MAX(id) FROM t1; | ||
SET SESSION wsrep_sync_wait = 7; | ||
|
||
# | ||
# Query cache hit | ||
# | ||
|
||
FLUSH STATUS; | ||
SELECT MAX(id) FROM t1; | ||
SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits'; | ||
SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb"; | ||
|
||
# | ||
# Query cache invalidated | ||
# | ||
|
||
--connection node_1 | ||
INSERT INTO t1 VALUES (5); | ||
|
||
--connection node_2 | ||
SET SESSION wsrep_sync_wait = 7; | ||
--send SELECT MAX(id) FROM t1 | ||
|
||
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 | ||
--connection node_2a | ||
SET GLOBAL DEBUG = ""; | ||
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; | ||
|
||
--connection node_2 | ||
--reap | ||
SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits'; | ||
|
||
|
||
--disable_query_log | ||
--eval SET GLOBAL wsrep_provider_options = "$wsrep_provider_options_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