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