Bug #20843 tests fails randomly with assertion in completeClusterFailed

Bug #20902 Alter table invalid schema version with statement-based binlogging
(latter caused by the above)
parent aebbf0ce
......@@ -2,9 +2,6 @@
-- source include/have_multi_ndb.inc
-- source include/not_embedded.inc
# BUG#20902: Test fails in statement-based binlogging mode. Remove when fixed.
-- source include/have_binlog_format_row.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
......
......@@ -2,10 +2,6 @@
-- source include/have_multi_ndb.inc
-- source include/not_embedded.inc
# BUG#20902: Test fails in statement-based binlogging mode. Remove when fixed.
-- source include/have_binlog_format_row.inc
--disable_warnings
drop table if exists t1, t2;
--enable_warnings
......
......@@ -28,9 +28,6 @@
-- source include/have_ndb.inc
-- source include/not_embedded.inc
# BUG#20902: Test fails in statement-based binlogging mode. Remove when fixed.
-- source include/have_binlog_format_row.inc
--disable_warnings
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
......
......@@ -3,10 +3,6 @@
-- source include/not_embedded.inc
-- source include/have_binlog_format_statement.inc
# BUG#20902: Test fails in statement-based binlogging mode. Remove when fixed.
-- source include/have_binlog_format_row.inc
--disable_warnings
connection server2;
drop table if exists t1, t2, t3, t4;
......
......@@ -4781,7 +4781,7 @@ int ha_ndbcluster::create(const char *name,
expect it to be there.
*/
if (!ndbcluster_create_event(ndb, m_table, event_name.c_ptr(), share,
share && do_event_op /* push warning */))
share && do_event_op ? 2 : 1/* push warning */))
{
if (ndb_extra_logging)
sql_print_information("NDB Binlog: CREATE TABLE Event: %s",
......@@ -5175,7 +5175,7 @@ int ha_ndbcluster::rename_table(const char *from, const char *to)
const NDBTAB *ndbtab= ndbtab_g2.get_table();
if (!ndbcluster_create_event(ndb, ndbtab, event_name.c_ptr(), share,
share && ndb_binlog_running /* push warning */))
share && ndb_binlog_running ? 2 : 1/* push warning */))
{
if (ndb_extra_logging)
sql_print_information("NDB Binlog: RENAME Event: %s",
......
......@@ -1220,7 +1220,7 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
type_str= "create table";
break;
case SOT_ALTER_TABLE:
type_str= "create table";
type_str= "alter table";
break;
case SOT_DROP_DB:
type_str= "drop db";
......@@ -2500,7 +2500,7 @@ ndbcluster_create_event(Ndb *ndb, const NDBTAB *ndbtab,
/*
failed, print a warning
*/
if (push_warning)
if (push_warning > 1)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
dict->getNdbError().code,
......@@ -2528,7 +2528,7 @@ ndbcluster_create_event(Ndb *ndb, const NDBTAB *ndbtab,
if (dict->getNdbError().code == NDB_INVALID_SCHEMA_OBJECT &&
dict->dropEvent(my_event.getName()))
{
if (push_warning)
if (push_warning > 1)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
dict->getNdbError().code,
......@@ -2547,7 +2547,7 @@ ndbcluster_create_event(Ndb *ndb, const NDBTAB *ndbtab,
*/
if (dict->createEvent(my_event))
{
if (push_warning)
if (push_warning > 1)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
dict->getNdbError().code,
......@@ -3442,24 +3442,31 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
// wait for the first event
thd->proc_info= "Waiting for first event from ndbcluster";
DBUG_PRINT("info", ("Waiting for the first event"));
int schema_res= 0, res= 0;
Uint64 schema_gci= 0, gci= 0;
while (schema_res == 0 && !abort_loop)
int schema_res, res;
Uint64 schema_gci;
do
{
if (abort_loop)
goto err;
schema_res= s_ndb->pollEvents(100, &schema_gci);
}
// now check that we have epochs consistant with what we had before the restart
DBUG_PRINT("info", ("schema_res: %d schema_gci: %d", schema_res, schema_gci));
if (schema_res > 0)
} while (ndb_latest_received_binlog_epoch == schema_gci);
if (ndb_binlog_running)
{
while (res >= 0 && gci < schema_gci && !abort_loop)
Uint64 gci= i_ndb->getLatestGCI();
while (gci < schema_gci || gci == ndb_latest_received_binlog_epoch)
{
res= i_ndb->pollEvents(100, &gci);
if (abort_loop)
goto err;
res= i_ndb->pollEvents(10, &gci);
}
if (gci > schema_gci)
{
schema_gci= gci;
}
}
// now check that we have epochs consistant with what we had before the restart
DBUG_PRINT("info", ("schema_res: %d schema_gci: %d", schema_res, schema_gci));
{
i_ndb->flushIncompleteEvents(schema_gci);
s_ndb->flushIncompleteEvents(schema_gci);
if (schema_gci < ndb_latest_handled_binlog_epoch)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment