DB_VERSION_MISMATCH

David Relson relson at osagesoftware.com
Sun Jan 16 18:26:25 CET 2005


Matthias,

We have a problem.  

A database environment created with db-4.2.x can't be used with
db-4.3.x.

### beginning of test script ####

#!/bin/sh -x

TEST_DIR="test.version.mismatch.d"

# bogoutil linked with db-4.2 and db-4.3:
~/bin/bogoutil-db-4.2-yes -V
~/bin/bogoutil-db-4.3-yes -V

mkdir $TEST_DIR

# create wordlist using db-4.2
echo this is a test | ~/bin/bogoutil-db-4.2-yes -l $TEST_DIR

# dump wordlist using db-4.3
~/bin/bogoutil-db-4.3-yes -d $TEST_DIR

rm -rf $TEST_DIR

### output of test script ####

[relson at osage src]$ DB_VERSION_MISMATCH.sh
+ TEST_DIR=test.version.mismatch.d
+ /home/relson/bin/bogoutil-db-4.2-yes -V
bogoutil version 0.93.4.cvs
    Database: Sleepycat Software: Berkeley DB 4.2.52: (December  3, 2003)
Copyright (C) 2002-2004 Gyepi Sam, David Relson, Matthias Andree
...

+ /home/relson/bin/bogoutil-db-4.3-yes -V
bogoutil version 0.93.4.cvs
    Database: Sleepycat Software: Berkeley DB 4.3.21: (November  8, 2004)
Copyright (C) 2002-2004 Gyepi Sam, David Relson, Matthias Andree
...

+ mkdir test.version.mismatch.d
+ echo this is a test
+ /home/relson/bin/bogoutil-db-4.2-yes -l test.version.mismatch.d
+ /home/relson/bin/bogoutil-db-4.3-yes -d test.version.mismatch.d
Program version 4.3 doesn't match environment version
bogoutil: DB_ENV->open, err: DB_VERSION_MISMATCH: Database environment version mismatch
+ rm -rf test.version.mismatch.d

### Additional test -- fix with db-prune ###

[relson at osage src]$ bogoutil-db-4.3-yes --db-prune tst.0116.d
Program version 4.3 doesn't match environment version
Skipping log file tst.0116.d/log.0000000001: historic log version 8
tst.0116.d/log.0000000002: log file open failed: No such file or directory
PANIC: No such file or directory
DB_ENV->log_put: 2: DB_RUNRECOVERY: Fatal error, run database recovery
bogoutil: Error closing environment "tst.0116.d": DB_RUNRECOVERY: Fatal error, run database recovery

### Here's the db-4.3.21 code ###
### /usr/src/db-4.3.21.NC/env/env_region.c

	/* Make sure the region matches our build. */
	if (renv->majver != DB_VERSION_MAJOR ||
	    renv->minver != DB_VERSION_MINOR) {
		__db_err(dbenv,
	"Program version %d.%d doesn't match environment version",
		    DB_VERSION_MAJOR, DB_VERSION_MINOR);
		ret = DB_VERSION_MISMATCH;
		goto err;
	}



More information about the bogofilter-dev mailing list