| 1 |
--source include/galera_cluster.inc |
| 2 |
--source include/have_debug.inc |
| 3 |
--source include/have_debug_sync.inc |
| 4 |
--source include/have_query_cache.inc |
| 5 |
--source include/galera_have_debug_sync.inc |
| 6 |
|
| 7 |
--disable_ps2_protocol |
| 8 |
|
| 9 |
CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; |
| 10 |
INSERT INTO t1 VALUES (1); |
| 11 |
|
| 12 |
--connection node_2 |
| 13 |
--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options` |
| 14 |
SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT1S"; |
| 15 |
SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb"; |
| 16 |
SELECT MAX(id) FROM t1; # first lookup miss |
| 17 |
|
| 18 |
# |
| 19 |
# Query cache hit, wait timeout |
| 20 |
# |
| 21 |
|
| 22 |
--connection node_1 |
| 23 |
INSERT INTO t1 VALUES (2); |
| 24 |
|
| 25 |
--connection node_2 |
| 26 |
--error ER_LOCK_WAIT_TIMEOUT |
| 27 |
SELECT MAX(id) FROM t1; |
| 28 |
SET GLOBAL debug_dbug = ""; |
| 29 |
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; |
| 30 |
|
| 31 |
FLUSH QUERY CACHE; |
| 32 |
SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb"; |
| 33 |
SET DEBUG_SYNC = "RESET"; |
| 34 |
|
| 35 |
# |
| 36 |
# Query cache miss, wait timeout |
| 37 |
# |
| 38 |
|
| 39 |
--connection node_1 |
| 40 |
INSERT INTO t1 VALUES (3); |
| 41 |
|
| 42 |
--connection node_2 |
| 43 |
--error ER_LOCK_WAIT_TIMEOUT |
| 44 |
SELECT MAX(id) FROM t1; |
| 45 |
SET GLOBAL debug_dbug = ""; |
| 46 |
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; |
| 47 |
|
| 48 |
# |
| 49 |
# Query cache miss |
| 50 |
# |
| 51 |
|
| 52 |
--connection node_1 |
| 53 |
INSERT INTO t1 VALUES (4); |
| 54 |
|
| 55 |
--connection node_2 |
| 56 |
SELECT MAX(id) FROM t1; |
| 57 |
|
| 58 |
# |
| 59 |
# Query cache hit |
| 60 |
# |
| 61 |
|
| 62 |
FLUSH STATUS; |
| 63 |
SELECT MAX(id) FROM t1; |
| 64 |
SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits'; |
| 65 |
SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb"; |
| 66 |
|
| 67 |
# |
| 68 |
# Query cache invalidated |
| 69 |
# |
| 70 |
|
| 71 |
--connection node_1 |
| 72 |
INSERT INTO t1 VALUES (5); |
| 73 |
|
| 74 |
--connection node_2 |
| 75 |
--send SELECT MAX(id) FROM t1 |
| 76 |
|
| 77 |
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 |
| 78 |
--connection node_2a |
| 79 |
SET GLOBAL debug_dbug = ""; |
| 80 |
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; |
| 81 |
|
| 82 |
--connection node_2 |
| 83 |
--reap |
| 84 |
SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits'; |
| 85 |
|
| 86 |
|
| 87 |
--disable_query_log |
| 88 |
--eval SET GLOBAL wsrep_provider_options = "$wsrep_provider_options_orig" |
| 89 |
DROP TABLE t1; |
| 90 |
|
| 91 |
--connection node_2a |
| 92 |
SET DEBUG_SYNC = "RESET"; |
| 93 |
|
| 94 |
--enable_ps2_protocol |