Addtion for README.db

Matthias Andree matthias.andree at gmx.de
Tue Nov 30 04:59:10 CET 2004


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

>> ...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.
>
> No it does not.

I have seen this on log removal even without Berkeley DB upgrade.
I don't know the exact reason.

> On this system using the the procedure I outlined in the addition to
> README. after upgrade to db4.3 __db.NNN, 1-5 and log.NNNNNNNNNN 1 and
> 2 as well as lockfile are created.

> cd ~./bogofilter
> run db43_recover
> No errors occur and and all __db.NNN files are removed, log and lockfile
> are still present.
> At next run bogofilter creates __db.NNN, 1-5 and the additional
> log.NNNNNNNNNN 3 and 4.

Right. However, bogofilter, as written in the previous mail, uses
DB_NOSYNC when closing the database, so the .db files are flushed
asynchronously (it's sufficient to flush the log.* synchronously) - so
there is potential for data loss when one of the active log files is
removed before recovery can propagate the changes back into the database
file, should the system crash in between.

> As I maintain the Mdk rpm for bogofilter I need a procedure that I can
> document that a user can follow when a db4.3 bogofilter is installed 
> to an env containing a a db4.2 ~./bogofilter.

The user _must_ run a db4.2 recovery before upgrading to a db4.3
bogofilter.


Here's the new section 2.6:
---------------------------

2.6 Updating Berkeley DB version underneath bogofilter

When upgrading the Berkeley DB library to a new version, or recompiling
bogofilter to use a newer version, two things in the on-disk data format
can change, generally speaking: the database format (we use the BTree
access method), the log file format, or both.

If you've been using Berkeley DB 3.0 (only supported with bogofilter
versions 0.17.2 and older) and are about to update to any newer 3.X or
4.X version, you need a database format upgrade. You can either:
- dump the wordlists to a text file, then update Berkeley DB
  and bogofilter, then load the wordlists again;
or
- use the db_upgrade utility to upgrade the databases in place
  (this is dangerous and must not be interrupted, backup first!)

You need a "log file upgrade" if at least one of these conditions is
true:

- you upgraded Berkeley DB from a 3.X version to a 4.Y version
- you upgraded Berkeley DB from 4.0 or 4.1 to 4.2 or 4.3
- you upgraded Berkeley DB from 4.2 to 4.3.

If you need a log file upgrade, the upgrade procedure is
(NOTE: DO NOT UPGRADE BERKELEY DB OR BOGOFILTER UNTIL STEP 4!)

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.


-- 
Matthias Andree



More information about the bogofilter-dev mailing list