Addtion for README.db

Matthias Andree matthias.andree at gmx.de
Tue Nov 30 03:43:43 CET 2004


Charles A Edwards <eslrahc at bellsouth.net> writes:

> "You MUST NOT remove files named __db.NNN and log.NNNNNNNNNN - where
> NNN are numbers - in the ~/.bogofilter directory.
> REMOVING THESE FILES CAUSES DATA BASE CORRUPTION
> (there is one exception, see below)"
>
> Exception 2: If the version of Berkeley DB being used to build
> bogofilter is updated, (i.e. 4.2 to 4.3) and ~/.bogofilter using 
> __db.NNN and log.NNNNNNNNNN was in existence PRIOR to the upgrade 
> the following type error may be seen when bogofilter is run.

Hi Charles!

First of all, thanks for your contribution.

Unfortunately, your exception 2 does not apply and can cause data
corruption.

Bogofilter passes DB_NOSYNC to DB->close for speed (unless logging is
switched off or diverted to memory from DB_CONFIG), because the changes
are all in the log, hence removing the log files can cause
corruption. The proper way to upgrade is now documented in the new
section 2.6 of README.db, we now provide

        bogoutil --remove-environment DIR

to remove the environment as needed for a Berkeley DB upgrade.
The instructions now contain this section:

+ 1. shut down your mail system,
+ 2. run bogoutil --remove-environment ~/.bogofilter (for each user)
+    (this implies running forced recovery first)
+ 3. archive the database for catastrophic recovery (take a backup)
+ 4. install the new Berkeley DB version, recompile bogofilter (unless
+    using a binary package), install the new bogofilter
+ 5. restart your mail system.


> Should this occur remove all files in ~/.bogofilter EXCEPT wordlist.db.
> Bogofilter will create the corrrect __db.NNN, log.NNNNNNNNNN and
> lockfiles automatically the next time it is run.

...and is 100% sure to complain about out-of-order log-sequence numbers
(LSN) next time recovery is attempted -- which will cause a permanent
PANIC state that can only be recovered with a raw db_dump of the
database (possibly in salvage mode, db_dump -r) and reload.

I have spent a bit of time with the removal of the environment, so we
can support upgrading Berkeley DB without data loss or dump/reload.

Keep sending those suggestions though!

-- 
Matthias Andree



More information about the bogofilter-dev mailing list