6 messages in com.mysql.lists.mysqlRe: inconsistent replication?
FromSent OnAttachments
PaginaDeSpud28 Dec 2005 13:37 
AESYS S.p.A. [Enzo Arlati]28 Dec 2005 23:34 
pw...@post4.tele.dk29 Dec 2005 00:00 
AESYS S.p.A. [Enzo Arlati]29 Dec 2005 00:13 
Gleb Paharenko29 Dec 2005 08:48 
Atle Veka29 Dec 2005 11:01 
Subject:Re: inconsistent replication?
From:Gleb Paharenko (gleb@ensita.net)
Date:12/29/2005 08:48:27 AM
List:com.mysql.lists.mysql

Hello.

For auto_increment columns MySQL sets in the binary logs INSERT_ID variable, research binary and relay logs and check if it is set to the same value. Is it possible that you forgot to change the master_log_pos and master_log_file after copying the data to the slave?

PaginaDeSpud wrote:

Hi, Some hours ago i setup the replication for my cluster and it's the third time i need to reset the replication and copy the whole database from master to slave due to errors like this:

051228 17:13:35 [ERROR] Slave: Error 'Duplicate entry '9947776' for key 1' on query. Default database: 'genteya'. Query: 'INSERT INTO `comentarios` (id, idcom, nickcom, comentario, reply, ip, fecha) VALUES ('84600', '264452', 'cipr22valencia', 'graias por los puntitos cielo pero si hay algo que me gustaria mas que salir en primera paguina es conocerte mas jijiji aver si te veo por mi *** o me das el tuyo un kiss y toma+++ puntitos ', 'S', '81.202.240.73', '1135811423')', Error_code: 1062 051228 17:13:35 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.000004' position 184226200

I don't know why, but primary keys are inserted in slave with different (autoincrement) numbers than master, and replication shut down in slave.

CREATE TABLE `comentarios` ( `index` int(25) NOT NULL auto_increment, `id` int(9) NOT NULL default '0', `idcom` int(9) NOT NULL default '0', `nickcom` varchar(15) NOT NULL default '', `comentario` text NOT NULL, `reply` char(1) NOT NULL default '', `ip` varchar(15) NOT NULL default '', `fecha` bigint(20) NOT NULL default '0', PRIMARY KEY (`index`), KEY `idcom` (`idcom`), KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1

Any idea?

Thanks.

Ivan Lopez. Logosur.