Commit 276d65b3 authored by Nirbhay Choubey's avatar Nirbhay Choubey

Fix for test failures.

parent b9c42d7a
......@@ -27,3 +27,5 @@ galera_ssl_upgrade : TODO: investigate
mysql-wsrep#90 : TODO: investigate
galera_flush : mysql-wsrep/issues/229
galera_transaction_read_only : mysql-wsrep/issues/229
galera_gcs_fragment : Incorrect arguments to SET
galera_flush_local : Fails sporadically
DROP TABLE IF EXISTS t1, t2, x1, x2;
CREATE TABLE t1 (f1 INTEGER);
CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
SET GLOBAL wsrep_replicate_myisam = TRUE;
CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
......@@ -21,6 +20,10 @@ FLUSH LOCAL SLOW LOGS;
FLUSH LOCAL GENERAL LOGS;
FLUSH LOCAL ENGINE LOGS;
FLUSH LOCAL RELAY LOGS;
FLUSH LOCAL CLIENT_STATISTICS;
FLUSH LOCAL INDEX_STATISTICS;
FLUSH LOCAL TABLE_STATISTICS;
FLUSH LOCAL USER_STATISTICS;
FLUSH LOCAL LOGS;
FLUSH LOCAL BINARY LOGS;
FLUSH LOCAL TABLES WITH READ LOCK;
......@@ -68,7 +71,6 @@ COUNT(*) = 10
DROP TABLE t1, t2, x1, x2;
CREATE TABLE t1 (f1 INTEGER);
CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
SET GLOBAL wsrep_replicate_myisam = TRUE;
CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
......@@ -89,6 +91,10 @@ FLUSH SLOW LOGS;
FLUSH GENERAL LOGS;
FLUSH ENGINE LOGS;
FLUSH RELAY LOGS;
FLUSH CLIENT_STATISTICS;
FLUSH INDEX_STATISTICS;
FLUSH TABLE_STATISTICS;
FLUSH USER_STATISTICS;
FLUSH LOGS;
FLUSH BINARY LOGS;
FLUSH TABLES WITH READ LOCK;
......
......@@ -7,10 +7,16 @@ START TRANSACTION;
UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
LOCK TABLE t2 WRITE;
SET GLOBAL DEBUG = "d,sync.wsrep_before_mdl_wait";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
SELECT * FROM t2;;
SET GLOBAL DEBUG = "d,sync.wsrep_after_BF_victim_lock";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
UPDATE t1 SET f2 = 'c' WHERE f1 = 1;
SET GLOBAL DEBUG = "";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_before_mdl_wait";
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_after_BF_victim_lock";
UNLOCK TABLES;
......@@ -29,3 +35,4 @@ COUNT(*) = 1
1
DROP TABLE t1;
DROP TABLE t2;
SET DEBUG_SYNC = "RESET";
......@@ -2,6 +2,8 @@ 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";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
SET SESSION wsrep_sync_wait = 7;
SELECT MAX(id) FROM t1;
MAX(id)
......@@ -10,14 +12,21 @@ INSERT INTO t1 VALUES (2);
SELECT MAX(id) FROM t1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SET GLOBAL DEBUG = "";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
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";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
SET DEBUG_SYNC = "RESET";
INSERT INTO t1 VALUES (3);
SELECT MAX(id) FROM t1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SET GLOBAL DEBUG = "";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
INSERT INTO t1 VALUES (4);
SET SESSION wsrep_sync_wait = 7;
......@@ -33,10 +42,14 @@ SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_
VARIABLE_VALUE = 1
1
SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
INSERT INTO t1 VALUES (5);
SET SESSION wsrep_sync_wait = 7;
SELECT MAX(id) FROM t1 ;
SET GLOBAL DEBUG = "";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
MAX(id)
5
......
......@@ -7,18 +7,18 @@ DROP DATABASE db1;
CREATE PROCEDURE p1 () SELECT 1 FROM DUAL;
SHOW CREATE PROCEDURE p1;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
p1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
SELECT 1 FROM DUAL latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE p1;
CREATE PROCEDURE p1 () SELECT 1 FROM DUAL;
SHOW PROCEDURE CODE p1;
Pos Instruction
0 stmt "SELECT 1 FROM DUAL"
0 stmt 0 "SELECT 1 FROM DUAL"
DROP PROCEDURE p1;
CREATE FUNCTION f1 () RETURNS INTEGER RETURN 123;
SHOW CREATE FUNCTION f1;
Function sql_mode Create Function character_set_client collation_connection Database Collation
f1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
RETURN 123 latin1 latin1_swedish_ci latin1_swedish_ci
DROP FUNCTION f1;
CREATE FUNCTION f1 () RETURNS INTEGER RETURN 123;
......@@ -30,10 +30,10 @@ CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a';
SHOW CREATE TRIGGER tr1;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
tr1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a' latin1 latin1_swedish_ci latin1_swedish_ci
tr1 CREATE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a' latin1 latin1_swedish_ci latin1_swedish_ci
DROP TABLE t1;
CREATE EVENT event1 ON SCHEDULE AT '2038-01-01 23:59:59' DO SELECT 1;
SHOW CREATE EVENT event1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
event1 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `event1` ON SCHEDULE AT '2038-01-01 23:59:59' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
event1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `event1` ON SCHEDULE AT '2038-01-01 23:59:59' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
DROP EVENT event1;
......@@ -73,3 +73,7 @@ SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
DROP TABLE t1;
DROP TABLE t2;
--connection node_1a
SET DEBUG_SYNC = "RESET";
--query_cache_type=1
--query_cache_type=1 --query_cache_size=1355776
......@@ -29,6 +29,7 @@ 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";
SET DEBUG_SYNC = "RESET";
#
# Query cache miss, wait timeout
......@@ -88,3 +89,6 @@ SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_
--disable_query_log
--eval SET GLOBAL wsrep_provider_options = "$wsrep_provider_options_orig"
DROP TABLE t1;
--connection node_2a
SET DEBUG_SYNC = "RESET";
......@@ -3,6 +3,7 @@
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--connection node_2
SET SESSION wsrep_sync_wait = 1;
......
......@@ -30,7 +30,7 @@ if ($galera_wsrep_start_position != $expected_position)
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
--source include/galera_wait_ready.inc
--source include/wait_until_ready.inc
--connection node_1
DROP TABLE t1;
......
......@@ -1177,9 +1177,6 @@ bool Sql_cmd_analyze_table::execute(THD *thd)
goto error;
WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table);
thd->enable_slow_log= opt_log_slow_admin_statements;
#ifdef WITH_WSREP
WSREP_TO_ISOLATION_BEGIN(first_table->db, first_table->table_name, NULL);
#endif
res= mysql_admin_table(thd, first_table, &m_lex->check_opt,
"analyze", lock_type, 1, 0, 0, 0,
&handler::ha_analyze, 0);
......
......@@ -215,8 +215,9 @@ inline bool is_supported_parser_charset(CHARSET_INFO *cs)
if (WSREP(thd) || (thd && thd->wsrep_exec_mode==TOTAL_ORDER)) \
wsrep_to_isolation_end(thd);
/* Checks if lex->no_write_to_binlog is set for statements that use
LOCAL or NO_WRITE_TO_BINLOG
/*
Checks if lex->no_write_to_binlog is set for statements that use LOCAL or
NO_WRITE_TO_BINLOG.
*/
#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_) \
if (WSREP(thd) && !thd->lex->no_write_to_binlog \
......@@ -225,7 +226,8 @@ inline bool is_supported_parser_charset(CHARSET_INFO *cs)
#else
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_)
#define WSREP_TO_ISOLATION_END
#define WSREP_TO_ISOLATION_END
#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_)
#endif /* WITH_WSREP */
......
......@@ -19,6 +19,7 @@
#include "wsrep_xid.h"
#include "log_event.h" // class THD, EVENT_LEN_OFFSET, etc.
#include "debug_sync.h"
/*
read the first event from (*buf). The size of the (*buf) is (*buf_len).
......@@ -222,6 +223,16 @@ wsrep_cb_status_t wsrep_apply_cb(void* const ctx,
{
THD* const thd((THD*)ctx);
// Allow tests to block the applier thread using the DBUG facilities.
DBUG_EXECUTE_IF("sync.wsrep_apply_cb",
{
const char act[]=
"now "
"wait_for signal.wsrep_apply_cb";
DBUG_ASSERT(!debug_sync_set_action(thd,
STRING_WITH_LEN(act)));
};);
thd->wsrep_trx_meta = *meta;
#ifdef WSREP_PROC_INFO
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment