Debian Codegraph @

mysql-test/suite/ndb_opt/index_stat_restart_auto.test

raw
1 --source include/have_multi_ndb.inc
2 --source include/have_log_bin.inc
3
4 #
5 # This is a duplicate of the index_stat_restart.test. All the ANALYZE
6 # TABLE statements have been removed and we instead wait for the stats
7 # to be automatically updated
8 #
9
10 create table t1 (
11 a int primary key,
12 b int,
13 c int,
14 key t1x1 (b),
15 key t1x2 (c)
16 ) engine=ndb
17 partition by key (a) partitions 1;
18
19 --let $old_event_count=query_get_value(SHOW STATUS LIKE 'Ndb_index_stat_event_count', Value, 1)
20
21 insert into t1 values (1,1,1),(2,1,1),(3,2,1),(4,2,1);
22 --let $index_stat_db=test
23 --let $index_stat_name=t1
24 --source wait_index_stat_cache_updated.inc
25
26 # put some entries into index stats cache
27 select count(*) from t1 where b = 1;
28 select count(*) from t1 where c = 1;
29 show status like 'ndb_index_stat_cache%';
30
31 --echo # restart cluster --initial
32 --exec $NDB_MGM -e "all restart -i -n" >> $NDB_TOOLS_OUTPUT
33 --exec $NDB_WAITER --not-started >> $NDB_TOOLS_OUTPUT
34 --exec $NDB_MGM -e "all start" >> $NDB_TOOLS_OUTPUT
35 --exec $NDB_WAITER >> $NDB_TOOLS_OUTPUT
36
37 --echo # wait for mysqld
38 --source include/ndb_not_readonly.inc
39 # wait for stats thread to re-initialize
40 --source suite/ndb/include/ndb_index_stat_wait.inc
41
42 --error 0,1193
43 set global ndb_dbg_check_shares=1;
44
45 --error 0,1051
46 drop table if exists t1;
47
48 create table t1 (
49 a int primary key,
50 b int,
51 c int,
52 key t1x1 (b),
53 key t1x2 (c)
54 ) engine=ndb
55 partition by key (a) partitions 1;
56
57 --let $old_event_count=query_get_value(SHOW STATUS LIKE 'Ndb_index_stat_event_count', Value, 1)
58 connection server2;
59 --let $old_event_count2=query_get_value(SHOW STATUS LIKE 'Ndb_index_stat_event_count', Value, 1)
60 connection server1;
61
62 insert into t1 values (1,1,1),(2,1,1),(3,2,1),(4,2,1);
63 --let $index_stat_db=test
64 --let $index_stat_name=t1
65 --source wait_index_stat_cache_updated.inc
66
67 # put some entries into index stats cache
68 select count(*) from t1 where b = 1;
69 select count(*) from t1 where c = 1;
70 show status like 'ndb_index_stat_cache%';
71
72 connection server2;
73 --echo Check if events were detected in the other MySQL Server as well
74 --let $old_event_count=$old_event_count2
75 --let $index_stat_db=test
76 --let $index_stat_name=t1
77 --source wait_index_stat_cache_updated.inc
78
79 # put some entries into index stats cache
80 select count(*) from t1 where b = 1;
81 select count(*) from t1 where c = 1;
82 show status like 'ndb_index_stat_cache%';
83 connection server1;
84
85 drop table t1;
86
87 # Ignore the warning generated by ndbcluster's binlog thread
88 # when cluster is restarted
89 --disable_query_log ONCE
90 call mtr.add_suppression("cluster disconnect An incident event has been written");
91
92 # Ignore the warning generated by ndbcluster's binlog thread
93 # when cluster is restarted - also on the second mysqld
94 connection server2;
95 --disable_query_log ONCE
96 call mtr.add_suppression("cluster disconnect An incident event has been written");
97 --remove_file $NDB_TOOLS_OUTPUT