I haven't gone as far as doing a full dump and restore just yet. The imap,pop
and lmtp services are not running on the secondary master so I don't think
they are being accessed. Smtp is running on the secondary master but I have
postfix configured to relay lmtp to the primary master which the logs tell
me it's doing. When the replication does break I run the following command
and the replication seems to catch up.

STOP SLAVE; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;

Does this not necessarily mean that my databases are in sync? Also what do
you use for packet logging? 



Gordan Bobic wrote:
> 
> Larry H. wrote:
>> I have two dbmail 2.2.17 servers using MySQL in a multi-master setup. I
>> only
>> have pop3, imap and lmtp running on the primary master and all incoming
>> mail
>> is received on the primary master. Basically the second master is a hot
>> standby for failover. Every few days the replication breaks and I receive
>> the following error.
>> 
>> Error 'Cannot add or update a child row: a foreign key constraint fails
>> (`dbmail`.`dbmail_messages`, CONSTRAINT `dbmail_messages_ibfk_2` FOREIGN
>> KEY
>> (`mailbox_idnr`) REFERENCES `dbmail_mailboxes` (`mailbox_idnr`) ON DELETE
>> CASCADE)' on query. Default database: 'dbmail'. Query: 'INSERT INTO
>> dbmail_messages (mailbox_idnr,physmessage_id, seen_flag, answered_flag,
>> deleted_flag, flagged_flag, recent_flag, draft_flag, unique_id, status)
>> SELECT 16035, physmessage_id, seen_flag, answered_flag, deleted_flag,
>> flagged_flag, recent_flag, draft_flag,
>> '8f699cfd90680edadf04b114525cb829',
>> status FROM dbmail_messages WHERE message_idnr = 156606921'
>> 
>> My second master is acting as a slave and no data is being sent to the
>> primary master via replication so I'm not sure where this error is coming
>> from. Maybe some type of temp table on the primary master that doesn't
>> make
>> it over to the secondary master? 
> 
> 
> I'm running a very similar setup and haven't seen any such issues. The 
> only things I can think of is that either your databases aren't as 
> in-sync as you think they are to begin with or there is something 
> shifting messages on the backup server (imap client can do that). Are 
> you _sure_ there is nothing accessing the backup server? Have you done a 
> full dump+restore resync and firewalled the smtp/lmtp/pop3/imap ports on 
> the backup with packet logging enabled to double check that nothing is 
> accessing it?
> 
> Gordan
> _______________________________________________
> DBmail mailing list
> [email protected]
> http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Multi-Master-Replication-tp30663509p30663844.html
Sent from the dbmail users mailing list archive at Nabble.com.

_______________________________________________
DBmail mailing list
[email protected]
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail

Reply via email to