Bug #31376 DDL during setup of cluster replication give wrong position
Description:
when during the setup of a cluster replication a create table is done, the create statement is inserted into the binary log but the position according to the documentation is wrong! it points 1 statement after the create table.
so the create table is not done and the following insert fails!
How to repeat:
* Setup 2 clusters (on as master, on as slave) according to: http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-replication-backups.html
* Do a backup of the master cluster
* restore the backup on the slave cluster (ndb_restore -m, 2 x -r, -e)
* get last epoch
| mysql-3312-bin.000007 | 1224 |
* create a table on the master and insert some rows
* finalize the slave (change master to ...)
* start slave:
Last_Errno: 1146
Last_Error: Error 'Table 'test.crash' doesn't exist' on opening table `test`.`crash`
Exec_Master_Log_Pos: 1224
look into binary log:
# at 1123
#7103 17:29:41 server id 12 end_log_pos 1224 Query thread_id=12 exec_time=1 error_code=0
use test/*!*/;
SET TIMESTAMP=1191425381/*!*/;
create table crash (id int) engine=ndb/*!*/;
# at 1224
#7103 17:30:7 server id 12 end_log_pos 1288 Query thread_id=0 exec_time=0 error_code=0
SET TIMESTAMP=1191425407/*!*/;
BEGIN/*!*/;
# at 1288
# at 1332
# at 1394
# at 1453
#7103 17:30:7 server id 12 end_log_pos 1332 Table_map: `test`.`crash` mapped to number 29
#7103 17:30:7 server id 12 end_log_pos 1394 Table_map: `mysql`.`ndb_apply_status` mapped to number 16
#7103 17:30:7 server id 12 end_log_pos 1453 Write_rows: table id 16
#7103 17:30:7 server id 12 end_log_pos 1497 Write_rows: table id 29 flags: STMT_END_F
BINLOG '
f7UDRxMMAAAALAAAADQFAAAAAB0AAAAAAAAABHRlc3QABWNyYXNoAAEDAAE=
f7UDRxMMAAAAPgAAAHIFAAAAABAAAAAAAAAABW15c3FsABBuZGJfYXBwbHlfc3RhdHVzAAUDCA8I
Suggested fix:
the display of the position seems to be wrong
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.075 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.