SA Bugzilla – Bug 4632
Deadlock with SQL Bayes
Last modified: 2006-08-01 20:23:29 UTC
(sorry, the "bug writing guidelines" is a dead link...) Platform: WBEL4(RHEL4 clone), Kernel 2.6.9-22 from Redhat. MySQL 4.1.12-3 from Redhat. SA is called from amavisd-new 2.3.3 (dual sendmail setup). MySQL bidirectional replication between two similar boxes is active, rest of setup per docs. I have imported Bayes and AWL from DB files during setup. Tables have been converted to InnoDB. Incoming mail is distributed between the two boxes via equal precedence MX records. Every few hours the deadlock error shows up, mysql then stops replication (see attachement). I then have to fix it manually via "start slave".
Created attachment 3188 [details] output of "show innodb status" (includes offending SQL stmt)
Subject: Re: New: Deadlock with SQL Bayes > >MySQL bidirectional replication between two similar boxes is active, rest of > > By bidirectional, do you mean multi-master? That doesn't work with Bayes. Michael
Subject: Re: Deadlock with SQL Bayes Also, can you please include the error message output from SA. Michael
(In reply to comment #2) > By bidirectional, do you mean multi-master? That doesn't work with Bayes. > > Michael > Hello Michael, can you give me more details on this? Why does it not work? Matthias
Subject: Re: Deadlock with SQL Bayes > >can you give me more details on this? Why does it not work? > > > The primary reason is the fact that Bayes uses auto_increment fields. It's may be possible that there is a deadlock situation though, so I'm not closing the bug. The deadlocks should be detected (which is why I wanted to see the actual SA error msg) and we can do retrying to recover. That doesn't help you get to a master-master setup, it's not possible in 4.X of MySQL. Michael
(In reply to comment #3) > Subject: Re: Deadlock with SQL Bayes > > Also, can you please include the error message output from SA. > > Michael > Hi Michael, unfortunately i have no errormessage directly from SA. SA is called via amavis which has not logged this: amavis[22498]: (22498-01) SA TIMED OUT, backtrace: at /usr/lib/perl5/site_perl/5.8.5/Mail/SpamAssassin/BayesStore/SQL.pm line 252\n\teval {...} called at /usr/lib/perl5/site_perl/5.8.5/Mail/SpamAssassin/BayesStore/SQL.pm line 252\n\tMail::SpamAssassin::BayesStore::SQL::calculate_expire_delta('Mail::SpamAssassin::BayesStore::MySQL=HASH(0xb0306e0)', 1129129868, 43200, 512) called at /usr/lib/perl5/site_perl/5.8.5/Mail/SpamAssassin/BayesStore.pm line 321\n\tMail::SpamAssassin::BayesStore::expire_old_tokens_trapped('Mail::SpamAssassin::BayesStore::MySQL=HASH(0xb0306e0)', 'undef') called at /usr/lib/perl5/site_perl/5.8.5/Mail/SpamAssassin/BayesStore.pm line 214\n\teval {...} called at /usr/lib/perl5/site_perl/5.8.5/Mail/SpamAssassin/BayesStore.pm line 211\n\tMail::SpamAssassin::BayesStore::expire_old_tokens('Mail::SpamAssassin::BayesStore::MySQL=HASH(0xb0306e0)', 'undef') called at /usr/lib/perl5/site_perl/5.8.5/Mail/SpamAss... amavis[32107]: (32107-04) SA TIMED OUT, backtrace: at /usr/lib/perl5/site_perl/5.8.5/Mail/SpamAssassin/BayesStore/MySQL.pm line 973\n\teval {...} called at /usr/lib/perl5/site_perl/5.8.5/Mail/SpamAssassin/BayesStore/MySQL.pm line 973\n\tMail::SpamAssassin::BayesStore::MySQL::_put_tokens('Mail::SpamAssassin::BayesStore::MySQL=HASH(0xb01dd0c)', 'HASH(0xb0b9dd4)', 0, 1, 1129201336) called at /usr/lib/perl5/site_perl/5.8.5/Mail/SpamAssassin/BayesStore/SQL.pm line 963\n\tMail::SpamAssassin::BayesStore::SQL::multi_tok_count_change('Mail::SpamAssassin::BayesStore::MySQL=HASH(0xb01dd0c)', 0, 1, 'HASH(0xb0b9dd4)', 1129201336) called at /usr/lib/perl5/site_perl/5.8.5/Mail/SpamAssassin/Bayes.pm line 806\n\tMail::SpamAssassin::Bayes::learn_trapped('Mail::SpamAssassin::Bayes=HASH(0xb05b574)', 0, 'Mail::SpamAssassin::Message=HASH(0xb760c58)', 'HASH(0xba9a6b4)', 'undef') called at /usr/lib/perl5/site_perl/5.8.5/Mail/SpamAssassin/Bay... amavis[32107]: (32107-04) SA TIMED OUT, backtrace: at /usr/lib/perl5/site_perl/5.8.5/Mail/SpamAssassin/BayesStore/MySQL.pm line 973\n\teval {...} called at /usr/lib/perl5/site_perl/5.8.5/Mail/SpamAssassin/BayesStore/MySQL.pm line 973\n\tMail::SpamAssassin::BayesStore::MySQL::_put_tokens('Mail::SpamAssassin::BayesStore::MySQL=HASH(0xb01dd0c)', 'HASH(0xb0b9dd4)', 0, 1, 1129201336) called at /usr/lib/perl5/site_perl/5.8.5/Mail/SpamAssassin/BayesStore/SQL.pm line 963\n\tMail::SpamAssassin::BayesStore::SQL::multi_tok_count_change('Mail::SpamAssassin::BayesStore::MySQL=HASH(0xb01dd0c)', 0, 1, 'HASH(0xb0b9dd4)', 1129201336) called at /usr/lib/perl5/site_perl/5.8.5/Mail/SpamAssassin/Bayes.pm line 806\n\tMail::SpamAssassin::Bayes::learn_trapped('Mail::SpamAssassin::Bayes=HASH(0xb05b574)', 0, 'Mail::SpamAssassin::Message=HASH(0xb760c58)', 'HASH(0xba9a6b4)', 'undef') called at /usr/lib/perl5/site_perl/5.8.5/Mail/SpamAssassin/Bay... Matthias
Subject: Re: Deadlock with SQL Bayes >unfortunately i have no errormessage directly from SA. SA is called via amavis >which has not logged this: > > I should probably mention at this point that I'm not one to support anything in amavis. It's too difficult and generally not worth the effort, so I find a zero tolerance policy good here. If you can recreate outside amavis or at the very least get a meaningful debug message I'll be happy to look into it. I'm not speaking for everyone, so maybe someone else would be willing to give you a hand. Michael
Not really any usable debug data, if you can provide an example and debug logs of this failing with spamassassin or spamd then feel free to reopen and attach said logs.