mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
Merge branch '10.0-galera' into bb-10.1-serg
This commit is contained in:
commit
cceec7858f
71 changed files with 1574 additions and 127 deletions
|
@ -26,7 +26,7 @@ ENDIF()
|
|||
OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ${with_wsrep_default})
|
||||
|
||||
# Set the patch version
|
||||
SET(WSREP_PATCH_VERSION "11")
|
||||
SET(WSREP_PATCH_VERSION "13")
|
||||
|
||||
# Obtain wsrep API version
|
||||
FILE(STRINGS "${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h" WSREP_API_VERSION
|
||||
|
|
|
@ -31,6 +31,14 @@
|
|||
if (WSREP_ON && (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.
|
||||
*/
|
||||
#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_) \
|
||||
if (WSREP(thd) && !thd->lex->no_write_to_binlog \
|
||||
&& wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto error;
|
||||
|
||||
#define WSREP_DEBUG(...) \
|
||||
if (wsrep_debug) WSREP_LOG(sql_print_information, ##__VA_ARGS__)
|
||||
#define WSREP_INFO(...) WSREP_LOG(sql_print_information, ##__VA_ARGS__)
|
||||
|
@ -46,6 +54,7 @@
|
|||
#define WSREP_ERROR(...)
|
||||
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_)
|
||||
#define WSREP_TO_ISOLATION_END
|
||||
#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_)
|
||||
#endif
|
||||
|
||||
#endif /* WSERP_INCLUDED */
|
||||
|
|
1
mysql-test/include/galera_clear_sync_point.inc
Normal file
1
mysql-test/include/galera_clear_sync_point.inc
Normal file
|
@ -0,0 +1 @@
|
|||
SET GLOBAL wsrep_provider_options = 'dbug=';
|
1
mysql-test/include/galera_set_sync_point.inc
Normal file
1
mysql-test/include/galera_set_sync_point.inc
Normal file
|
@ -0,0 +1 @@
|
|||
--eval SET GLOBAL wsrep_provider_options = 'dbug=d,$galera_sync_point'
|
1
mysql-test/include/galera_signal_sync_point.inc
Normal file
1
mysql-test/include/galera_signal_sync_point.inc
Normal file
|
@ -0,0 +1 @@
|
|||
--eval SET GLOBAL wsrep_provider_options = 'signal=$galera_sync_point'
|
6
mysql-test/include/galera_wait_sync_point.inc
Normal file
6
mysql-test/include/galera_wait_sync_point.inc
Normal file
|
@ -0,0 +1,6 @@
|
|||
--let $wait_timeout = 10
|
||||
--let $wsrep_on_orig = `SELECT @@wsrep_on`
|
||||
SET SESSION wsrep_on = 0;
|
||||
--let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = '$galera_sync_point'
|
||||
--source include/wait_condition.inc
|
||||
--eval SET SESSION wsrep_on = $wsrep_on_orig
|
|
@ -40,6 +40,11 @@ BEGIN
|
|||
-- except those that was created during bootstrap
|
||||
SELECT * FROM INFORMATION_SCHEMA.SCHEMATA;
|
||||
|
||||
-- and the mtr_wsrep_notify schema which is populated by the std_data/wsrep_notify.sh script
|
||||
-- and the suite/galera/t/galera_var_notify_cmd.test
|
||||
-- and the wsrep_schema schema that may be created by Galera
|
||||
SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema');
|
||||
|
||||
-- The test database should not contain any tables
|
||||
SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE table_schema='test';
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -17,7 +17,7 @@ wsrep-sync-wait=7
|
|||
#ist_port=@OPT.port
|
||||
#sst_port=@OPT.port
|
||||
wsrep-cluster-address=gcomm://
|
||||
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M'
|
||||
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;gcache.size=10M'
|
||||
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
|
||||
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
|
||||
|
||||
|
@ -26,7 +26,7 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
|
|||
#ist_port=@OPT.port
|
||||
#sst_port=@OPT.port
|
||||
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
|
||||
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M'
|
||||
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;gcache.size=10M'
|
||||
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
|
||||
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
|
||||
|
||||
|
|
|
@ -24,6 +24,9 @@ f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user1`@`%` FUNCTIO
|
|||
MODIFIES SQL DATA
|
||||
COMMENT 'f1_comment'
|
||||
RETURN 'abc' latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SELECT 1 FROM DUAL;
|
||||
1
|
||||
1
|
||||
SHOW CREATE FUNCTION f1;
|
||||
Function sql_mode Create Function character_set_client collation_connection Database Collation
|
||||
f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user1`@`%` FUNCTION `f1`(param INTEGER) RETURNS varchar(200) CHARSET latin1
|
||||
|
|
|
@ -50,7 +50,7 @@ WSREP_SST_DONOR
|
|||
WSREP_SST_DONOR_REJECTS_QUERIES OFF
|
||||
WSREP_SST_METHOD rsync
|
||||
WSREP_SYNC_WAIT 7
|
||||
<BASE_HOST>; <BASE_PORT>; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.info_log_mask = 0; evs.install_timeout = PT7.5S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; <GCACHE_DIR>; gcache.keep_pages_size = 0; gcache.mem_size = 0; <GCACHE_NAME>; gcache.page_size = 128M; gcache.size = 10M; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; <GCS_RECV_Q_HARD_LIMIT>; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; <GMCAST_LISTEN_ADDR>; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; <IST_RECV_ADDR>; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = P30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT30S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 7; socket.checksum = 2;
|
||||
<BASE_HOST>; <BASE_PORT>; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.info_log_mask = 0; evs.install_timeout = PT7.5S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; <GCACHE_DIR>; gcache.keep_pages_size = 0; gcache.mem_size = 0; <GCACHE_NAME>; gcache.page_size = 128M; gcache.size = 10M; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; <GCS_RECV_Q_HARD_LIMIT>; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; <GMCAST_LISTEN_ADDR>; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; <IST_RECV_ADDR>; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = P30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT90S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 7; socket.checksum = 2;
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS
|
||||
WHERE VARIABLE_NAME LIKE 'wsrep_%'
|
||||
AND VARIABLE_NAME != 'wsrep_debug_sync_waiters';
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
DROP TABLE IF EXISTS t1, t2;
|
||||
FLUSH DES_KEY_FILE;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
|
@ -26,6 +27,37 @@ CREATE TABLE t2 (f1 INTEGER);
|
|||
FLUSH TABLES t2;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
FLUSH ERROR LOGS;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
FLUSH SLOW LOGS;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
FLUSH GENERAL LOGS;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
FLUSH ENGINE LOGS;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
FLUSH RELAY LOGS;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
SET @userstat_old= @@userstat;
|
||||
SET GLOBAL userstat=ON;
|
||||
FLUSH CLIENT_STATISTICS;
|
||||
FLUSH INDEX_STATISTICS;
|
||||
FLUSH TABLE_STATISTICS;
|
||||
FLUSH USER_STATISTICS;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
SET @old_thread_statistics= @@global.thread_statistics;
|
||||
SET GLOBAL thread_statistics= ON;
|
||||
FLUSH THREAD_STATISTICS;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
FLUSH CHANGED_PAGE_BITMAPS;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
FLUSH LOGS;
|
||||
FLUSH TABLES WITH READ LOCK;
|
||||
|
@ -52,3 +84,5 @@ wsrep_last_committed_diff
|
|||
1
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
SET GLOBAL userstat= @userstat_old;
|
||||
SET GLOBAL thread_statistics= @old_thread_statistics;
|
||||
|
|
145
mysql-test/suite/galera/r/galera_flush_local.result
Normal file
145
mysql-test/suite/galera/r/galera_flush_local.result
Normal file
|
@ -0,0 +1,145 @@
|
|||
DROP TABLE IF EXISTS t1, t2, x1, x2;
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
|
||||
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);
|
||||
INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
|
||||
INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
FLUSH LOCAL DES_KEY_FILE;
|
||||
FLUSH LOCAL HOSTS;
|
||||
FLUSH LOCAL QUERY CACHE;
|
||||
FLUSH LOCAL STATUS;
|
||||
FLUSH LOCAL PRIVILEGES;
|
||||
FLUSH LOCAL USER_RESOURCES;
|
||||
FLUSH LOCAL TABLES;
|
||||
FLUSH LOCAL TABLES t2;
|
||||
FLUSH LOCAL ERROR LOGS;
|
||||
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;
|
||||
UNLOCK TABLES;
|
||||
FLUSH LOCAL TABLES t1 WITH READ LOCK;
|
||||
UNLOCK TABLES;
|
||||
FLUSH LOCAL TABLES t1 FOR EXPORT;
|
||||
UNLOCK TABLES;
|
||||
LOCK TABLES t1 WRITE;
|
||||
FLUSH LOCAL TABLES t1;
|
||||
UNLOCK TABLES;
|
||||
LOCK TABLES t1 READ;
|
||||
FLUSH LOCAL TABLES t1;
|
||||
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
|
||||
UNLOCK TABLES;
|
||||
FLUSH LOCAL TABLES t1;
|
||||
ANALYZE LOCAL TABLE t1, t2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
test.t2 analyze status OK
|
||||
OPTIMIZE LOCAL TABLE t1, t2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
|
||||
test.t1 optimize status OK
|
||||
test.t2 optimize note Table does not support optimize, doing recreate + analyze instead
|
||||
test.t2 optimize status OK
|
||||
REPAIR LOCAL TABLE x1, x2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.x1 repair status OK
|
||||
test.x2 repair status OK
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
SELECT COUNT(*) = 10 FROM t1;
|
||||
COUNT(*) = 10
|
||||
1
|
||||
SELECT COUNT(*) = 10 FROM x1;
|
||||
COUNT(*) = 10
|
||||
1
|
||||
SELECT COUNT(*) = 10000 FROM t2;
|
||||
COUNT(*) = 10000
|
||||
1
|
||||
SELECT COUNT(*) = 10 FROM x2;
|
||||
COUNT(*) = 10
|
||||
1
|
||||
DROP TABLE t1, t2, x1, x2;
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
|
||||
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);
|
||||
INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
|
||||
INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
set wsrep_on=0;
|
||||
FLUSH DES_KEY_FILE;
|
||||
FLUSH HOSTS;
|
||||
FLUSH QUERY CACHE;
|
||||
FLUSH STATUS;
|
||||
FLUSH PRIVILEGES;
|
||||
FLUSH USER_RESOURCES;
|
||||
FLUSH TABLES;
|
||||
FLUSH TABLES t2;
|
||||
FLUSH ERROR LOGS;
|
||||
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;
|
||||
UNLOCK TABLES;
|
||||
FLUSH TABLES t1 WITH READ LOCK;
|
||||
UNLOCK TABLES;
|
||||
FLUSH TABLES t1 FOR EXPORT;
|
||||
UNLOCK TABLES;
|
||||
LOCK TABLES t1 WRITE;
|
||||
FLUSH TABLES t1;
|
||||
UNLOCK TABLES;
|
||||
LOCK TABLES t1 READ;
|
||||
FLUSH TABLES t1;
|
||||
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
|
||||
UNLOCK TABLES;
|
||||
FLUSH TABLES t1;
|
||||
ANALYZE TABLE t1, t2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
test.t2 analyze status OK
|
||||
OPTIMIZE TABLE t1, t2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
|
||||
test.t1 optimize status OK
|
||||
test.t2 optimize note Table does not support optimize, doing recreate + analyze instead
|
||||
test.t2 optimize status OK
|
||||
REPAIR TABLE x1, x2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.x1 repair status OK
|
||||
test.x2 repair status OK
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
wsrep_last_committed_diff2
|
||||
1
|
||||
SELECT COUNT(*) = 10 FROM t1;
|
||||
COUNT(*) = 10
|
||||
1
|
||||
SELECT COUNT(*) = 10 FROM x1;
|
||||
COUNT(*) = 10
|
||||
1
|
||||
SELECT COUNT(*) = 10000 FROM t2;
|
||||
COUNT(*) = 10000
|
||||
1
|
||||
SELECT COUNT(*) = 10 FROM x2;
|
||||
COUNT(*) = 10
|
||||
1
|
||||
set wsrep_on=1;
|
||||
DROP TABLE t1, t2, x1, x2;
|
|
@ -2,6 +2,8 @@ CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
|
|||
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
|
||||
INSERT INTO t1 VALUES (1);
|
||||
SET SESSION wsrep_sync_wait = 0;
|
||||
SET SESSION wsrep_on = 0;
|
||||
SET SESSION wsrep_on = 1;
|
||||
SELECT COUNT(*) = 0 FROM t1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
|
|
24
mysql-test/suite/galera/r/galera_gcs_fragment.result
Normal file
24
mysql-test/suite/galera/r/galera_gcs_fragment.result
Normal file
|
@ -0,0 +1,24 @@
|
|||
CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 TEXT);
|
||||
SET GLOBAL wsrep_cluster_address='';
|
||||
SET SESSION wsrep_sync_wait=0;
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=d,gcs_core_after_frag_send';
|
||||
SET SESSION wsrep_retry_autocommit=0;
|
||||
INSERT INTO t1 VALUES (1, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
|
||||
SET SESSION wsrep_on = 0;
|
||||
SET SESSION wsrep_on = 1;
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=';
|
||||
SET SESSION wsrep_on = 0;
|
||||
SET SESSION wsrep_on = 1;
|
||||
INSERT INTO t1 VALUES (2, "bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
|
||||
SET GLOBAL wsrep_provider_options = 'signal=gcs_core_after_frag_send';
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
INSERT INTO t1 VALUES (3, "cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
|
||||
SELECT * FROM t1;
|
||||
f1 f2
|
||||
2 bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
3 cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
SELECT * FROM t1;
|
||||
f1 f2
|
||||
2 bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
3 cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
DROP TABLE t1;
|
|
@ -16,19 +16,19 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
|||
mysqld-bin.000002 # Gtid # # GTID 0-1-1
|
||||
mysqld-bin.000002 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
|
||||
mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-2
|
||||
mysqld-bin.000002 # Table_map # # table_id: 48 (test.t1)
|
||||
mysqld-bin.000002 # Write_rows_v1 # # table_id: 48 flags: STMT_END_F
|
||||
mysqld-bin.000002 # Xid # # COMMIT /* xid=2 */
|
||||
mysqld-bin.000002 # Table_map # # table_id: # (test.t1)
|
||||
mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
mysqld-bin.000002 # Xid # # COMMIT /* xid=# */
|
||||
mysqld-bin.000002 # Gtid # # GTID 0-1-3
|
||||
mysqld-bin.000002 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
|
||||
mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-4
|
||||
mysqld-bin.000002 # Table_map # # table_id: 49 (test.t2)
|
||||
mysqld-bin.000002 # Write_rows_v1 # # table_id: 49 flags: STMT_END_F
|
||||
mysqld-bin.000002 # Xid # # COMMIT /* xid=4 */
|
||||
mysqld-bin.000002 # Table_map # # table_id: # (test.t2)
|
||||
mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
mysqld-bin.000002 # Xid # # COMMIT /* xid=# */
|
||||
mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-5
|
||||
mysqld-bin.000002 # Table_map # # table_id: 49 (test.t2)
|
||||
mysqld-bin.000002 # Write_rows_v1 # # table_id: 49 flags: STMT_END_F
|
||||
mysqld-bin.000002 # Xid # # COMMIT /* xid=5 */
|
||||
mysqld-bin.000002 # Table_map # # table_id: # (test.t2)
|
||||
mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
mysqld-bin.000002 # Xid # # COMMIT /* xid=# */
|
||||
mysqld-bin.000002 # Gtid # # GTID 0-1-6
|
||||
mysqld-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
|
@ -39,20 +39,21 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
|||
mysqld-bin.000003 # Gtid # # GTID 0-1-1
|
||||
mysqld-bin.000003 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
|
||||
mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-2
|
||||
mysqld-bin.000003 # Table_map # # table_id: 30 (test.t1)
|
||||
mysqld-bin.000003 # Write_rows_v1 # # table_id: 30 flags: STMT_END_F
|
||||
mysqld-bin.000003 # Xid # # COMMIT /* xid=2 */
|
||||
mysqld-bin.000003 # Table_map # # table_id: # (test.t1)
|
||||
mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
mysqld-bin.000003 # Xid # # COMMIT /* xid=# */
|
||||
mysqld-bin.000003 # Gtid # # GTID 0-1-3
|
||||
mysqld-bin.000003 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
|
||||
mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-4
|
||||
mysqld-bin.000003 # Table_map # # table_id: 31 (test.t2)
|
||||
mysqld-bin.000003 # Write_rows_v1 # # table_id: 31 flags: STMT_END_F
|
||||
mysqld-bin.000003 # Xid # # COMMIT /* xid=4 */
|
||||
mysqld-bin.000003 # Table_map # # table_id: # (test.t2)
|
||||
mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
mysqld-bin.000003 # Xid # # COMMIT /* xid=# */
|
||||
mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-5
|
||||
mysqld-bin.000003 # Table_map # # table_id: 31 (test.t2)
|
||||
mysqld-bin.000003 # Write_rows_v1 # # table_id: 31 flags: STMT_END_F
|
||||
mysqld-bin.000003 # Xid # # COMMIT /* xid=5 */
|
||||
mysqld-bin.000003 # Table_map # # table_id: # (test.t2)
|
||||
mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
mysqld-bin.000003 # Xid # # COMMIT /* xid=# */
|
||||
mysqld-bin.000003 # Gtid # # GTID 0-1-6
|
||||
mysqld-bin.000003 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
RESET MASTER;
|
||||
|
|
38
mysql-test/suite/galera/r/galera_mdl_race.result
Normal file
38
mysql-test/suite/galera/r/galera_mdl_race.result
Normal file
|
@ -0,0 +1,38 @@
|
|||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
|
||||
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
|
||||
INSERT INTO t1 VALUES (1, 'a');
|
||||
INSERT INTO t1 VALUES (2, 'a');
|
||||
SET AUTOCOMMIT=ON;
|
||||
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;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
|
||||
COUNT(*) = 1
|
||||
1
|
||||
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
|
||||
COUNT(*) = 1
|
||||
1
|
||||
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
|
||||
COUNT(*) = 1
|
||||
1
|
||||
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
|
||||
COUNT(*) = 1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
SET DEBUG_SYNC = "RESET";
|
|
@ -0,0 +1,58 @@
|
|||
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)
|
||||
1
|
||||
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;
|
||||
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";
|
||||
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
|
||||
SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
|
||||
VARIABLE_VALUE = 1
|
||||
1
|
42
mysql-test/suite/galera/r/galera_rsu_wsrep_desync.result
Normal file
42
mysql-test/suite/galera/r/galera_rsu_wsrep_desync.result
Normal file
|
@ -0,0 +1,42 @@
|
|||
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
|
||||
SET GLOBAL wsrep_desync=1;
|
||||
SET wsrep_OSU_method=RSU;
|
||||
SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
|
||||
ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
|
||||
SET GLOBAL wsrep_desync=0;
|
||||
SET DEBUG_SYNC= 'now SIGNAL continue';
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` int(11) DEFAULT NULL,
|
||||
`f2` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
SHOW VARIABLES LIKE 'wsrep_desync';
|
||||
Variable_name Value
|
||||
wsrep_desync OFF
|
||||
SET wsrep_OSU_method=TOI;
|
||||
DROP TABLE t1;
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
|
||||
SET GLOBAL wsrep_desync=0;
|
||||
Warnings:
|
||||
Warning 1231 'wsrep_desync' is already OFF.
|
||||
SET wsrep_OSU_method=RSU;
|
||||
SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
|
||||
ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
|
||||
SET GLOBAL wsrep_desync=1;
|
||||
ERROR HY000: Operation 'desync' failed for SET GLOBAL wsrep_desync=1
|
||||
SET GLOBAL wsrep_desync=0;
|
||||
SET DEBUG_SYNC= 'now SIGNAL continue';
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` int(11) DEFAULT NULL,
|
||||
`f2` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
SET wsrep_OSU_method=TOI;
|
||||
DROP TABLE t1;
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
CALL mtr.add_suppression("Protocol violation");
|
||||
CALL mtr.add_suppression("desync failed");
|
||||
CALL mtr.add_suppression("Protocol violation");
|
|
@ -104,3 +104,5 @@ CALL mtr.add_suppression("Can't open and lock privilege tables");
|
|||
CALL mtr.add_suppression("Info table is not ready to be used");
|
||||
CALL mtr.add_suppression("Native table .* has the wrong structure");
|
||||
DROP USER sslsst;
|
||||
SET GLOBAL general_log = ON;
|
||||
SET GLOBAL slow_query_log = ON;
|
||||
|
|
39
mysql-test/suite/galera/r/galera_sync_wait_show.result
Normal file
39
mysql-test/suite/galera/r/galera_sync_wait_show.result
Normal file
|
@ -0,0 +1,39 @@
|
|||
SET SESSION wsrep_sync_wait = 1;
|
||||
CREATE DATABASE db1;
|
||||
SHOW CREATE DATABASE db1;
|
||||
Database Create Database
|
||||
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET latin1 */
|
||||
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 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 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 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;
|
||||
SHOW FUNCTION CODE f1;
|
||||
Pos Instruction
|
||||
0 freturn 3 123
|
||||
DROP FUNCTION f1;
|
||||
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 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 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;
|
|
@ -10,6 +10,8 @@ f1 f2
|
|||
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
|
||||
COMMIT;;
|
||||
SET SESSION wsrep_sync_wait = 0;
|
||||
SET SESSION wsrep_on = 0;
|
||||
SET SESSION wsrep_on = 1;
|
||||
UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=';
|
||||
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
|
||||
|
|
18
mysql-test/suite/galera/r/mysql-wsrep#198.result
Normal file
18
mysql-test/suite/galera/r/mysql-wsrep#198.result
Normal file
|
@ -0,0 +1,18 @@
|
|||
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
LOCK TABLE t2 WRITE;
|
||||
OPTIMIZE TABLE t1,t2;;
|
||||
REPAIR TABLE t1,t2;;
|
||||
SET SESSION wsrep_sync_wait = 0;
|
||||
INSERT INTO t2 VALUES (1);
|
||||
UNLOCK TABLES;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
|
||||
test.t1 optimize status OK
|
||||
test.t2 optimize note Table does not support optimize, doing recreate + analyze instead
|
||||
test.t2 optimize status OK
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 repair note The storage engine for the table doesn't support repair
|
||||
test.t2 repair note The storage engine for the table doesn't support repair
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
4
mysql-test/suite/galera/r/mysql-wsrep#201.result
Normal file
4
mysql-test/suite/galera/r/mysql-wsrep#201.result
Normal file
|
@ -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;
|
10
mysql-test/suite/galera/r/mysql-wsrep#237.result
Normal file
10
mysql-test/suite/galera/r/mysql-wsrep#237.result
Normal file
|
@ -0,0 +1,10 @@
|
|||
CREATE TABLE t (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
|
||||
SET DEBUG_SYNC = 'wsrep_before_replication WAIT_FOR continue';
|
||||
INSERT INTO t values (1);;
|
||||
SET SESSION wsrep_sync_wait = 0;
|
||||
FLUSH TABLES;
|
||||
SELECT SLEEP(1);
|
||||
SLEEP(1)
|
||||
0
|
||||
SET DEBUG_SYNC= 'now SIGNAL continue';
|
||||
DROP TABLE t;
|
11
mysql-test/suite/galera/r/mysql-wsrep#247.result
Normal file
11
mysql-test/suite/galera/r/mysql-wsrep#247.result
Normal file
|
@ -0,0 +1,11 @@
|
|||
SET GLOBAL wsrep_desync=1;
|
||||
SET wsrep_OSU_method=RSU;
|
||||
CREATE TABLE t1 (i int primary key);
|
||||
SHOW VARIABLES LIKE 'wsrep_desync';
|
||||
Variable_name Value
|
||||
wsrep_desync ON
|
||||
SET GLOBAL wsrep_desync=0;
|
||||
DROP TABLE t1;
|
||||
SHOW VARIABLES LIKE 'wsrep_desync';
|
||||
Variable_name Value
|
||||
wsrep_desync OFF
|
10
mysql-test/suite/galera/r/mysql-wsrep#31.result
Normal file
10
mysql-test/suite/galera/r/mysql-wsrep#31.result
Normal file
|
@ -0,0 +1,10 @@
|
|||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES('test');
|
||||
CREATE DATABASE db;
|
||||
Shutting down server 2 ...
|
||||
Recovering server 2 ...
|
||||
Performing --wsrep-recover ...
|
||||
Restarting server ...
|
||||
Using --wsrep-start-position when starting mysqld ...
|
||||
DROP TABLE t1;
|
||||
DROP DATABASE db;
|
|
@ -26,6 +26,7 @@ SET SESSION wsrep_sync_wait = 0;
|
|||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
|
||||
|
||||
--connection node_2
|
||||
--sleep 1
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
|
|
|
@ -33,6 +33,8 @@ RETURN 123;
|
|||
SHOW CREATE FUNCTION f1;
|
||||
|
||||
--connection node_2
|
||||
# Work around codership/mysql-wsrep#228 - SHOW CREATE FUNCTION not covered by wsrep_sync_wait
|
||||
SELECT 1 FROM DUAL;
|
||||
SHOW CREATE FUNCTION f1;
|
||||
|
||||
--connection node_1
|
||||
|
@ -49,9 +51,3 @@ DROP FUNCTION f1;
|
|||
DROP FUNCTION f2;
|
||||
|
||||
DROP USER 'user1';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
--source include/have_perfschema.inc
|
||||
--source include/have_query_cache.inc
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
#
|
||||
# The following FLUSH statements should be replicated
|
||||
#
|
||||
|
@ -101,6 +104,101 @@ FLUSH TABLES t2;
|
|||
--enable_query_log
|
||||
|
||||
|
||||
--connection node_2
|
||||
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
|
||||
--connection node_1
|
||||
FLUSH ERROR LOGS;
|
||||
--connection node_2
|
||||
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
|
||||
--disable_query_log
|
||||
--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
|
||||
--enable_query_log
|
||||
|
||||
|
||||
--connection node_2
|
||||
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
|
||||
--connection node_1
|
||||
FLUSH SLOW LOGS;
|
||||
--connection node_2
|
||||
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
|
||||
--disable_query_log
|
||||
--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
|
||||
--enable_query_log
|
||||
|
||||
--connection node_2
|
||||
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
|
||||
--connection node_1
|
||||
FLUSH GENERAL LOGS;
|
||||
--connection node_2
|
||||
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
|
||||
--disable_query_log
|
||||
--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
|
||||
--enable_query_log
|
||||
|
||||
--connection node_2
|
||||
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
|
||||
--connection node_1
|
||||
FLUSH ENGINE LOGS;
|
||||
--connection node_2
|
||||
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
|
||||
--disable_query_log
|
||||
--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
|
||||
--enable_query_log
|
||||
|
||||
--connection node_2
|
||||
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
|
||||
--connection node_1
|
||||
FLUSH RELAY LOGS;
|
||||
--connection node_2
|
||||
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
|
||||
--disable_query_log
|
||||
--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
|
||||
--enable_query_log
|
||||
|
||||
--connection node_1
|
||||
SET @userstat_old= @@userstat;
|
||||
SET GLOBAL userstat=ON;
|
||||
|
||||
--connection node_2
|
||||
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
|
||||
--connection node_1
|
||||
FLUSH CLIENT_STATISTICS;
|
||||
FLUSH INDEX_STATISTICS;
|
||||
FLUSH TABLE_STATISTICS;
|
||||
FLUSH USER_STATISTICS;
|
||||
--connection node_2
|
||||
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
|
||||
--disable_query_log
|
||||
--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 4 AS wsrep_last_committed_diff;
|
||||
--enable_query_log
|
||||
|
||||
|
||||
--connection node_1
|
||||
SET @old_thread_statistics= @@global.thread_statistics;
|
||||
SET GLOBAL thread_statistics= ON;
|
||||
|
||||
--connection node_2
|
||||
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
|
||||
--connection node_1
|
||||
FLUSH THREAD_STATISTICS;
|
||||
--connection node_2
|
||||
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
|
||||
--disable_query_log
|
||||
--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
|
||||
--enable_query_log
|
||||
|
||||
|
||||
--connection node_2
|
||||
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
|
||||
--connection node_1
|
||||
FLUSH CHANGED_PAGE_BITMAPS;
|
||||
--connection node_2
|
||||
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
|
||||
--disable_query_log
|
||||
--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
|
||||
--enable_query_log
|
||||
|
||||
|
||||
#
|
||||
# The following statements should not be replicated: FLUSH LOGS, FLUSH TABLES WITH LOCKS
|
||||
#
|
||||
|
@ -171,3 +269,5 @@ FLUSH TABLES t1;
|
|||
--connection node_1
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
SET GLOBAL userstat= @userstat_old;
|
||||
SET GLOBAL thread_statistics= @old_thread_statistics;
|
||||
|
|
1
mysql-test/suite/galera/t/galera_flush_local.opt
Normal file
1
mysql-test/suite/galera/t/galera_flush_local.opt
Normal file
|
@ -0,0 +1 @@
|
|||
--query_cache_type=1 --query_cache_size=1000000 --userstat=1 --wsrep_replicate_myisam=true
|
142
mysql-test/suite/galera/t/galera_flush_local.test
Normal file
142
mysql-test/suite/galera/t/galera_flush_local.test
Normal file
|
@ -0,0 +1,142 @@
|
|||
#
|
||||
# Test that various FLUSH LOCAL commands are replicated. Whenever possible, check the slave for the effects.
|
||||
# PXC-391
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_query_cache.inc
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2, x1, x2;
|
||||
--enable_warnings
|
||||
#
|
||||
# The following FLUSH LOCAL statements should *not* be replicated
|
||||
#
|
||||
--connection node_1
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
|
||||
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);
|
||||
INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
|
||||
INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
|
||||
--connection node_2
|
||||
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
|
||||
--connection node_1
|
||||
FLUSH LOCAL DES_KEY_FILE;
|
||||
FLUSH LOCAL HOSTS;
|
||||
FLUSH LOCAL QUERY CACHE;
|
||||
FLUSH LOCAL STATUS;
|
||||
FLUSH LOCAL PRIVILEGES;
|
||||
FLUSH LOCAL USER_RESOURCES;
|
||||
FLUSH LOCAL TABLES;
|
||||
FLUSH LOCAL TABLES t2;
|
||||
FLUSH LOCAL ERROR LOGS;
|
||||
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;
|
||||
UNLOCK TABLES;
|
||||
FLUSH LOCAL TABLES t1 WITH READ LOCK;
|
||||
UNLOCK TABLES;
|
||||
FLUSH LOCAL TABLES t1 FOR EXPORT;
|
||||
UNLOCK TABLES;
|
||||
LOCK TABLES t1 WRITE;
|
||||
FLUSH LOCAL TABLES t1;
|
||||
UNLOCK TABLES;
|
||||
LOCK TABLES t1 READ;
|
||||
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
|
||||
FLUSH LOCAL TABLES t1;
|
||||
UNLOCK TABLES;
|
||||
FLUSH LOCAL TABLES t1;
|
||||
ANALYZE LOCAL TABLE t1, t2;
|
||||
OPTIMIZE LOCAL TABLE t1, t2;
|
||||
REPAIR LOCAL TABLE x1, x2;
|
||||
--connection node_2
|
||||
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
|
||||
--disable_query_log
|
||||
--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before AS wsrep_last_committed_diff;
|
||||
--enable_query_log
|
||||
|
||||
SELECT COUNT(*) = 10 FROM t1;
|
||||
SELECT COUNT(*) = 10 FROM x1;
|
||||
SELECT COUNT(*) = 10000 FROM t2;
|
||||
SELECT COUNT(*) = 10 FROM x2;
|
||||
|
||||
|
||||
--connection node_1
|
||||
DROP TABLE t1, t2, x1, x2;
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
|
||||
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);
|
||||
INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
|
||||
INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
|
||||
|
||||
--connection node_2
|
||||
--let $wsrep_last_committed_before2 = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
|
||||
--connection node_1
|
||||
set wsrep_on=0;
|
||||
FLUSH DES_KEY_FILE;
|
||||
FLUSH HOSTS;
|
||||
FLUSH QUERY CACHE;
|
||||
FLUSH STATUS;
|
||||
FLUSH PRIVILEGES;
|
||||
FLUSH USER_RESOURCES;
|
||||
FLUSH TABLES;
|
||||
FLUSH TABLES t2;
|
||||
FLUSH ERROR LOGS;
|
||||
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;
|
||||
UNLOCK TABLES;
|
||||
FLUSH TABLES t1 WITH READ LOCK;
|
||||
UNLOCK TABLES;
|
||||
FLUSH TABLES t1 FOR EXPORT;
|
||||
UNLOCK TABLES;
|
||||
LOCK TABLES t1 WRITE;
|
||||
FLUSH TABLES t1;
|
||||
UNLOCK TABLES;
|
||||
LOCK TABLES t1 READ;
|
||||
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
|
||||
FLUSH TABLES t1;
|
||||
UNLOCK TABLES;
|
||||
FLUSH TABLES t1;
|
||||
ANALYZE TABLE t1, t2;
|
||||
OPTIMIZE TABLE t1, t2;
|
||||
REPAIR TABLE x1, x2;
|
||||
--connection node_2
|
||||
--let $wsrep_last_committed_after2 = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
|
||||
--disable_query_log
|
||||
--eval SELECT $wsrep_last_committed_after2 = $wsrep_last_committed_before2 AS wsrep_last_committed_diff;
|
||||
--eval SELECT $wsrep_last_committed_after2 = $wsrep_last_committed_before + 9 AS wsrep_last_committed_diff2;
|
||||
--enable_query_log
|
||||
|
||||
SELECT COUNT(*) = 10 FROM t1;
|
||||
SELECT COUNT(*) = 10 FROM x1;
|
||||
SELECT COUNT(*) = 10000 FROM t2;
|
||||
SELECT COUNT(*) = 10 FROM x2;
|
||||
|
||||
--connection node_1
|
||||
set wsrep_on=1;
|
||||
DROP TABLE t1, t2, x1, x2;
|
|
@ -18,7 +18,9 @@
|
|||
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
|
||||
--connection node_2
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
|
||||
|
||||
--let $galera_sync_point = apply_monitor_slave_enter_sync
|
||||
--source include/galera_set_sync_point.inc
|
||||
|
||||
--connection node_1
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
@ -27,8 +29,7 @@ INSERT INTO t1 VALUES (1);
|
|||
SET SESSION wsrep_sync_wait = 0;
|
||||
|
||||
# Wait until applier has blocked
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = 'apply_monitor_slave_enter_sync'
|
||||
--source include/wait_condition.inc
|
||||
--source include/galera_wait_sync_point.inc
|
||||
|
||||
SELECT COUNT(*) = 0 FROM t1;
|
||||
|
||||
|
@ -41,8 +42,8 @@ SELECT COUNT(*) = 0 FROM t1;
|
|||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'Init' AND INFO = 'FLUSH TABLES WITH READ LOCK'
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=';
|
||||
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
|
||||
--source include/galera_clear_sync_point.inc
|
||||
--source include/galera_signal_sync_point.inc
|
||||
|
||||
--connection node_2a
|
||||
--reap
|
||||
|
|
5
mysql-test/suite/galera/t/galera_gcs_fragment.cnf
Normal file
5
mysql-test/suite/galera/t/galera_gcs_fragment.cnf
Normal file
|
@ -0,0 +1,5 @@
|
|||
!include ../galera_2nodes.cnf
|
||||
[mysqld.1]
|
||||
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcs.max_packet_size=64'
|
||||
[mysqld.2]
|
||||
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcs.max_packet_size=64'
|
66
mysql-test/suite/galera/t/galera_gcs_fragment.test
Normal file
66
mysql-test/suite/galera/t/galera_gcs_fragment.test
Normal file
|
@ -0,0 +1,66 @@
|
|||
# Test fragmentation over configuration changes
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
# Prepare table
|
||||
CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 TEXT);
|
||||
|
||||
# Stop node2
|
||||
|
||||
# Disconnect node_2 from group
|
||||
--connection node_2
|
||||
--let $wsrep_cluster_address_orig = `select @@wsrep_cluster_address`
|
||||
SET GLOBAL wsrep_cluster_address='';
|
||||
|
||||
# Connection for sync points
|
||||
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
|
||||
SET SESSION wsrep_sync_wait=0;
|
||||
|
||||
# Set breakpoint in gcs after first fragment send
|
||||
|
||||
--let $galera_sync_point = gcs_core_after_frag_send
|
||||
--source include/galera_set_sync_point.inc
|
||||
|
||||
--connection node_1
|
||||
SET SESSION wsrep_retry_autocommit=0;
|
||||
--send INSERT INTO t1 VALUES (1, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
|
||||
|
||||
--connection node_1a
|
||||
--source include/galera_wait_sync_point.inc
|
||||
--source include/galera_clear_sync_point.inc
|
||||
|
||||
|
||||
# Restart node_2, wait until it joins the group and then make INSERT
|
||||
--connection node_2
|
||||
--disable_query_log
|
||||
--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig'
|
||||
--enable_query_log
|
||||
SET SESSION wsrep_on = 0;
|
||||
--source include/galera_wait_ready.inc
|
||||
SET SESSION wsrep_on = 1;
|
||||
|
||||
INSERT INTO t1 VALUES (2, "bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
|
||||
|
||||
# Signal node_1 to continue
|
||||
--connection node_1a
|
||||
--source include/galera_signal_sync_point.inc
|
||||
|
||||
# Deadlock error should be returned since write set send was
|
||||
# interrupted by gcs
|
||||
--connection node_1
|
||||
--error ER_LOCK_DEADLOCK
|
||||
--reap
|
||||
|
||||
# Do additional insert to verify that node_1 remain operational
|
||||
INSERT INTO t1 VALUES (3, "cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
|
||||
|
||||
|
||||
# Nodes node_1 and node_2 should now contain rows 2 and 3
|
||||
SELECT * FROM t1;
|
||||
|
||||
--connection node_2
|
||||
SELECT * FROM t1;
|
||||
|
||||
--connection node_1
|
||||
|
||||
DROP TABLE t1;
|
|
@ -27,7 +27,9 @@ UPDATE t1 SET f2 = 'c' WHERE f1 > 2;
|
|||
|
||||
--connection node_2
|
||||
# Make sure IST will block ...
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=d,recv_IST_after_apply_trx';
|
||||
--let $galera_sync_point = recv_IST_after_apply_trx
|
||||
--source include/galera_set_sync_point.inc
|
||||
|
||||
SET SESSION wsrep_sync_wait = 0;
|
||||
|
||||
|
||||
|
|
|
@ -23,13 +23,17 @@ ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
|||
|
||||
FLUSH LOGS;
|
||||
--replace_column 2 # 4 # 5 #
|
||||
--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
|
||||
SHOW BINLOG EVENTS IN 'mysqld-bin.000002' LIMIT 4,18;
|
||||
|
||||
--connection node_2
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
--replace_column 2 # 4 # 5 #
|
||||
--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
|
||||
SHOW BINLOG EVENTS IN 'mysqld-bin.000003' LIMIT 3,18;
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
|
||||
--connection node_1
|
||||
RESET MASTER;
|
||||
|
|
79
mysql-test/suite/galera/t/galera_mdl_race.test
Normal file
79
mysql-test/suite/galera/t/galera_mdl_race.test
Normal file
|
@ -0,0 +1,79 @@
|
|||
#
|
||||
# This test tests a potential race condition in MDL locking
|
||||
#
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug_sync.inc
|
||||
|
||||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
|
||||
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
|
||||
INSERT INTO t1 VALUES (1, 'a');
|
||||
INSERT INTO t1 VALUES (2, 'a');
|
||||
|
||||
--connection node_1
|
||||
SET AUTOCOMMIT=ON;
|
||||
START TRANSACTION;
|
||||
|
||||
UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
|
||||
|
||||
# block access to t2
|
||||
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
|
||||
--connection node_1a
|
||||
LOCK TABLE t2 WRITE;
|
||||
|
||||
# Block before MLD lock wait
|
||||
--connection node_1
|
||||
SET GLOBAL DEBUG = "d,sync.wsrep_before_mdl_wait";
|
||||
--send SELECT * FROM t2;
|
||||
|
||||
# Wait for SELECT to be blocked
|
||||
--connection node_1a
|
||||
#--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIS WHERE STATE = 'System lock';
|
||||
#--source include/wait_condition.inc
|
||||
#--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'init' AND INFO = 'COMMIT';
|
||||
#--source include/wait_condition.inc
|
||||
|
||||
# block applier to wait after BF victim is locked
|
||||
SET GLOBAL DEBUG = "d,sync.wsrep_after_BF_victim_lock";
|
||||
|
||||
# Issue a conflicting update on node #2
|
||||
--connection node_2
|
||||
UPDATE t1 SET f2 = 'c' WHERE f1 = 1;
|
||||
|
||||
--sleep 3
|
||||
|
||||
# Unblock the SELECT, to enter wsrep_thd_is_BF
|
||||
--connection node_1a
|
||||
SET GLOBAL DEBUG = "";
|
||||
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_before_mdl_wait";
|
||||
|
||||
--sleep 3
|
||||
|
||||
# unblock applier to try to BF the SELECT
|
||||
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_after_BF_victim_lock";
|
||||
|
||||
|
||||
# table lock is not needed anymore
|
||||
--sleep 3
|
||||
UNLOCK TABLES;
|
||||
|
||||
# SELECT succeeds
|
||||
--connection node_1
|
||||
|
||||
--error ER_LOCK_DEADLOCK
|
||||
--reap
|
||||
|
||||
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
|
||||
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
|
||||
|
||||
--connection node_2
|
||||
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
|
||||
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
|
||||
--connection node_1a
|
||||
SET DEBUG_SYNC = "RESET";
|
||||
|
|
@ -1,3 +1 @@
|
|||
--query_cache_type=1 --query_cache_size=1355776
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
--query_cache_type=1 --query_cache_size=1355776
|
94
mysql-test/suite/galera/t/galera_query_cache_sync_wait.test
Normal file
94
mysql-test/suite/galera/t/galera_query_cache_sync_wait.test
Normal file
|
@ -0,0 +1,94 @@
|
|||
--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";
|
||||
SET DEBUG_SYNC = "RESET";
|
||||
|
||||
#
|
||||
# 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;
|
||||
|
||||
--connection node_2a
|
||||
SET DEBUG_SYNC = "RESET";
|
78
mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test
Normal file
78
mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test
Normal file
|
@ -0,0 +1,78 @@
|
|||
#
|
||||
# Test manipulating wsrep_desync while an RSU operation is in progress
|
||||
#
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug_sync.inc
|
||||
|
||||
# First, test wsrep_desync 1 > 0 during DDL
|
||||
|
||||
--connection node_1
|
||||
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
|
||||
|
||||
SET GLOBAL wsrep_desync=1;
|
||||
SET wsrep_OSU_method=RSU;
|
||||
|
||||
SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
|
||||
--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
|
||||
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
|
||||
--connection node_1a
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SET GLOBAL wsrep_desync=0;
|
||||
SET DEBUG_SYNC= 'now SIGNAL continue';
|
||||
|
||||
--connection node_1
|
||||
--reap
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
SHOW VARIABLES LIKE 'wsrep_desync';
|
||||
SET wsrep_OSU_method=TOI;
|
||||
|
||||
DROP TABLE t1;
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
|
||||
# Next, test wsrep_desync 0 > 1 during DDL, currently not allowed
|
||||
|
||||
--connection node_1
|
||||
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
|
||||
|
||||
SET GLOBAL wsrep_desync=0;
|
||||
SET wsrep_OSU_method=RSU;
|
||||
|
||||
SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
|
||||
--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
|
||||
--connection node_1a
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
|
||||
--source include/wait_condition.inc
|
||||
|
||||
# This transition is currently not allowed
|
||||
--error ER_CANNOT_USER
|
||||
SET GLOBAL wsrep_desync=1;
|
||||
SET GLOBAL wsrep_desync=0;
|
||||
|
||||
SET DEBUG_SYNC= 'now SIGNAL continue';
|
||||
|
||||
--connection node_1
|
||||
--reap
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
# Restore old state
|
||||
SET wsrep_OSU_method=TOI;
|
||||
DROP TABLE t1;
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
|
||||
CALL mtr.add_suppression("Protocol violation");
|
||||
CALL mtr.add_suppression("desync failed");
|
||||
|
||||
--connection node_2
|
||||
CALL mtr.add_suppression("Protocol violation");
|
||||
|
||||
|
|
@ -20,3 +20,10 @@ SET GLOBAL wsrep_sst_auth = 'sslsst:';
|
|||
|
||||
--source suite/galera/include/galera_sst_restore.inc
|
||||
DROP USER sslsst;
|
||||
|
||||
--connection node_2
|
||||
# We have to manually restore global_log and slow_query_log due to mysql-wsrep#108
|
||||
# Otherwise MTR's check_testcases complains
|
||||
|
||||
SET GLOBAL general_log = ON;
|
||||
SET GLOBAL slow_query_log = ON;
|
||||
|
|
68
mysql-test/suite/galera/t/galera_sync_wait_show.test
Normal file
68
mysql-test/suite/galera/t/galera_sync_wait_show.test
Normal file
|
@ -0,0 +1,68 @@
|
|||
#
|
||||
# Test that the various SHOW commands obey wsrep_sync_wait - codership/mysql-wsrep#228
|
||||
#
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--connection node_2
|
||||
SET SESSION wsrep_sync_wait = 1;
|
||||
|
||||
|
||||
--connection node_1
|
||||
CREATE DATABASE db1;
|
||||
|
||||
--connection node_2
|
||||
SHOW CREATE DATABASE db1;
|
||||
DROP DATABASE db1;
|
||||
|
||||
|
||||
--connection node_1
|
||||
CREATE PROCEDURE p1 () SELECT 1 FROM DUAL;
|
||||
|
||||
--connection node_2
|
||||
SHOW CREATE PROCEDURE p1;
|
||||
DROP PROCEDURE p1;
|
||||
|
||||
|
||||
|
||||
--connection node_1
|
||||
CREATE PROCEDURE p1 () SELECT 1 FROM DUAL;
|
||||
|
||||
--connection node_2
|
||||
SHOW PROCEDURE CODE p1;
|
||||
DROP PROCEDURE p1;
|
||||
|
||||
|
||||
|
||||
--connection node_1
|
||||
CREATE FUNCTION f1 () RETURNS INTEGER RETURN 123;
|
||||
|
||||
--connection node_2
|
||||
SHOW CREATE FUNCTION f1;
|
||||
DROP FUNCTION f1;
|
||||
|
||||
|
||||
--connection node_1
|
||||
CREATE FUNCTION f1 () RETURNS INTEGER RETURN 123;
|
||||
|
||||
--connection node_2
|
||||
SHOW FUNCTION CODE f1;
|
||||
DROP FUNCTION f1;
|
||||
|
||||
|
||||
--connection node_1
|
||||
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
|
||||
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a';
|
||||
|
||||
--connection node_2
|
||||
SHOW CREATE TRIGGER tr1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--connection node_1
|
||||
CREATE EVENT event1 ON SCHEDULE AT '2038-01-01 23:59:59' DO SELECT 1;
|
||||
|
||||
--connection node_2
|
||||
SHOW CREATE EVENT event1;
|
||||
DROP EVENT event1;
|
|
@ -23,7 +23,8 @@ SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE;
|
|||
|
||||
# Block the commit
|
||||
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
|
||||
--let $galera_sync_point = commit_monitor_enter_sync
|
||||
--source include/galera_set_sync_point.inc
|
||||
|
||||
--connection node_1
|
||||
--send COMMIT;
|
||||
|
@ -31,8 +32,7 @@ SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
|
|||
# Wait until commit is blocked
|
||||
--connection node_1a
|
||||
SET SESSION wsrep_sync_wait = 0;
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = 'commit_monitor_enter_sync'
|
||||
--source include/wait_condition.inc
|
||||
--source include/galera_wait_sync_point.inc
|
||||
|
||||
# Issue a conflicting update on node #2
|
||||
--connection node_2
|
||||
|
@ -48,8 +48,8 @@ UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
|
|||
|
||||
# Unblock the commit
|
||||
--connection node_1a
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=';
|
||||
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
|
||||
--source include/galera_clear_sync_point.inc
|
||||
--source include/galera_signal_sync_point.inc
|
||||
|
||||
# Commit succeeds
|
||||
--connection node_1
|
||||
|
|
36
mysql-test/suite/galera/t/mysql-wsrep#198.test
Normal file
36
mysql-test/suite/galera/t/mysql-wsrep#198.test
Normal file
|
@ -0,0 +1,36 @@
|
|||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
|
||||
--connection node_2
|
||||
LOCK TABLE t2 WRITE;
|
||||
|
||||
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
|
||||
--connection node_2a
|
||||
--send OPTIMIZE TABLE t1,t2;
|
||||
|
||||
--connect node_2b, 127.0.0.1, root, , test, $NODE_MYPORT_2
|
||||
--connection node_2b
|
||||
--send REPAIR TABLE t1,t2;
|
||||
|
||||
--connection node_2
|
||||
SET SESSION wsrep_sync_wait = 0;
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'Waiting for table metadata lock'
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection node_1
|
||||
INSERT INTO t2 VALUES (1);
|
||||
|
||||
--connection node_2
|
||||
UNLOCK TABLES;
|
||||
|
||||
--connection node_2a
|
||||
--reap
|
||||
|
||||
--connection node_2b
|
||||
--reap
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
1
mysql-test/suite/galera/t/mysql-wsrep#201-master.opt
Normal file
1
mysql-test/suite/galera/t/mysql-wsrep#201-master.opt
Normal file
|
@ -0,0 +1 @@
|
|||
--query_cache_type=1
|
33
mysql-test/suite/galera/t/mysql-wsrep#201.test
Normal file
33
mysql-test/suite/galera/t/mysql-wsrep#201.test
Normal file
|
@ -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 = 500
|
||||
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;
|
31
mysql-test/suite/galera/t/mysql-wsrep#237.test
Normal file
31
mysql-test/suite/galera/t/mysql-wsrep#237.test
Normal file
|
@ -0,0 +1,31 @@
|
|||
# hang because of replicated FLUSH TABLE command
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug_sync.inc
|
||||
|
||||
CREATE TABLE t (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
|
||||
|
||||
--connection node_1
|
||||
SET DEBUG_SYNC = 'wsrep_before_replication WAIT_FOR continue';
|
||||
--send INSERT INTO t values (1);
|
||||
|
||||
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
|
||||
--connection node_1a
|
||||
SET SESSION wsrep_sync_wait = 0;
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: wsrep_before_replication'
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection node_2
|
||||
FLUSH TABLES;
|
||||
|
||||
|
||||
--connection node_1a
|
||||
SELECT SLEEP(1);
|
||||
|
||||
SET DEBUG_SYNC= 'now SIGNAL continue';
|
||||
|
||||
--connection node_1
|
||||
--reap
|
||||
|
||||
DROP TABLE t;
|
23
mysql-test/suite/galera/t/mysql-wsrep#247.test
Normal file
23
mysql-test/suite/galera/t/mysql-wsrep#247.test
Normal file
|
@ -0,0 +1,23 @@
|
|||
#
|
||||
# codership/mysql-wsrep/247 MW-246 -
|
||||
# DDL with RSU fails if node is desynced upfont
|
||||
#
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--connection node_1
|
||||
|
||||
SET GLOBAL wsrep_desync=1;
|
||||
|
||||
SET wsrep_OSU_method=RSU;
|
||||
|
||||
CREATE TABLE t1 (i int primary key);
|
||||
|
||||
SHOW VARIABLES LIKE 'wsrep_desync';
|
||||
|
||||
SET GLOBAL wsrep_desync=0;
|
||||
--sleep 1
|
||||
DROP TABLE t1;
|
||||
SHOW VARIABLES LIKE 'wsrep_desync';
|
||||
|
39
mysql-test/suite/galera/t/mysql-wsrep#31.test
Normal file
39
mysql-test/suite/galera/t/mysql-wsrep#31.test
Normal file
|
@ -0,0 +1,39 @@
|
|||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--connection node_1
|
||||
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES('test');
|
||||
CREATE DATABASE db;
|
||||
|
||||
--connection node_2
|
||||
--let $expected_position_uuid = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_uuid'`
|
||||
--let $expected_position_seqno = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
|
||||
|
||||
--let $expected_position = $expected_position_uuid:$expected_position_seqno
|
||||
|
||||
--echo Shutting down server 2 ...
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
--echo Recovering server 2 ...
|
||||
--let $galera_wsrep_recover_server_id=2
|
||||
--source suite/galera/include/galera_wsrep_recover.inc
|
||||
|
||||
if ($galera_wsrep_start_position != $expected_position)
|
||||
{
|
||||
die(Expected position: $expected_position, found $galera_wsrep_start_position);
|
||||
}
|
||||
|
||||
--echo Restarting server ...
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
--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/wait_until_ready.inc
|
||||
|
||||
--connection node_1
|
||||
DROP TABLE t1;
|
||||
DROP DATABASE db;
|
||||
|
||||
|
|
@ -16,8 +16,8 @@ CREATE TABLE t2 (f1 LONGTEXT);
|
|||
INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
|
||||
INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
|
||||
INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
|
||||
SET GLOBAL wsrep_provider_options = 'signal=ist_sender_send_after_get_buffers';
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=';
|
||||
SET GLOBAL wsrep_provider_options = 'signal=ist_sender_send_after_get_buffers';
|
||||
INSERT INTO t1 VALUES (51), (52), (53), (54), (55);
|
||||
SELECT COUNT(*) = 30 FROM t1;
|
||||
COUNT(*) = 30
|
||||
|
|
|
@ -38,7 +38,8 @@ INSERT INTO t1 VALUES (11), (12), (13), (14), (15);
|
|||
INSERT INTO t1 VALUES (21), (22), (23), (24), (25);
|
||||
|
||||
# Make sure IST will block ...
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=d,ist_sender_send_after_get_buffers';
|
||||
--let $galera_sync_point = ist_sender_send_after_get_buffers
|
||||
--source include/galera_set_sync_point.inc
|
||||
|
||||
# ... and restart providers to force IST
|
||||
--connection node_2
|
||||
|
@ -70,8 +71,8 @@ INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
|
|||
INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
|
||||
|
||||
# Unlock IST and wait for it to complete
|
||||
SET GLOBAL wsrep_provider_options = 'signal=ist_sender_send_after_get_buffers';
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=';
|
||||
--source include/galera_clear_sync_point.inc
|
||||
--source include/galera_signal_sync_point.inc
|
||||
|
||||
INSERT INTO t1 VALUES (51), (52), (53), (54), (55);
|
||||
|
||||
|
|
|
@ -1286,28 +1286,6 @@
|
|||
fun:dlerror
|
||||
}
|
||||
|
||||
{
|
||||
GitHub codership/galera#308
|
||||
Memcheck:Leak
|
||||
match-leak-kinds: definite
|
||||
fun:malloc
|
||||
fun:_ZNK6galera13ReplicatorSMM9stats_getEv
|
||||
fun:_ZL28export_wsrep_status_to_mysqlP3THD
|
||||
fun:_Z17wsrep_show_statusP3THDP17st_mysql_show_varPc
|
||||
fun:_ZL17show_status_arrayP3THDPKcP17st_mysql_show_var13enum_var_typeP17system_status_varS2_P5TABLEbP4Item
|
||||
fun:_Z11fill_statusP3THDP10TABLE_LISTP4Item
|
||||
fun:_ZL13do_fill_tableP3THDP10TABLE_LISTP13st_join_table
|
||||
fun:_Z24get_schema_tables_resultP4JOIN23enum_schema_table_state
|
||||
fun:_ZN4JOIN14prepare_resultEPP4ListI4ItemE
|
||||
fun:_ZN4JOIN4execEv
|
||||
fun:_ZL20mysql_execute_selectP3THDP13st_select_lexb
|
||||
fun:_Z12mysql_selectP3THDP10TABLE_LISTjR4ListI4ItemEPS4_P10SQL_I_ListI8st_orderESB_S7_yP13select_resultP18st_select_lex_unitP13st_select_lex
|
||||
fun:_Z13handle_selectP3THDP13select_resultm
|
||||
fun:_ZL21execute_sqlcom_selectP3THDP10TABLE_LIST
|
||||
fun:_Z21mysql_execute_commandP3THD
|
||||
fun:_Z11mysql_parseP3THDPcjP12Parser_state
|
||||
}
|
||||
|
||||
{
|
||||
GitHub codership/mysql-wsrep#176
|
||||
Memcheck:Leak
|
||||
|
|
|
@ -250,7 +250,11 @@ parse_cnf()
|
|||
{
|
||||
local group=$1
|
||||
local var=$2
|
||||
reval=$($MY_PRINT_DEFAULTS $group | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2-)
|
||||
# print the default settings for given group using my_print_default.
|
||||
# normalize the variable names specified in cnf file (user can use _ or - for example log-bin or log_bin)
|
||||
# then grep for needed variable
|
||||
# finally get the variable value (if variables has been specified multiple time use the last value only)
|
||||
reval=$($MY_PRINT_DEFAULTS $group | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2- | tail -1)
|
||||
if [[ -z $reval ]];then
|
||||
[[ -n $3 ]] && reval=$3
|
||||
fi
|
||||
|
@ -699,9 +703,8 @@ then
|
|||
INNOEXTRA+=" --user=$WSREP_SST_OPT_USER"
|
||||
fi
|
||||
|
||||
if [ -n "$WSREP_SST_OPT_PSWD" ]; then
|
||||
# INNOEXTRA+=" --password=$WSREP_SST_OPT_PSWD"
|
||||
export MYSQL_PWD="$WSREP_SST_OPT_PSWD"
|
||||
if [ -n "${WSREP_SST_OPT_PSWD:-}" ]; then
|
||||
INNOEXTRA+=" --password=$WSREP_SST_OPT_PSWD"
|
||||
else
|
||||
# Empty password, used for testing, debugging etc.
|
||||
INNOEXTRA+=" --password="
|
||||
|
|
|
@ -442,9 +442,8 @@ then
|
|||
INNOEXTRA+=" --user=$WSREP_SST_OPT_USER"
|
||||
fi
|
||||
|
||||
if [ -n "$WSREP_SST_OPT_PSWD" ]; then
|
||||
# INNOEXTRA+=" --password=$WSREP_SST_OPT_PSWD"
|
||||
export MYSQL_PWD="$WSREP_SST_OPT_PSWD"
|
||||
if [ -n "${WSREP_SST_OPT_PSWD:-}" ]; then
|
||||
INNOEXTRA+=" --password=$WSREP_SST_OPT_PSWD"
|
||||
else
|
||||
# Empty password, used for testing, debugging etc.
|
||||
INNOEXTRA+=" --password="
|
||||
|
|
|
@ -9895,7 +9895,18 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi)
|
|||
}
|
||||
|
||||
#ifdef HAVE_QUERY_CACHE
|
||||
#ifdef WITH_WSREP
|
||||
/*
|
||||
Moved invalidation right before the call to rows_event_stmt_cleanup(),
|
||||
to avoid query cache being polluted with stale entries.
|
||||
*/
|
||||
if (! (WSREP(thd) && (thd->wsrep_exec_mode == REPL_RECV)))
|
||||
{
|
||||
#endif /* WITH_WSREP */
|
||||
query_cache.invalidate_locked_for_write(thd, rgi->tables_to_lock);
|
||||
#ifdef WITH_WSREP
|
||||
}
|
||||
#endif /* WITH_WSREP */
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -10087,6 +10098,14 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi)
|
|||
/* remove trigger's tables */
|
||||
if (slave_run_triggers_for_rbr)
|
||||
restore_empty_query_table_list(thd->lex);
|
||||
|
||||
#if defined(WITH_WSREP) && defined(HAVE_QUERY_CACHE)
|
||||
if (WSREP(thd) && thd->wsrep_exec_mode == REPL_RECV)
|
||||
{
|
||||
query_cache.invalidate_locked_for_write(thd, rgi->tables_to_lock);
|
||||
}
|
||||
#endif /* WITH_WSREP && HAVE_QUERY_CACHE */
|
||||
|
||||
if (get_flags(STMT_END_F) && (error= rows_event_stmt_cleanup(rgi, thd)))
|
||||
slave_rows_error_report(ERROR_LEVEL,
|
||||
thd->is_error() ? 0 : error,
|
||||
|
|
11
sql/mdl.cc
11
sql/mdl.cc
|
@ -1064,7 +1064,16 @@ MDL_wait::timed_wait(MDL_context_owner *owner, struct timespec *abs_timeout,
|
|||
wait_result != ETIMEDOUT && wait_result != ETIME)
|
||||
{
|
||||
#ifdef WITH_WSREP
|
||||
if (wsrep_thd_is_BF(owner->get_thd(), true))
|
||||
// Allow tests to block the applier thread using the DBUG facilities
|
||||
DBUG_EXECUTE_IF("sync.wsrep_before_mdl_wait",
|
||||
{
|
||||
const char act[]=
|
||||
"now "
|
||||
"wait_for signal.wsrep_before_mdl_wait";
|
||||
DBUG_ASSERT(!debug_sync_set_action((owner->get_thd()),
|
||||
STRING_WITH_LEN(act)));
|
||||
};);
|
||||
if (wsrep_thd_is_BF(owner->get_thd(), false))
|
||||
{
|
||||
wait_result= mysql_cond_wait(&m_COND_wait_status, &m_LOCK_wait_status);
|
||||
}
|
||||
|
|
|
@ -1206,9 +1206,8 @@ bool Sql_cmd_analyze_table::execute(THD *thd)
|
|||
if (check_table_access(thd, SELECT_ACL | INSERT_ACL, first_table,
|
||||
FALSE, UINT_MAX, FALSE))
|
||||
goto error;
|
||||
WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table);
|
||||
thd->enable_slow_log= opt_log_slow_admin_statements;
|
||||
WSREP_TO_ISOLATION_BEGIN(first_table->db, first_table->table_name, NULL);
|
||||
|
||||
res= mysql_admin_table(thd, first_table, &m_lex->check_opt,
|
||||
"analyze", lock_type, 1, 0, 0, 0,
|
||||
&handler::ha_analyze, 0);
|
||||
|
@ -1263,7 +1262,7 @@ bool Sql_cmd_optimize_table::execute(THD *thd)
|
|||
if (check_table_access(thd, SELECT_ACL | INSERT_ACL, first_table,
|
||||
FALSE, UINT_MAX, FALSE))
|
||||
goto error; /* purecov: inspected */
|
||||
WSREP_TO_ISOLATION_BEGIN(first_table->db, first_table->table_name, NULL)
|
||||
WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table);
|
||||
thd->enable_slow_log= opt_log_slow_admin_statements;
|
||||
res= (specialflag & SPECIAL_NO_NEW_FUNC) ?
|
||||
mysql_recreate_table(thd, first_table, true) :
|
||||
|
@ -1297,7 +1296,7 @@ bool Sql_cmd_repair_table::execute(THD *thd)
|
|||
FALSE, UINT_MAX, FALSE))
|
||||
goto error; /* purecov: inspected */
|
||||
thd->enable_slow_log= opt_log_slow_admin_statements;
|
||||
WSREP_TO_ISOLATION_BEGIN(first_table->db, first_table->table_name, NULL)
|
||||
WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table);
|
||||
res= mysql_admin_table(thd, first_table, &m_lex->check_opt, "repair",
|
||||
TL_WRITE, 1,
|
||||
MY_TEST(m_lex->check_opt.sql_flags & TT_USEFRM),
|
||||
|
|
|
@ -1933,6 +1933,13 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
|
|||
(int)flags.autocommit));
|
||||
memcpy((uchar *)(sql + (tot_length - QUERY_CACHE_FLAGS_SIZE)),
|
||||
(uchar*) &flags, QUERY_CACHE_FLAGS_SIZE);
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
bool once_more;
|
||||
once_more= true;
|
||||
lookup:
|
||||
#endif /* WITH_WSREP */
|
||||
|
||||
query_block = (Query_cache_block *) my_hash_search(&queries, (uchar*) sql,
|
||||
tot_length);
|
||||
/* Quick abort on unlocked data */
|
||||
|
@ -1945,6 +1952,19 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
|
|||
}
|
||||
DBUG_PRINT("qcache", ("Query in query hash 0x%lx", (ulong)query_block));
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
if (once_more && WSREP_CLIENT(thd) && wsrep_must_sync_wait(thd))
|
||||
{
|
||||
unlock();
|
||||
if (wsrep_sync_wait(thd))
|
||||
goto err;
|
||||
if (try_lock(thd, Query_cache::TIMEOUT))
|
||||
goto err;
|
||||
once_more= false;
|
||||
goto lookup;
|
||||
}
|
||||
#endif /* WITH_WSREP */
|
||||
|
||||
/* Now lock and test that nothing changed while blocks was unlocked */
|
||||
BLOCK_LOCK_RD(query_block);
|
||||
|
||||
|
|
|
@ -1027,6 +1027,7 @@ THD::THD(bool is_wsrep_applier)
|
|||
wsrep_TOI_pre_query = NULL;
|
||||
wsrep_TOI_pre_query_len = 0;
|
||||
wsrep_info[sizeof(wsrep_info) - 1] = '\0'; /* make sure it is 0-terminated */
|
||||
wsrep_sync_wait_gtid = WSREP_GTID_UNDEFINED;
|
||||
#endif
|
||||
/* Call to init() below requires fully initialized Open_tables_state. */
|
||||
reset_open_tables_state(this);
|
||||
|
@ -1441,7 +1442,8 @@ void THD::init(void)
|
|||
wsrep_mysql_replicated = 0;
|
||||
wsrep_TOI_pre_query = NULL;
|
||||
wsrep_TOI_pre_query_len = 0;
|
||||
#endif
|
||||
wsrep_sync_wait_gtid = WSREP_GTID_UNDEFINED;
|
||||
#endif /* WITH_WSREP */
|
||||
|
||||
if (variables.sql_log_bin)
|
||||
variables.option_bits|= OPTION_BIN_LOG;
|
||||
|
@ -2202,6 +2204,10 @@ void THD::cleanup_after_query()
|
|||
rgi_slave->cleanup_after_query();
|
||||
#endif
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
wsrep_sync_wait_gtid= WSREP_GTID_UNDEFINED;
|
||||
#endif /* WITH_WSREP */
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
|
|
@ -3991,6 +3991,7 @@ public:
|
|||
void *wsrep_apply_format;
|
||||
char wsrep_info[128]; /* string for dynamic proc info */
|
||||
bool wsrep_skip_append_keys;
|
||||
wsrep_gtid_t wsrep_sync_wait_gtid;
|
||||
#endif /* WITH_WSREP */
|
||||
|
||||
/* Handling of timeouts for commands */
|
||||
|
|
|
@ -4517,6 +4517,11 @@ end_with_restore_list:
|
|||
db_name.str= db_name_buff;
|
||||
db_name.length= lex->name.length;
|
||||
strmov(db_name.str, lex->name.str);
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
|
||||
#endif /* WITH_WSREP */
|
||||
|
||||
if (check_db_name(&db_name))
|
||||
{
|
||||
my_error(ER_WRONG_DB_NAME, MYF(0), db_name.str);
|
||||
|
@ -4570,6 +4575,9 @@ end_with_restore_list:
|
|||
/* lex->unit.cleanup() is called outside, no need to call it here */
|
||||
break;
|
||||
case SQLCOM_SHOW_CREATE_EVENT:
|
||||
#ifdef WITH_WSREP
|
||||
if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
|
||||
#endif /* WITH_WSREP */
|
||||
res= Events::show_create_event(thd, lex->spname->m_db,
|
||||
lex->spname->m_name);
|
||||
break;
|
||||
|
@ -4798,16 +4806,29 @@ end_with_restore_list:
|
|||
|
||||
#ifdef WITH_WSREP
|
||||
if (lex->type & (
|
||||
REFRESH_GRANT |
|
||||
REFRESH_HOSTS |
|
||||
REFRESH_DES_KEY_FILE |
|
||||
REFRESH_GRANT |
|
||||
REFRESH_HOSTS |
|
||||
#ifdef HAVE_OPENSSL
|
||||
REFRESH_DES_KEY_FILE |
|
||||
#endif
|
||||
/*
|
||||
Write all flush log statements except
|
||||
FLUSH LOGS
|
||||
FLUSH BINARY LOGS
|
||||
Check reload_acl_and_cache for why.
|
||||
*/
|
||||
REFRESH_RELAY_LOG |
|
||||
REFRESH_SLOW_LOG |
|
||||
REFRESH_GENERAL_LOG |
|
||||
REFRESH_ENGINE_LOG |
|
||||
REFRESH_ERROR_LOG |
|
||||
#ifdef HAVE_QUERY_CACHE
|
||||
REFRESH_QUERY_CACHE_FREE |
|
||||
REFRESH_QUERY_CACHE_FREE |
|
||||
#endif /* HAVE_QUERY_CACHE */
|
||||
REFRESH_STATUS |
|
||||
REFRESH_USER_RESOURCES))
|
||||
REFRESH_STATUS |
|
||||
REFRESH_USER_RESOURCES))
|
||||
{
|
||||
WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
|
||||
WSREP_TO_ISOLATION_BEGIN_WRTCHK(WSREP_MYSQL_DB, NULL, NULL)
|
||||
}
|
||||
#endif /* WITH_WSREP*/
|
||||
|
||||
|
@ -4841,11 +4862,11 @@ end_with_restore_list:
|
|||
*/
|
||||
if (first_table)
|
||||
{
|
||||
WSREP_TO_ISOLATION_BEGIN(NULL, NULL, first_table);
|
||||
WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table);
|
||||
}
|
||||
else
|
||||
{
|
||||
WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
|
||||
WSREP_TO_ISOLATION_BEGIN_WRTCHK(WSREP_MYSQL_DB, NULL, NULL);
|
||||
}
|
||||
}
|
||||
#endif /* WITH_WSREP */
|
||||
|
@ -5447,12 +5468,18 @@ create_sp_error:
|
|||
}
|
||||
case SQLCOM_SHOW_CREATE_PROC:
|
||||
{
|
||||
#ifdef WITH_WSREP
|
||||
if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
|
||||
#endif /* WITH_WSREP */
|
||||
if (sp_show_create_routine(thd, TYPE_ENUM_PROCEDURE, lex->spname))
|
||||
goto error;
|
||||
break;
|
||||
}
|
||||
case SQLCOM_SHOW_CREATE_FUNC:
|
||||
{
|
||||
#ifdef WITH_WSREP
|
||||
if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
|
||||
#endif /* WITH_WSREP */
|
||||
if (sp_show_create_routine(thd, TYPE_ENUM_FUNCTION, lex->spname))
|
||||
goto error;
|
||||
break;
|
||||
|
@ -5465,6 +5492,9 @@ create_sp_error:
|
|||
stored_procedure_type type= (lex->sql_command == SQLCOM_SHOW_PROC_CODE ?
|
||||
TYPE_ENUM_PROCEDURE : TYPE_ENUM_FUNCTION);
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
|
||||
#endif /* WITH_WSREP */
|
||||
if (sp_cache_routine(thd, type, lex->spname, FALSE, &sp))
|
||||
goto error;
|
||||
if (!sp || sp->show_routine_code(thd))
|
||||
|
@ -5489,6 +5519,9 @@ create_sp_error:
|
|||
goto error;
|
||||
}
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
|
||||
#endif /* WITH_WSREP */
|
||||
if (show_create_trigger(thd, lex->spname))
|
||||
goto error; /* Error has been already logged. */
|
||||
|
||||
|
@ -7333,6 +7366,12 @@ void mysql_parse(THD *thd, char *rawbuf, uint length,
|
|||
sql_statement_info[SQLCOM_SELECT].m_key);
|
||||
status_var_increment(thd->status_var.com_stat[SQLCOM_SELECT]);
|
||||
thd->update_stats();
|
||||
#ifdef WITH_WSREP
|
||||
if (WSREP_CLIENT(thd))
|
||||
{
|
||||
thd->wsrep_sync_wait_gtid= WSREP_GTID_UNDEFINED;
|
||||
}
|
||||
#endif /* WITH_WSREP */
|
||||
}
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include "log_event.h" // class THD, EVENT_LEN_OFFSET, etc.
|
||||
#include "wsrep_applier.h"
|
||||
#include "debug_sync.h"
|
||||
|
||||
/*
|
||||
read the first event from (*buf). The size of the (*buf) is (*buf_len).
|
||||
|
@ -220,6 +221,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
|
||||
|
@ -279,8 +290,7 @@ wsrep_cb_status_t wsrep_apply_cb(void* const ctx,
|
|||
return rcode;
|
||||
}
|
||||
|
||||
static wsrep_cb_status_t wsrep_commit(THD* const thd,
|
||||
wsrep_seqno_t const global_seqno)
|
||||
static wsrep_cb_status_t wsrep_commit(THD* const thd)
|
||||
{
|
||||
#ifdef WSREP_PROC_INFO
|
||||
snprintf(thd->wsrep_info, sizeof(thd->wsrep_info) - 1,
|
||||
|
@ -299,7 +309,11 @@ static wsrep_cb_status_t wsrep_commit(THD* const thd,
|
|||
#ifdef GTID_SUPPORT
|
||||
thd->variables.gtid_next.set_automatic();
|
||||
#endif /* GTID_SUPPORT */
|
||||
// TODO: mark snapshot with global_seqno.
|
||||
if (thd->wsrep_apply_toi)
|
||||
{
|
||||
wsrep_set_SE_checkpoint(thd->wsrep_trx_meta.gtid.uuid,
|
||||
thd->wsrep_trx_meta.gtid.seqno);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WSREP_PROC_INFO
|
||||
|
@ -313,8 +327,7 @@ static wsrep_cb_status_t wsrep_commit(THD* const thd,
|
|||
return rcode;
|
||||
}
|
||||
|
||||
static wsrep_cb_status_t wsrep_rollback(THD* const thd,
|
||||
wsrep_seqno_t const global_seqno)
|
||||
static wsrep_cb_status_t wsrep_rollback(THD* const thd)
|
||||
{
|
||||
#ifdef WSREP_PROC_INFO
|
||||
snprintf(thd->wsrep_info, sizeof(thd->wsrep_info) - 1,
|
||||
|
@ -351,9 +364,9 @@ wsrep_cb_status_t wsrep_commit_cb(void* const ctx,
|
|||
wsrep_cb_status_t rcode;
|
||||
|
||||
if (commit)
|
||||
rcode = wsrep_commit(thd, meta->gtid.seqno);
|
||||
rcode = wsrep_commit(thd);
|
||||
else
|
||||
rcode = wsrep_rollback(thd, meta->gtid.seqno);
|
||||
rcode = wsrep_rollback(thd);
|
||||
|
||||
wsrep_set_apply_format(thd, NULL);
|
||||
thd->mdl_context.release_transactional_locks();
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "wsrep_xid.h"
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include "debug_sync.h"
|
||||
|
||||
extern ulonglong thd_to_trx_id(THD *thd);
|
||||
|
||||
|
@ -67,6 +68,17 @@ void wsrep_register_hton(THD* thd, bool all)
|
|||
if (WSREP(thd) && thd->wsrep_exec_mode != TOTAL_ORDER &&
|
||||
!thd->wsrep_apply_toi)
|
||||
{
|
||||
if (thd->wsrep_exec_mode == LOCAL_STATE &&
|
||||
(thd_sql_command(thd) == SQLCOM_OPTIMIZE ||
|
||||
thd_sql_command(thd) == SQLCOM_ANALYZE ||
|
||||
thd_sql_command(thd) == SQLCOM_REPAIR) &&
|
||||
thd->lex->no_write_to_binlog == 1)
|
||||
{
|
||||
WSREP_DEBUG("Skipping wsrep_register_hton for LOCAL sql admin command : %s",
|
||||
thd->query());
|
||||
return;
|
||||
}
|
||||
|
||||
THD_TRANS *trans=all ? &thd->transaction.all : &thd->transaction.stmt;
|
||||
for (Ha_trx_info *i= trans->ha_list; i; i = i->next())
|
||||
{
|
||||
|
@ -317,6 +329,8 @@ wsrep_run_wsrep_commit(THD *thd, bool all)
|
|||
thd->get_stmt_da()->sql_errno(), thd->get_stmt_da()->message());
|
||||
}
|
||||
|
||||
DEBUG_SYNC(thd, "wsrep_before_replication");
|
||||
|
||||
if (thd->slave_thread && !opt_log_slave_updates) DBUG_RETURN(WSREP_TRX_OK);
|
||||
|
||||
if (thd->wsrep_exec_mode == REPL_RECV) {
|
||||
|
|
|
@ -940,19 +940,24 @@ bool wsrep_start_replication()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool wsrep_must_sync_wait (THD* thd, uint mask)
|
||||
{
|
||||
return (thd->variables.wsrep_sync_wait & mask) &&
|
||||
thd->variables.wsrep_on &&
|
||||
!thd->in_active_multi_stmt_transaction() &&
|
||||
thd->wsrep_conflict_state != REPLAYING &&
|
||||
thd->wsrep_sync_wait_gtid.seqno == WSREP_SEQNO_UNDEFINED;
|
||||
}
|
||||
|
||||
bool wsrep_sync_wait (THD* thd, uint mask)
|
||||
{
|
||||
if ((thd->variables.wsrep_sync_wait & mask) &&
|
||||
thd->variables.wsrep_on &&
|
||||
!thd->in_active_multi_stmt_transaction() &&
|
||||
thd->wsrep_conflict_state != REPLAYING)
|
||||
if (wsrep_must_sync_wait(thd, mask))
|
||||
{
|
||||
WSREP_DEBUG("wsrep_sync_wait: thd->variables.wsrep_sync_wait = %u, mask = %u",
|
||||
thd->variables.wsrep_sync_wait, mask);
|
||||
// This allows autocommit SELECTs and a first SELECT after SET AUTOCOMMIT=0
|
||||
// TODO: modify to check if thd has locked any rows.
|
||||
wsrep_gtid_t gtid;
|
||||
wsrep_status_t ret= wsrep->causal_read (wsrep, >id);
|
||||
wsrep_status_t ret= wsrep->causal_read (wsrep, &thd->wsrep_sync_wait_gtid);
|
||||
|
||||
if (unlikely(WSREP_OK != ret))
|
||||
{
|
||||
|
@ -1460,16 +1465,19 @@ static int wsrep_RSU_begin(THD *thd, char *db_, char *table_)
|
|||
WSREP_DEBUG("RSU BEGIN: %lld, %d : %s", (long long)wsrep_thd_trx_seqno(thd),
|
||||
thd->wsrep_exec_mode, thd->query() );
|
||||
|
||||
ret = wsrep->desync(wsrep);
|
||||
if (ret != WSREP_OK)
|
||||
if (!wsrep_desync)
|
||||
{
|
||||
WSREP_WARN("RSU desync failed %d for schema: %s, query: %s",
|
||||
ret,
|
||||
(thd->db ? thd->db : "(null)"),
|
||||
thd->query());
|
||||
my_error(ER_LOCK_DEADLOCK, MYF(0));
|
||||
return(ret);
|
||||
ret = wsrep->desync(wsrep);
|
||||
if (ret != WSREP_OK)
|
||||
{
|
||||
WSREP_WARN("RSU desync failed %d for schema: %s, query: %s",
|
||||
ret, (thd->db ? thd->db : "(null)"), thd->query());
|
||||
my_error(ER_LOCK_DEADLOCK, MYF(0));
|
||||
return(ret);
|
||||
}
|
||||
}
|
||||
else
|
||||
WSREP_DEBUG("RSU desync skipped: %d", wsrep_desync);
|
||||
mysql_mutex_lock(&LOCK_wsrep_replaying);
|
||||
wsrep_replaying++;
|
||||
mysql_mutex_unlock(&LOCK_wsrep_replaying);
|
||||
|
@ -1484,13 +1492,14 @@ static int wsrep_RSU_begin(THD *thd, char *db_, char *table_)
|
|||
wsrep_replaying--;
|
||||
mysql_mutex_unlock(&LOCK_wsrep_replaying);
|
||||
|
||||
ret = wsrep->resync(wsrep);
|
||||
if (ret != WSREP_OK)
|
||||
if (!wsrep_desync)
|
||||
{
|
||||
WSREP_WARN("resync failed %d for schema: %s, query: %s",
|
||||
ret,
|
||||
(thd->db ? thd->db : "(null)"),
|
||||
thd->query());
|
||||
ret = wsrep->resync(wsrep);
|
||||
if (ret != WSREP_OK)
|
||||
{
|
||||
WSREP_WARN("resync failed %d for schema: %s, query: %s",
|
||||
ret, (thd->db ? thd->db : "(null)"), thd->query());
|
||||
}
|
||||
}
|
||||
my_error(ER_LOCK_DEADLOCK, MYF(0));
|
||||
return(1);
|
||||
|
@ -1527,14 +1536,18 @@ static void wsrep_RSU_end(THD *thd)
|
|||
(thd->db ? thd->db : "(null)"),
|
||||
thd->query());
|
||||
}
|
||||
ret = wsrep->resync(wsrep);
|
||||
if (ret != WSREP_OK)
|
||||
if (!wsrep_desync)
|
||||
{
|
||||
WSREP_WARN("resync failed %d for schema: %s, query: %s", ret,
|
||||
(thd->db ? thd->db : "(null)"),
|
||||
thd->query());
|
||||
return;
|
||||
ret = wsrep->resync(wsrep);
|
||||
if (ret != WSREP_OK)
|
||||
{
|
||||
WSREP_WARN("resync failed %d for schema: %s, query: %s", ret,
|
||||
(thd->db ? thd->db : "(null)"), thd->query());
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
WSREP_DEBUG("RSU resync skipped: %d", wsrep_desync);
|
||||
thd->variables.wsrep_on = 1;
|
||||
}
|
||||
|
||||
|
@ -2181,9 +2194,9 @@ int wsrep_create_sp(THD *thd, uchar** buf, size_t* buf_len)
|
|||
&(thd->lex->definer->host),
|
||||
saved_mode))
|
||||
{
|
||||
WSREP_WARN("SP create string failed: schema: %s, query: %s",
|
||||
(thd->db ? thd->db : "(null)"), thd->query());
|
||||
return 1;
|
||||
WSREP_WARN("SP create string failed: schema: %s, query: %s",
|
||||
(thd->db ? thd->db : "(null)"), thd->query());
|
||||
return 1;
|
||||
}
|
||||
|
||||
return wsrep_to_buf_helper(thd, log_query.ptr(), log_query.length(), buf, buf_len);
|
||||
|
|
|
@ -160,6 +160,7 @@ extern void wsrep_kill_mysql(THD *thd);
|
|||
/* new defines */
|
||||
extern void wsrep_stop_replication(THD *thd);
|
||||
extern bool wsrep_start_replication();
|
||||
extern bool wsrep_must_sync_wait(THD* thd, uint mask = WSREP_SYNC_WAIT_BEFORE_READ);
|
||||
extern bool wsrep_sync_wait(THD* thd, uint mask = WSREP_SYNC_WAIT_BEFORE_READ);
|
||||
extern int wsrep_check_opts();
|
||||
extern void wsrep_prepend_PATH (const char* path);
|
||||
|
@ -327,6 +328,7 @@ int wsrep_create_trigger_query(THD *thd, uchar** buf, size_t* buf_len);
|
|||
#define wsrep_prepend_PATH(X)
|
||||
#define wsrep_before_SE() (0)
|
||||
#define wsrep_init_startup(X)
|
||||
#define wsrep_must_sync_wait(...) (0)
|
||||
#define wsrep_sync_wait(...) (0)
|
||||
#define wsrep_to_isolation_begin(...) (0)
|
||||
#define wsrep_register_hton(...) do { } while(0)
|
||||
|
|
|
@ -18339,6 +18339,15 @@ wsrep_innobase_kill_one_trx(
|
|||
(thd && wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void");
|
||||
|
||||
wsrep_thd_LOCK(thd);
|
||||
DBUG_EXECUTE_IF("sync.wsrep_after_BF_victim_lock",
|
||||
{
|
||||
const char act[]=
|
||||
"now "
|
||||
"wait_for signal.wsrep_after_BF_victim_lock";
|
||||
DBUG_ASSERT(!debug_sync_set_action(bf_thd,
|
||||
STRING_WITH_LEN(act)));
|
||||
};);
|
||||
|
||||
|
||||
if (wsrep_thd_query_state(thd) == QUERY_EXITING) {
|
||||
WSREP_DEBUG("kill trx EXITING for %lu", victim_trx->id);
|
||||
|
|
|
@ -33,6 +33,8 @@ Created 25/5/2010 Sunny Bains
|
|||
#include "ha_prototypes.h"
|
||||
#include "lock0priv.h"
|
||||
|
||||
#include <mysql/service_wsrep.h>
|
||||
|
||||
/*********************************************************************//**
|
||||
Print the contents of the lock_sys_t::waiting_threads array. */
|
||||
static
|
||||
|
@ -184,6 +186,28 @@ lock_wait_table_reserve_slot(
|
|||
return(NULL);
|
||||
}
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
/*********************************************************************//**
|
||||
check if lock timeout was for priority thread,
|
||||
as a side effect trigger lock monitor
|
||||
@return false for regular lock timeout */
|
||||
static ibool
|
||||
wsrep_is_BF_lock_timeout(
|
||||
/*====================*/
|
||||
trx_t* trx) /* in: trx to check for lock priority */
|
||||
{
|
||||
if (wsrep_on(trx->mysql_thd) &&
|
||||
wsrep_thd_is_BF(trx->mysql_thd, FALSE)) {
|
||||
fprintf(stderr, "WSREP: BF lock wait long\n");
|
||||
srv_print_innodb_monitor = TRUE;
|
||||
srv_print_innodb_lock_monitor = TRUE;
|
||||
os_event_set(srv_monitor_event);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
#endif /* WITH_WSREP */
|
||||
|
||||
/***************************************************************//**
|
||||
Puts a user OS thread to wait for a lock to be released. If an error
|
||||
occurs during the wait trx->error_state associated with thr is
|
||||
|
@ -371,9 +395,17 @@ lock_wait_suspend_thread(
|
|||
|
||||
if (lock_wait_timeout < 100000000
|
||||
&& wait_time > (double) lock_wait_timeout) {
|
||||
#ifdef WITH_WSREP
|
||||
if (!wsrep_on(trx->mysql_thd) ||
|
||||
(!wsrep_is_BF_lock_timeout(trx) &&
|
||||
trx->error_state != DB_DEADLOCK)) {
|
||||
#endif /* WITH_WSREP */
|
||||
|
||||
trx->error_state = DB_LOCK_WAIT_TIMEOUT;
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
}
|
||||
#endif /* WITH_WSREP */
|
||||
MONITOR_INC(MONITOR_TIMEOUT);
|
||||
}
|
||||
|
||||
|
@ -457,8 +489,13 @@ lock_wait_check_and_cancel(
|
|||
if (trx->lock.wait_lock) {
|
||||
|
||||
ut_a(trx->lock.que_state == TRX_QUE_LOCK_WAIT);
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
if (!wsrep_is_BF_lock_timeout(trx)) {
|
||||
#endif /* WITH_WSREP */
|
||||
lock_cancel_waiting_and_release(trx->lock.wait_lock);
|
||||
#ifdef WITH_WSREP
|
||||
}
|
||||
#endif /* WITH_WSREP */
|
||||
}
|
||||
|
||||
lock_mutex_exit();
|
||||
|
|
|
@ -19248,6 +19248,15 @@ wsrep_innobase_kill_one_trx(
|
|||
(thd && wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void");
|
||||
|
||||
wsrep_thd_LOCK(thd);
|
||||
DBUG_EXECUTE_IF("sync.wsrep_after_BF_victim_lock",
|
||||
{
|
||||
const char act[]=
|
||||
"now "
|
||||
"wait_for signal.wsrep_after_BF_victim_lock";
|
||||
DBUG_ASSERT(!debug_sync_set_action(bf_thd,
|
||||
STRING_WITH_LEN(act)));
|
||||
};);
|
||||
|
||||
|
||||
if (wsrep_thd_query_state(thd) == QUERY_EXITING) {
|
||||
WSREP_DEBUG("kill trx EXITING for %lu", victim_trx->id);
|
||||
|
|
|
@ -396,7 +396,9 @@ lock_wait_suspend_thread(
|
|||
if (lock_wait_timeout < 100000000
|
||||
&& wait_time > (double) lock_wait_timeout) {
|
||||
#ifdef WITH_WSREP
|
||||
if (!wsrep_is_BF_lock_timeout(trx)) {
|
||||
if (!wsrep_on(trx->mysql_thd) ||
|
||||
(!wsrep_is_BF_lock_timeout(trx) &&
|
||||
trx->error_state != DB_DEADLOCK)) {
|
||||
#endif /* WITH_WSREP */
|
||||
|
||||
trx->error_state = DB_LOCK_WAIT_TIMEOUT;
|
||||
|
|
Loading…
Reference in a new issue