2011-12-06 13:54:38 +01:00
|
|
|
From e17f4d8c705ffa9080fd2ca5cf6780e30d04b0ac Mon Sep 17 00:00:00 2001
|
2010-10-07 21:59:49 +02:00
|
|
|
From: Ralf Haferkamp <rhafer@suse.de>
|
|
|
|
Date: Tue, 5 Oct 2010 14:20:22 +0200
|
2011-02-16 14:51:13 +01:00
|
|
|
Subject: Recover on DB version change
|
2010-10-07 21:59:49 +02:00
|
|
|
|
|
|
|
If the libdb Version changed try to recover the database. Note: This will
|
|
|
|
only succeed if only the format of transaction logs changed.
|
|
|
|
|
|
|
|
diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c
|
2011-02-16 14:51:13 +01:00
|
|
|
index 526fee8..a9f7c5a 100644
|
2010-10-07 21:59:49 +02:00
|
|
|
--- a/servers/slapd/back-bdb/init.c
|
|
|
|
+++ b/servers/slapd/back-bdb/init.c
|
|
|
|
@@ -330,6 +330,13 @@ shm_retry:
|
|
|
|
rc = (bdb->bi_dbenv->open)( bdb->bi_dbenv, dbhome,
|
|
|
|
flags | do_recover, bdb->bi_dbenv_mode );
|
|
|
|
|
|
|
|
+ if ( rc == DB_VERSION_MISMATCH ) {
|
|
|
|
+ Debug( LDAP_DEBUG_ANY,
|
|
|
|
+ LDAP_XSTRING(bdb_db_open) ": bdb version change detected "
|
|
|
|
+ "trying to recover\n", 0, 0, 0 );
|
|
|
|
+ rc = (bdb->bi_dbenv->open)( bdb->bi_dbenv, dbhome,
|
|
|
|
+ flags | DB_RECOVER, bdb->bi_dbenv_mode );
|
|
|
|
+ }
|
|
|
|
if ( rc ) {
|
|
|
|
/* Regular open failed, probably a missing shm environment.
|
|
|
|
* Start over, do a recovery.
|
|
|
|
--
|
2011-12-06 13:54:38 +01:00
|
|
|
1.7.7
|
2010-10-07 21:59:49 +02:00
|
|
|
|