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 86 87 88 89 90 91 92 93 94 95 96 97
|
--source include/have_multi_ndb.inc
--source include/have_log_bin.inc
#
# This is a duplicate of the index_stat_restart.test. All the ANALYZE
# TABLE statements have been removed and we instead wait for the stats
# to be automatically updated
#
create table t1 (
a int primary key,
b int,
c int,
key t1x1 (b),
key t1x2 (c)
) engine=ndb
partition by key (a) partitions 1;
--let $old_event_count=query_get_value(SHOW STATUS LIKE 'Ndb_index_stat_event_count', Value, 1)
insert into t1 values (1,1,1),(2,1,1),(3,2,1),(4,2,1);
--let $index_stat_db=test
--let $index_stat_name=t1
--source wait_index_stat_cache_updated.inc
# put some entries into index stats cache
select count(*) from t1 where b = 1;
select count(*) from t1 where c = 1;
show status like 'ndb_index_stat_cache%';
--echo # restart cluster --initial
--exec $NDB_MGM -e "all restart -i -n" >> $NDB_TOOLS_OUTPUT
--exec $NDB_WAITER --not-started >> $NDB_TOOLS_OUTPUT
--exec $NDB_MGM -e "all start" >> $NDB_TOOLS_OUTPUT
--exec $NDB_WAITER >> $NDB_TOOLS_OUTPUT
--echo # wait for mysqld
--source include/ndb_not_readonly.inc
# wait for stats thread to re-initialize
--source suite/ndb/include/ndb_index_stat_wait.inc
--error 0,1193
set global ndb_dbg_check_shares=1;
--error 0,1051
drop table if exists t1;
create table t1 (
a int primary key,
b int,
c int,
key t1x1 (b),
key t1x2 (c)
) engine=ndb
partition by key (a) partitions 1;
--let $old_event_count=query_get_value(SHOW STATUS LIKE 'Ndb_index_stat_event_count', Value, 1)
connection server2;
--let $old_event_count2=query_get_value(SHOW STATUS LIKE 'Ndb_index_stat_event_count', Value, 1)
connection server1;
insert into t1 values (1,1,1),(2,1,1),(3,2,1),(4,2,1);
--let $index_stat_db=test
--let $index_stat_name=t1
--source wait_index_stat_cache_updated.inc
# put some entries into index stats cache
select count(*) from t1 where b = 1;
select count(*) from t1 where c = 1;
show status like 'ndb_index_stat_cache%';
connection server2;
--echo Check if events were detected in the other MySQL Server as well
--let $old_event_count=$old_event_count2
--let $index_stat_db=test
--let $index_stat_name=t1
--source wait_index_stat_cache_updated.inc
# put some entries into index stats cache
select count(*) from t1 where b = 1;
select count(*) from t1 where c = 1;
show status like 'ndb_index_stat_cache%';
connection server1;
drop table t1;
# Ignore the warning generated by ndbcluster's binlog thread
# when cluster is restarted
--disable_query_log ONCE
call mtr.add_suppression("cluster disconnect An incident event has been written");
# Ignore the warning generated by ndbcluster's binlog thread
# when cluster is restarted - also on the second mysqld
connection server2;
--disable_query_log ONCE
call mtr.add_suppression("cluster disconnect An incident event has been written");
--remove_file $NDB_TOOLS_OUTPUT
|