Debian Codegraph @

mysql-test/suite/ndb_binlog/t/ndb_binlog_setup_fail.test

raw
1 -- source include/have_ndb.inc
2 -- source include/have_debug.inc
3
4 #############################################################
5 # Bug#34733051
6 # SQL NODE FAILS TO START AFTER RESTORE BY NDB_RESTORE
7 #
8 # If a mysqld node is started after a NDB node restore from initial
9 # from which new table ids were generated, then the util tables (ndb_*)
10 # definition will be dropped from the mysql data dictionary when their
11 # new table id (NDB) does not match with the existing data dictionary
12 # storage engine id (ndbcluster-<id>). It is recreated thus.
13 #
14 # The recreation process can clash with an existing definition, that
15 # hasn't yet been dropped, therefore preventing the binlog setup to
16 # successfully end.
17 #
18 # Since it is NDB who dictates the ids that are attributed to each table,
19 # forcefully drop ndbcluster-<id> definitions that can clash with the
20 # table that is being installed.
21 #
22 #############################################################
23
24 --echo
25 --echo Testing for Bug#34733051: SQL node fails to start after ndb_restore
26 --echo =============================================================================
27
28 -- disable_query_log
29 call mtr.add_suppression("mysqld startup An incident event has been written");
30 -- enable_query_log
31
32 # Create tables to help shuffle the data dictionary
33 CREATE TABLE t1 (a int primary key, b blob) ENGINE = NDB;
34 CREATE TABLE t2 (a int primary key, b blob) ENGINE = NDB;
35 CREATE TABLE t3 (a int primary key, b blob) ENGINE = NDB;
36 CREATE TABLE t4 (a int primary key, b blob) ENGINE = NDB;
37 -- save_master_pos
38
39 # start mysqld with shuffle
40 -- let $mysqld_name=mysqld.1.1
41 -- let $do_not_echo_parameters= 0
42 -- let $restart_parameters= restart: --debug=d,ndb_dd_shuffle_ids,ndb_dd_dump
43 -- source include/restart_mysqld.inc
44
45 # find shuffle message but successful binlog startup
46 -- let $assert_text= Shuffle of se-private-id on DD
47 -- let $assert_select= ndb_.*: .* -> .*
48 -- let $assert_only_after= Detected a normal system restart
49 -- let $assert_match= ndb_.*: .* -> .*
50 -- let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.1.err
51 -- source include/assert_grep.inc
52
53 -- let $assert_text= Successful Binlog startup
54 -- let $assert_select= Binlog: Startup and setup completed
55 -- let $assert_only_after= ndb_.*: .* -> .*
56 -- let $assert_match= Binlog: Startup and setup completed
57 -- source include/assert_grep.inc
58
59 -- echo # Check that binlog is working doing some operations
60 ALTER TABLE t1 ADD COLUMN c VARCHAR(8), ALGORITHM=COPY;
61 DROP TABLE t1;
62 DROP TABLE t2;
63 DROP TABLE t3;
64 DROP TABLE t4;
65 -- save_master_pos
66
67 #############################################################
68 # Bug#34876468
69 # Missing ndb_schema UUID
70 #
71 # If a mysqld node is started after a NDB node start initial from
72 # which a backup was restored, the ndb_schema table will be empty.
73 # Since mysqld NDB plugin code uses the UUID stored in the data
74 # dictionary side of the mysqld table definition to compare with the
75 # UUID stored in the query column of `ndb_schema`, if the NDB table
76 # is empty then mysqld should view this as an initial system restart.
77 # This includes recreating the NDB table definition and synchronize
78 # it with the data dictionary private fields (more specifically,
79 # `se_private_data`).
80 #
81 #############################################################
82
83 --echo
84 --echo Testing for Bug#34876468: Missing ndb_schema UUID
85 --echo =============================================================================
86
87 -- disable_query_log
88 call mtr.add_suppression("Detected an empty ndb_schema table in NDB");
89 call mtr.add_suppression("mysqld startup An incident event has been written");
90 -- enable_query_log
91
92 -- echo # Delete all rows from ndb_schema
93 # start mysqld to drop all ndb_schema data
94 -- let $mysqld_name=mysqld.1.1
95 -- let $do_not_echo_parameters= 0
96 -- let $restart_parameters= restart: --debug=d,ndb_schema_no_uuid
97 -- source include/restart_mysqld.inc
98
99 # find empty ndb_schema table in NDB message
100 -- let $assert_text= Empty ndb_schema table
101 -- let $assert_select= Detected an empty ndb_schema table in NDB
102 -- let $assert_match= Detected an empty ndb_schema table in NDB
103 -- let $assert_count=
104 -- let $assert_only_after= NDB Binlog: Detected server start
105 -- let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.1.err
106 -- source include/assert_grep.inc
107
108 -- let $assert_text= Generated new UUID
109 -- let $assert_select= Generated new schema UUID .*
110 -- let $assert_match= Generated new schema UUID .*
111 -- let $assert_only_after= .*Detected an empty ndb_schema table in NDB.*
112 -- source include/assert_grep.inc
113
114 -- echo # Check everything works
115 CREATE TABLE t1 (a int primary key, b blob) ENGINE = NDB;
116 -- save_master_pos
117 DROP TABLE t1;
118
119 -- let $restart_parameters=
120 --source include/restart_mysqld.inc