| 1 |
# First test, check behaviour with --ndb-log-fail-terminate=1 |
| 2 |
# during metadata synchronization |
| 3 |
# - Create table |
| 4 |
# - Setup mysqld2 with DBUG error to force "binlog setup" failure |
| 5 |
# - Setup mtr.pl to expect mysqld2 to shutdown |
| 6 |
# - Use DUMP 900 to disconnect both mysqld's (node 16 and 49) |
| 7 |
# - The mysqld2 will disconnect and then shut itself down when |
| 8 |
# hitting the DBUG error during metadata sync |
| 9 |
# - Start mysqld2 again and check things work |
| 10 |
create table t1 (a int primary key) engine=ndb; |
| 11 |
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); |
| 12 |
# Setup mysqld2 DBUG |
| 13 |
# NOTE! since the process will restart there is no need to save value |
| 14 |
set global debug='+d,ndb_binlog_fail_setup'; |
| 15 |
# Write file to make mtr.pl expect mysqld2 shutdown, but don't start |
| 16 |
# until it's told to |
| 17 |
# Disconnect both mysqld's with DUMP 900 |
| 18 |
# Wait for mysqld2 binlog rotate to indicate disconnect |
| 19 |
# Wait for mysqld1 to reconnect and insert data to check it's alive |
| 20 |
insert into t1 values (11); |
| 21 |
# Wait for mysqld2 to disconnect |
| 22 |
# mysqld2 disconnected |
| 23 |
# Write file to make mtr.pl start up mysqld2 again |
| 24 |
# Wait for mysqld2 to reconnect and insert data to check it's alive |
| 25 |
insert into t1 values (10); |
| 26 |
drop table t1; |
| 27 |
# Second test, check behaviour with --ndb-log-fail-terminate=1 |
| 28 |
# during CREATE TABLE |
| 29 |
# - Setup mysqld2 with DBUG error to force "binlog setup" failure |
| 30 |
# - Setup mtr.pl to expect mysqld2 to shutdown |
| 31 |
# - Create table on mysqld1 |
| 32 |
# - mysqld2 will fail during schema distribution and shut itself down |
| 33 |
# - Start mysqld2 again and check things work |
| 34 |
# Setup mysqld2 DBUG |
| 35 |
# NOTE! since the process will restart there is no need to save value |
| 36 |
set global debug='+d,ndb_binlog_fail_setup'; |
| 37 |
# Write file to make mtr.pl expect mysqld2 shutdown, but don't start |
| 38 |
# until it's told to |
| 39 |
# Create table from mysqld1 |
| 40 |
create table t1 (a int primary key) engine=ndb; |
| 41 |
Warnings: |
| 42 |
Warning 1296 Node 16: 'Distribution of CREATE TABLE 't1' failed' |
| 43 |
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); |
| 44 |
# Wait for mysqld2 diconnect |
| 45 |
# mysqld2 disconnected |
| 46 |
# Write file to make mtr.pl start up mysqld2 again |
| 47 |
# Wait for mysqld2 to reconnect and insert data to check it's alive |
| 48 |
insert into t1 values (10); |
| 49 |
insert into t1 values (11); |
| 50 |
drop table t1; |
| 51 |
set GLOBAL debug="+d,ndb_binlog_fail_setup_util_table"; |
| 52 |
include/assert_grep.inc [No error log printed when binlog setup fails] |
| 53 |
set GLOBAL debug="-d,ndb_binlog_fail_setup_util_table"; |