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 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
|
-- source include/have_ndb.inc
-- source include/have_debug.inc
#############################################################
# Bug#34733051
# SQL NODE FAILS TO START AFTER RESTORE BY NDB_RESTORE
#
# If a mysqld node is started after a NDB node restore from initial
# from which new table ids were generated, then the util tables (ndb_*)
# definition will be dropped from the mysql data dictionary when their
# new table id (NDB) does not match with the existing data dictionary
# storage engine id (ndbcluster-<id>). It is recreated thus.
#
# The recreation process can clash with an existing definition, that
# hasn't yet been dropped, therefore preventing the binlog setup to
# successfully end.
#
# Since it is NDB who dictates the ids that are attributed to each table,
# forcefully drop ndbcluster-<id> definitions that can clash with the
# table that is being installed.
#
#############################################################
--echo
--echo Testing for Bug#34733051: SQL node fails to start after ndb_restore
--echo =============================================================================
-- disable_query_log
call mtr.add_suppression("mysqld startup An incident event has been written");
-- enable_query_log
# Create tables to help shuffle the data dictionary
CREATE TABLE t1 (a int primary key, b blob) ENGINE = NDB;
CREATE TABLE t2 (a int primary key, b blob) ENGINE = NDB;
CREATE TABLE t3 (a int primary key, b blob) ENGINE = NDB;
CREATE TABLE t4 (a int primary key, b blob) ENGINE = NDB;
-- save_master_pos
# start mysqld with shuffle
-- let $mysqld_name=mysqld.1.1
-- let $do_not_echo_parameters= 0
-- let $restart_parameters= restart: --debug=d,ndb_dd_shuffle_ids,ndb_dd_dump
-- source include/restart_mysqld.inc
# find shuffle message but successful binlog startup
-- let $assert_text= Shuffle of se-private-id on DD
-- let $assert_select= ndb_.*: .* -> .*
-- let $assert_only_after= Detected a normal system restart
-- let $assert_match= ndb_.*: .* -> .*
-- let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.1.err
-- source include/assert_grep.inc
-- let $assert_text= Successful Binlog startup
-- let $assert_select= Binlog: Startup and setup completed
-- let $assert_only_after= ndb_.*: .* -> .*
-- let $assert_match= Binlog: Startup and setup completed
-- source include/assert_grep.inc
-- echo # Check that binlog is working doing some operations
ALTER TABLE t1 ADD COLUMN c VARCHAR(8), ALGORITHM=COPY;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE t4;
-- save_master_pos
#############################################################
# Bug#34876468
# Missing ndb_schema UUID
#
# If a mysqld node is started after a NDB node start initial from
# which a backup was restored, the ndb_schema table will be empty.
# Since mysqld NDB plugin code uses the UUID stored in the data
# dictionary side of the mysqld table definition to compare with the
# UUID stored in the query column of `ndb_schema`, if the NDB table
# is empty then mysqld should view this as an initial system restart.
# This includes recreating the NDB table definition and synchronize
# it with the data dictionary private fields (more specifically,
# `se_private_data`).
#
#############################################################
--echo
--echo Testing for Bug#34876468: Missing ndb_schema UUID
--echo =============================================================================
-- disable_query_log
call mtr.add_suppression("Detected an empty ndb_schema table in NDB");
call mtr.add_suppression("mysqld startup An incident event has been written");
-- enable_query_log
-- echo # Delete all rows from ndb_schema
# start mysqld to drop all ndb_schema data
-- let $mysqld_name=mysqld.1.1
-- let $do_not_echo_parameters= 0
-- let $restart_parameters= restart: --debug=d,ndb_schema_no_uuid
-- source include/restart_mysqld.inc
# find empty ndb_schema table in NDB message
-- let $assert_text= Empty ndb_schema table
-- let $assert_select= Detected an empty ndb_schema table in NDB
-- let $assert_match= Detected an empty ndb_schema table in NDB
-- let $assert_count=
-- let $assert_only_after= NDB Binlog: Detected server start
-- let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.1.err
-- source include/assert_grep.inc
-- let $assert_text= Generated new UUID
-- let $assert_select= Generated new schema UUID .*
-- let $assert_match= Generated new schema UUID .*
-- let $assert_only_after= .*Detected an empty ndb_schema table in NDB.*
-- source include/assert_grep.inc
-- echo # Check everything works
CREATE TABLE t1 (a int primary key, b blob) ENGINE = NDB;
-- save_master_pos
DROP TABLE t1;
-- let $restart_parameters=
--source include/restart_mysqld.inc
|