Bug 4632 - Deadlock with SQL Bayes
Summary: Deadlock with SQL Bayes
Status: RESOLVED WONTFIX
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamassassin (show other bugs)
Version: 3.1.0
Hardware: PC Linux
: P5 normal
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-13 04:00 UTC by Matthias Weigel
Modified: 2006-08-01 20:23 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status
output of "show innodb status" (includes offending SQL stmt) text/plain None Matthias Weigel [NoCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Weigel 2005-10-13 04:00:45 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".
Comment 1 Matthias Weigel 2005-10-13 04:05:50 UTC
Created attachment 3188 [details]
output of "show innodb status" (includes offending SQL stmt)
Comment 2 Michael Parker 2005-10-13 07:14:37 UTC
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
Comment 3 Michael Parker 2005-10-13 07:17:30 UTC
Subject: Re:  Deadlock with SQL Bayes

Also, can you please include the error message output from SA.

Michael
Comment 4 Matthias Weigel 2005-10-13 08:27:32 UTC
(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
Comment 5 Michael Parker 2005-10-13 08:39:13 UTC
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


Comment 6 Matthias Weigel 2005-10-13 08:51:44 UTC
(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
Comment 7 Michael Parker 2005-10-13 08:58:59 UTC
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


Comment 8 Michael Parker 2006-08-02 03:23:29 UTC
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.