| 1 |
--source include/have_ndb.inc |
| 2 |
--source include/have_debug.inc |
| 3 |
|
| 4 |
set @save_debug= @@global.debug; |
| 5 |
|
| 6 |
--echo # Test that the schema dist client waits properly |
| 7 |
--echo # for the coordinator to complete the distribution |
| 8 |
--echo # and release all references to the schema object |
| 9 |
|
| 10 |
# Note : Previously a variant of this testcase was used to test |
| 11 |
# how the mysqld handled a particular race condition between the |
| 12 |
# coordinator and the client(Bug#25557263). There is no such race |
| 13 |
# in the new schema distribution protocol and now this test is |
| 14 |
# used to confirm that fact. |
| 15 |
|
| 16 |
--echo # Delay release of ndb_schema_object after coordinator has completed |
| 17 |
set global debug='+d,ndb_delay_schema_obj_release_after_coord_complete'; |
| 18 |
|
| 19 |
--echo # Run DDLs on the same schema objects and verify that they succeed. |
| 20 |
CREATE DATABASE IF NOT EXISTS tmp_db; |
| 21 |
CREATE DATABASE IF NOT EXISTS tmp_db; |
| 22 |
|
| 23 |
--echo # Cleanup |
| 24 |
set global debug= @save_debug; |
| 25 |
DROP DATABASE IF EXISTS tmp_db; |
| 26 |
|
| 27 |
# Bug#32593352 |
| 28 |
# The variable ndb-schema-dist-timeout can only be set when starting MySQL Server. |
| 29 |
# The ndb-schema-dist-timeout value is set low for this test to avoid |
| 30 |
# waiting on test to complete(the value is specified by <testname>.cnf file) |
| 31 |
--echo # |
| 32 |
--echo # Test to check if the Client thread is hung, when the coordinator |
| 33 |
--echo # did not receive the schema operation. |
| 34 |
--echo # |
| 35 |
CREATE TABLE t1 (a INT) ENGINE NDB; |
| 36 |
|
| 37 |
--echo # Now, make the coordinator ignore the schema operation |
| 38 |
set global debug="+d,ndb_schema_op_start_timeout"; |
| 39 |
|
| 40 |
call mtr.add_suppression("Schema dist client detected timeout"); |
| 41 |
call mtr.add_suppression("Failed to distribute"); |
| 42 |
--echo # Execute any DDL on table t1 |
| 43 |
ALTER TABLE t1 ADD b INT; |
| 44 |
|
| 45 |
--echo # Reset coordinator to handle all schema operations |
| 46 |
set global debug="-d,ndb_schema_op_start_timeout"; |
| 47 |
|
| 48 |
--let $assert_text= Verify if ndb_schema_dist_timeout triggered by schema distribution client. |
| 49 |
--let $assert_select= Schema dist client detected timeout |
| 50 |
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.1.err |
| 51 |
--let $assert_count= 1 |
| 52 |
--source include/assert_grep.inc |
| 53 |
|
| 54 |
|
| 55 |
--echo # |
| 56 |
--echo # Test to simulate the case when client thread |
| 57 |
--echo # detects timeout, but before freeing the schema object |
| 58 |
--echo # Coordinator receives the schema event |
| 59 |
--echo # |
| 60 |
|
| 61 |
|
| 62 |
set global debug="+d,ndb_stale_event_with_schema_obj"; |
| 63 |
|
| 64 |
call mtr.add_suppression("Schema dist client detected timeout"); |
| 65 |
call mtr.add_suppression("Distribution of '.*' - client timeout"); |
| 66 |
call mtr.add_suppression("Failed to distribute"); |
| 67 |
--echo # Execute any DDL on table t1 |
| 68 |
ALTER TABLE t1 ADD i INT; |
| 69 |
|
| 70 |
set global debug="-d,ndb_stale_event_with_schema_obj"; |
| 71 |
|
| 72 |
--let $assert_text= Verify that schema distribution client detected timeout |
| 73 |
--let $assert_select= Schema dist client detected timeout |
| 74 |
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.1.err |
| 75 |
--let $assert_count= 2 |
| 76 |
--source include/assert_grep.inc |
| 77 |
|
| 78 |
--let $assert_text= Verify that coordinator received event after client timeout |
| 79 |
--let $assert_select= Coordinator could not register participants |
| 80 |
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.1.err |
| 81 |
--let $assert_count= 1 |
| 82 |
--source include/assert_grep.inc |
| 83 |
|
| 84 |
# Cleanup |
| 85 |
DROP TABLE t1; |