diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2006-07-08 03:26:13 +0200 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2006-07-08 03:26:13 +0200 |
commit | d0baba61141c6581f661459636c29b90c4f66eac (patch) | |
tree | 6f362287c085d647c2fb2363a8516b38c3beeec3 /sql/ha_ndbcluster_binlog.cc | |
parent | 4e14d3b77f7851eadf905265703795a60e6837e2 (diff) | |
download | mariadb-git-d0baba61141c6581f661459636c29b90c4f66eac.tar.gz |
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)
Diffstat (limited to 'sql/ha_ndbcluster_binlog.cc')
-rw-r--r-- | sql/ha_ndbcluster_binlog.cc | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index 8b04f263b26..8e9f0077dd0 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -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 @@ restart: // 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) |