| 1 |
--source include/have_debug.inc |
| 2 |
# This test crashes MySQL Server on purpose. |
| 3 |
--source include/not_valgrind.inc |
| 4 |
--source include/not_crashrep.inc |
| 5 |
|
| 6 |
# Connect to all |
| 7 |
--source connect.inc |
| 8 |
|
| 9 |
# The variable ndb-schema-dist-timeout controls how long it takes before |
| 10 |
# ndbcluster detects that a participant has not replied properly. The variable |
| 11 |
# can only be set when starting MySQL Server. |
| 12 |
|
| 13 |
# The ndb-schema-dist-timeout value should be set low for this test to avoid |
| 14 |
# waiting on test to complete(the value is specified by <testname>.cnf file) |
| 15 |
--echo # Current value of ndb-schema-dist-timeout |
| 16 |
select @@ndb_schema_dist_timeout; |
| 17 |
|
| 18 |
# Check that variable is readonly |
| 19 |
--error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 20 |
set @@ndb_schema_dist_timeout = 120; |
| 21 |
|
| 22 |
--echo # |
| 23 |
--echo # Test participant timeout during schema operation |
| 24 |
--echo # |
| 25 |
|
| 26 |
CREATE TABLE t1( |
| 27 |
a int primary key |
| 28 |
) engine = NDB; |
| 29 |
|
| 30 |
--echo # Setup participant to timeout when schema operation starts |
| 31 |
connection mysqld6; |
| 32 |
set GLOBAL debug="+d,ndb_schema_op_start_timeout"; |
| 33 |
|
| 34 |
--echo # Expect warning printed on node where schema operation is started |
| 35 |
connection mysqld1; |
| 36 |
call mtr.add_suppression("Schema dist coordinator detected timeout"); |
| 37 |
|
| 38 |
--echo # Run schema operation to trigger participant timeout |
| 39 |
--replace_regex /Node [0-9]+:/Node <nodeid>/ |
| 40 |
ALTER TABLE t1 ALGORITHM=copy, ADD COLUMN b int; |
| 41 |
|
| 42 |
--echo # Reset participant to not timeout anymore |
| 43 |
connection mysqld6; |
| 44 |
set GLOBAL debug="-d,ndb_schema_op_start_timeout"; |
| 45 |
|
| 46 |
--echo # Check that schema operation suceeded on another MySQL Server |
| 47 |
connection mysqld2; |
| 48 |
SELECT * FROM t1; |
| 49 |
|
| 50 |
DROP TABLE t1; |