Description:
For conflict resolution to work for a table, you need to first insert
an entry in the mysql.ndb_replication for this table before you create it.
However, when you backup the MySQL schema, and restore the schema, the
entries in mysql.ndb_replication will be restored after the CREATE TABLE
statements. This happens whether you are restoring a backup using output
of mysqldump, or restoring a cluster backup using ndb_restore.
This is considered a bug since it isn't possible to actually restore a
backup, however, it is possible to workaround it.
See:
http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-replication-conflict-resolution.html
How to repeat:
(restore a backup, conflict resolution will not work)
Suggested fix:
Introduce a new option to mysqldump which will force dumping the entries
of mysql.ndb_replication so its entreis are inserted right after its creation
and before all other tables are created.
Maybe we could take this further:
mysqldump -d --include-table-data=mysql.ndb_replication.
This would dump all DDL of tables and no data, except for the given
table, in this case mysql.ndb_replication.
Similar to --ignore-table.
The same should work for ndb_restore. Maybe ndb_restore should first
restore ndb_replication, like forcing the order? Or the backup should
dump it first?
Workaround: Make first the backup of mysql.ndb_replication
------------
mysqldump -uroot mysql ndb_replication > mysql_ndb_replication.sql
mysqldump -uroot --no-data --all-databases \
--ignore-table=mysql.ndb_replication > mysql_DDL_all.sql
Or you can simply dump first the mysql database, and then the other
databases.
Point is, first restore mysql.ndb_replication table completely, and then
the other tables.