Nick: thanks for the bug report

David & List: please see below - this is a bug report I received on the 
Debian bug tracker.  Summary: BerkeleyDB's behaviour on currupted db files 
is not optimal and may lead to postgrey not starting up properly and 
grabbing the CPU 100%.

Proposed fix: calling db_recover in the init script.  I think that maybe the 
recovery should be included with postgrey itself instead of added-on in the 
init script (all the more so since the init script is only shipped with the 
Debian package, but the problem is in no way Debian specific afaict)?

Please keep the @bugs.d.o address on replies.  Thank you.

greetings
-- vbi


On Monday 17 October 2005 22.30, Nick Moffitt wrote:
> Package: postgrey
> Version: 1.21-1
> Severity: normal
>
>
> Lately my system has noticed runaway postgrey processes.  The symptoms
> are that on startup, the lone postgrey process consumes 80-95% of the
> CPU.  Strace ends with the following:
>
>  open("/var/lib/postgrey/__db.001", O_RDWR|O_LARGEFILE) = 6
>  fcntl64(6, F_SETFD, FD_CLOEXEC)         = 0
>  mmap2(NULL, 16384, PROT_READ|PROT_WRITE, MAP_SHARED, 6, 0) = 0x4056e000
>  close(6)                                = 0
>
> When I ran the strace of postgrey as above, but with --dbdir=/tmp/ it
> started just fine.  Moving all files but the postgrey.db out of
> /var/lib/postgrey also solves the problem.
>
> What appears to have happened is that an emergency reboot caused some of
> the ancillary database files (the log or the __db.00? files) to become
> corrupted in some maner that confused postgrey on startup.
>
> A friend of mine noticed that he used to see this behavior in slapd
> (which is not in Perl) suggesting that this was a berkeleydb problem.
> Poking in his slapd init scripts he found the following:
>
> 12:14 <npmr> i noticed that as of sarge, the openldap initscript runs
>               db4.2-recover before starting the daeon
> 12:15 <npmr> looks like there's a try_fix_db bash function in there
> 12:15 <npmr> about a page of code
> 12:15 <npmr> very tidy looking
> 12:15 <npmr> and then this in the start) clause:
> 12:15 <npmr>         if [ "$TRY_BDB_RECOVERY" = "yes" ]; then
> 12:15 <npmr>                 try_fix_db
> 12:15 <npmr>         fi
>
> It may be helpful to try this technique in postgrey's init scripts.


-- 
Don't let the computer bugs bite!

Attachment: pgpZVkmqWxvj0.pgp
Description: PGP signature

Reply via email to