Skip to content

Commit 82a3784

Browse files
committed
Bug#29949096 ERROR FOR FAILURE TO MIGRATE DURING DISCOVER
No error is set when trying to discover an unsupported(ie. too old) table from NDB. The ndbcluster plugin will just push some warnings and return an error from ndbcluster_discover(). However the calling convention for this function is that an error should be set before returning. This cause a mysqld crash after failure to migrate during discover with fix for BUG#29934763. Earlier the failed discover was retried and the retry caused a different code path to be used which set the error, although lots of duplicated warnings was produced which indicated that something was wrong already at that time. Fix by returning ER_NO_SUCH_TABLE and remove all the duplicated warnings. Change-Id: I66942d027b4d3ffc66ca98c4f8119c68e41fb71f
1 parent aef79e3 commit 82a3784

File tree

7 files changed

+5
-20
lines changed

7 files changed

+5
-20
lines changed

mysql-test/suite/ndb/r/ndb_alter_table_backup.result

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ Level Code Message
88
Warning 1296 Table definition contains obsolete data types such as old temporal or decimal types
99
Warning 1296 Failed to discover table 't1' from NDB, could not upgrade table with extra metadata version 1
1010
Error 1146 Table 'test.t1' doesn't exist
11-
Warning 1296 Table definition contains obsolete data types such as old temporal or decimal types
12-
Warning 1296 Failed to discover table 't1' from NDB, could not upgrade table with extra metadata version 1
1311
*********************************
1412
* restore tables w/ new column from big endian
1513
*********************************
@@ -20,5 +18,3 @@ Level Code Message
2018
Warning 1296 Table definition contains obsolete data types such as old temporal or decimal types
2119
Warning 1296 Failed to discover table 't1' from NDB, could not upgrade table with extra metadata version 1
2220
Error 1146 Table 'test.t1' doesn't exist
23-
Warning 1296 Table definition contains obsolete data types such as old temporal or decimal types
24-
Warning 1296 Failed to discover table 't1' from NDB, could not upgrade table with extra metadata version 1

mysql-test/suite/ndb/r/ndb_dd_restore_compat.result

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ Level Code Message
99
Warning 1296 Table definition contains obsolete data types such as old temporal or decimal types
1010
Warning 1296 Failed to discover table 't1' from NDB, could not upgrade table with extra metadata version 1
1111
Error 1146 Table 'test.t1' doesn't exist
12-
Warning 1296 Table definition contains obsolete data types such as old temporal or decimal types
13-
Warning 1296 Failed to discover table 't1' from NDB, could not upgrade table with extra metadata version 1
1412
SET GLOBAL ndb_metadata_check = @old_ndb_metadata_check;
1513
SET GLOBAL ndb_metadata_check_interval = @old_ndb_metadata_check_interval;
1614
ALTER TABLESPACE ts

mysql-test/suite/ndb/r/ndb_native_default_support.result

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,6 @@ Level Code Message
335335
Warning 1296 Table definition contains obsolete data types such as old temporal or decimal types
336336
Warning 1296 Failed to discover table 't1' from NDB, could not upgrade table with extra metadata version 1
337337
Error 1146 Table 'test.t1' doesn't exist
338-
Warning 1296 Table definition contains obsolete data types such as old temporal or decimal types
339-
Warning 1296 Failed to discover table 't1' from NDB, could not upgrade table with extra metadata version 1
340338
SELECT pk,BIN(b1),BIN(b2),BIN(b3),BIN(b4),BIN(b5) FROM bit1 ORDER BY pk;
341339
pk BIN(b1) BIN(b2) BIN(b3) BIN(b4) BIN(b5)
342340
1 111 101 110 11 101011

mysql-test/suite/ndb/r/ndb_restore_compat_endianness.result

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ Level Code Message
2525
Warning 1296 Table definition contains obsolete data types such as old temporal or decimal types
2626
Warning 1296 Failed to discover table 't_datetime' from NDB, could not upgrade table with extra metadata version 1
2727
Error 1146 Table 'test.t_datetime' doesn't exist
28-
Warning 1296 Table definition contains obsolete data types such as old temporal or decimal types
29-
Warning 1296 Failed to discover table 't_datetime' from NDB, could not upgrade table with extra metadata version 1
3028
SHOW CREATE TABLE t_string_1;
3129
Table Create Table
3230
t_string_1 CREATE TABLE `t_string_1` (
@@ -74,8 +72,6 @@ Level Code Message
7472
Warning 1296 Table definition contains obsolete data types such as old temporal or decimal types
7573
Warning 1296 Failed to discover table 't_datetime' from NDB, could not upgrade table with extra metadata version 1
7674
Error 1146 Table 'test.t_datetime' doesn't exist
77-
Warning 1296 Table definition contains obsolete data types such as old temporal or decimal types
78-
Warning 1296 Failed to discover table 't_datetime' from NDB, could not upgrade table with extra metadata version 1
7975
SELECT t_pk,hex(t_bit),t_tinyint,t_bool,t_smallint,t_mediumint,t_int,t_bigint,t_float,t_double,t_decimal FROM t_num;
8076
t_pk hex(t_bit) t_tinyint t_bool t_smallint t_mediumint t_int t_bigint t_float t_double t_decimal
8177
1 AAAAAAAAAAAAAAAA 125 1 32765 8388606 2147483647 9223372036854775807 1e20 1.0000000000000002e150 331.0000000000000000
@@ -121,8 +117,6 @@ Level Code Message
121117
Warning 1296 Table definition contains obsolete data types such as old temporal or decimal types
122118
Warning 1296 Failed to discover table 't_datetime' from NDB, could not upgrade table with extra metadata version 1
123119
Error 1146 Table 'test.t_datetime' doesn't exist
124-
Warning 1296 Table definition contains obsolete data types such as old temporal or decimal types
125-
Warning 1296 Failed to discover table 't_datetime' from NDB, could not upgrade table with extra metadata version 1
126120
SHOW CREATE TABLE t_string_1;
127121
Table Create Table
128122
t_string_1 CREATE TABLE `t_string_1` (
@@ -170,8 +164,6 @@ Level Code Message
170164
Warning 1296 Table definition contains obsolete data types such as old temporal or decimal types
171165
Warning 1296 Failed to discover table 't_datetime' from NDB, could not upgrade table with extra metadata version 1
172166
Error 1146 Table 'test.t_datetime' doesn't exist
173-
Warning 1296 Table definition contains obsolete data types such as old temporal or decimal types
174-
Warning 1296 Failed to discover table 't_datetime' from NDB, could not upgrade table with extra metadata version 1
175167
SELECT t_pk,hex(t_bit),t_tinyint,t_bool,t_smallint,t_mediumint,t_int,t_bigint,t_float,t_double,t_decimal FROM t_num;
176168
t_pk hex(t_bit) t_tinyint t_bool t_smallint t_mediumint t_int t_bigint t_float t_double t_decimal
177169
1 AAAAAAAAAAAAAAAA 125 1 32765 8388606 2147483647 9223372036854775807 1e20 1.0000000000000002e150 331.0000000000000000

mysql-test/suite/ndb/r/ndb_wl946_post.result

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ Level Code Message
123123
Warning 1296 Table definition contains obsolete data types such as old temporal or decimal types
124124
Warning 1296 Failed to discover table 't1' from NDB, could not upgrade table with extra metadata version 1
125125
Error 1146 Table 'test.t1' doesn't exist
126-
Warning 1296 Table definition contains obsolete data types such as old temporal or decimal types
127-
Warning 1296 Failed to discover table 't1' from NDB, could not upgrade table with extra metadata version 1
128126
set time_zone = default;
129127
select @@session.time_zone;
130128
@@session.time_zone

mysql-test/suite/ndb/r/ndb_wl946_pre.result

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,6 @@ Level Code Message
193193
Warning 1296 Table definition contains obsolete data types such as old temporal or decimal types
194194
Warning 1296 Failed to discover table 't1' from NDB, could not upgrade table with extra metadata version 1
195195
Error 1146 Table 'test.t1' doesn't exist
196-
Warning 1296 Table definition contains obsolete data types such as old temporal or decimal types
197-
Warning 1296 Failed to discover table 't1' from NDB, could not upgrade table with extra metadata version 1
198196
set time_zone = default;
199197
select @@session.time_zone;
200198
@@session.time_zone

sql/ha_ndbcluster.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13465,6 +13465,7 @@ int ndbcluster_discover(handlerton*, THD* thd,
1346513465
// Can't discover, schema distribution is not ready
1346613466
thd_ndb->push_warning("Failed to discover table '%s' from NDB, schema "
1346713467
"distribution is not ready", name);
13468+
my_error(ER_NO_SUCH_TABLE, MYF(0), db, name);
1346813469
DBUG_RETURN(1);
1346913470
}
1347013471

@@ -13477,6 +13478,7 @@ int ndbcluster_discover(handlerton*, THD* thd,
1347713478
{
1347813479
thd_ndb->push_warning("Failed to discover table '%s' from NDB, could not "
1347913480
"get extra metadata", name);
13481+
my_error(ER_NO_SUCH_TABLE, MYF(0), db, name);
1348013482
DBUG_RETURN(1);
1348113483
}
1348213484

@@ -13493,6 +13495,7 @@ int ndbcluster_discover(handlerton*, THD* thd,
1349313495
thd_ndb->push_warning("Failed to discover table '%s' from NDB, could "
1349413496
"not upgrade table with extra metadata version 1",
1349513497
name);
13498+
my_error(ER_NO_SUCH_TABLE, MYF(0), db, name);
1349613499
ndbtab_g.invalidate();
1349713500
free(unpacked_data);
1349813501
DBUG_RETURN(1);
@@ -13513,6 +13516,7 @@ int ndbcluster_discover(handlerton*, THD* thd,
1351313516
thd_ndb->push_warning("Failed to discover table '%s' from NDB, could "
1351413517
"not acquire metadata lock on tablespace '%s'",
1351513518
name, tablespace_name.c_str());
13519+
my_error(ER_NO_SUCH_TABLE, MYF(0), db, name);
1351613520
ndbtab_g.invalidate();
1351713521
free(unpacked_data);
1351813522
DBUG_RETURN(1);
@@ -13529,6 +13533,7 @@ int ndbcluster_discover(handlerton*, THD* thd,
1352913533
// Table existed in NDB but it could not be inserted into DD
1353013534
thd_ndb->push_warning("Failed to discover table '%s' from NDB, could "
1353113535
"not install table in DD", name);
13536+
my_error(ER_NO_SUCH_TABLE, MYF(0), db, name);
1353213537
ndbtab_g.invalidate();
1353313538
free(unpacked_data);
1353413539
DBUG_RETURN(1);

0 commit comments

Comments
 (0)