|
| 1 | +--source include/have_ndb.inc |
| 2 | + |
| 3 | +# |
| 4 | +# Setup |
| 5 | +# |
| 6 | +let $ndb_mgm_cmd = $NDB_MGM --no-defaults --verbose=0; |
| 7 | +let $ndb_waiter_cmd = $NDB_WAITER --no-defaults; |
| 8 | + |
| 9 | +# |
| 10 | +# Create test table |
| 11 | +# |
| 12 | +create table t1(a int primary key, b int) engine = ndb; |
| 13 | +insert into t1 values (1, 2); |
| 14 | + |
| 15 | +# |
| 16 | +# Restart node 1 |
| 17 | +# |
| 18 | +--exec $ndb_mgm_cmd -e "1 RESTART" |
| 19 | +--exec $ndb_waiter_cmd --nowait-nodes=2 --not-started > /dev/null |
| 20 | +--exec $ndb_mgm_cmd -e "1 START" |
| 21 | +--exec $ndb_waiter_cmd > /dev/null |
| 22 | + |
| 23 | +# Check table is still there |
| 24 | +select * from t1 order by a; |
| 25 | +insert into t1 values (2, 3); |
| 26 | + |
| 27 | +# |
| 28 | +# Restart node 1 --initial |
| 29 | +# |
| 30 | +--exec $ndb_mgm_cmd -e "1 RESTART -I" |
| 31 | +--exec $ndb_waiter_cmd --nowait-nodes=2 --not-started > /dev/null |
| 32 | +--exec $ndb_mgm_cmd -e "1 START" |
| 33 | +--exec $ndb_waiter_cmd > /dev/null |
| 34 | + |
| 35 | +# Check table is still there |
| 36 | +select * from t1 order by a; |
| 37 | +insert into t1 values (3, 4); |
| 38 | + |
| 39 | +# |
| 40 | +# Restart all |
| 41 | +# |
| 42 | +--exec $ndb_mgm_cmd -e "ALL RESTART -N" |
| 43 | +--exec $ndb_waiter_cmd --not-started > /dev/null |
| 44 | +--exec $ndb_mgm_cmd -e "ALL START" |
| 45 | +--exec $ndb_waiter_cmd > /dev/null |
| 46 | + |
| 47 | +# Wait for mysqld to reconnect |
| 48 | +--disable_result_log |
| 49 | +--disable_query_log |
| 50 | +--source include/ndb_not_readonly.inc |
| 51 | +--enable_result_log |
| 52 | +--enable_query_log |
| 53 | + |
| 54 | +# Check table is still there |
| 55 | +select * from t1 order by a; |
| 56 | +insert into t1 values (4, 5); |
| 57 | + |
| 58 | +# |
| 59 | +# Restart all initial |
| 60 | +# |
| 61 | +--exec $ndb_mgm_cmd -e "ALL RESTART -N -I" |
| 62 | +--exec $ndb_waiter_cmd --not-started > /dev/null |
| 63 | +--exec $ndb_mgm_cmd -e "ALL START" |
| 64 | +--exec $ndb_waiter_cmd > /dev/null |
| 65 | + |
| 66 | +# Wait for mysqld to reconnect |
| 67 | +--disable_result_log |
| 68 | +--disable_query_log |
| 69 | +--source include/ndb_not_readonly.inc |
| 70 | +--enable_result_log |
| 71 | +--enable_query_log |
| 72 | + |
| 73 | +# Check table is gone |
| 74 | +--error ER_NO_SUCH_TABLE |
| 75 | +select * from t1; |
| 76 | + |
0 commit comments