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

Reply via email to