Description:
a modified version of rpl_ndb_circular_2ch after applying fixes for
http://lists.mysql.com/commits/64067
http://lists.mysql.com/commits/64068
fails in 6.0-rpl tree.
Trying to narrow down a possible issue it was found out that some number of inserts
through one of connection to the master clusters like
let $counter= 30;
while ($counter) {
--connection master1
INSERT INTO t1(b,c) VALUES('master1',2);
dec $counter;
}
eventually hit
ERROR 1022 (23000): Can't write; duplicate key in table ''
Appling the aforementioned patches to rpl_ndb_circular_2ch.{cnf,test}
and executing the test gets:
CURRENT_TEST: rpl_ndb.rpl_ndb_circular_2ch
mysqltest: At line 107: query 'COMMIT' failed: 1022: Can't write; duplicate key in table
''
I assume this is rather the cluster problem than cluster-replication, because
in the quoted loop there is only one connection that is active. Nothing is being
applying on the master's mysqld through replication while the loop executes. The test
code should rule out that possibility as well as my visual check of the relay-log files.
Replication is somehow involved, moreover it should be circular. my testing with one-way
master->slave did not reveal anything.
How to repeat:
See the attached files rpl_ndb_x.{cnf,test}. Or apply the aforementioned patches to
rpl_ndb_circular_2ch.{cnf,test} and run it
./mtr --mysqld=--binlog-format=row --no-check-testcase --no-warnings test
to see
mysqltest: At line 97: query 'INSERT INTO t1(b,c) VALUES('master1',2)' failed: 1022:
Can't write; duplicate key in table ''
for rpl_ndb_x.test.
or
mysqltest: At line 107: query 'COMMIT' failed: 1022: Can't write; duplicate key in table
''
for rpl_ndb_circular_2ch
To ease catching the exact INSERT that fails I suggest to uncomment --sleep left
right atop of the loop in rpl_ndb_x.test, fire a connection to the second mysqld of the
master cluster, execute first queries
SET auto_increment_offset = 1; SET auto_increment_increment = 2;
and then start inserting as the referred loop does.
It took about 24 to 25 for me to get to the dup error.