1 This patch is intended to be applied to Berkeley DB 4.2.52 and,
2 if applied, will automatically be used by slapd(8) back-bdb/hdb.
3 Without this patch the BDB DB_LOG_AUTOREMOVE option will not work,
4 nor will db_archive allow any transaction log files to be removed
5 while slapd is running.
7 The patch can be applied to the BDB source using patch(1) as follows
9 patch -p0 < openldap-src/build/BerkeleyDB42.patch
11 (modify directory paths as necessary), then recompile and reinstall
12 the BerkeleyDB 4.2 library, and then build and install OpenLDAP
15 The patch should not be applied to Berkeley DB 4.3.
19 ===================================================================
20 RCS file: /var/CVSROOT/bdb42/dbinc/db.in,v
21 retrieving revision 1.1.1.1
22 retrieving revision 1.2
23 diff -u -r1.1.1.1 -r1.2
24 --- dbinc/db.in 25 Nov 2003 21:58:02 -0000 1.1.1.1
25 +++ dbinc/db.in 17 Jul 2004 16:07:23 -0000 1.2
27 #define TXN_NOWAIT 0x040 /* Do not wait on locks. */
28 #define TXN_RESTORED 0x080 /* Transaction has been restored. */
29 #define TXN_SYNC 0x100 /* Sync on prepare and commit. */
30 +#define TXN_NOLOG 0x200 /* Do not log this transaction. */
35 ===================================================================
36 RCS file: /var/CVSROOT/bdb42/txn/txn.c,v
37 retrieving revision 1.1.1.2
38 retrieving revision 1.2
39 diff -u -r1.1.1.2 -r1.2
40 --- txn/txn.c 17 Dec 2003 21:43:53 -0000 1.1.1.2
41 +++ txn/txn.c 17 Jul 2004 16:07:27 -0000 1.2
43 if ((ret = __db_fchk(dbenv,
45 DB_DIRTY_READ | DB_TXN_NOWAIT |
46 - DB_TXN_NOSYNC | DB_TXN_SYNC)) != 0)
47 + DB_TXN_NOSYNC | DB_TXN_SYNC | DB_TXN_NOT_DURABLE)) != 0)
49 if ((ret = __db_fcchk(dbenv,
50 "txn_begin", flags, DB_TXN_NOSYNC, DB_TXN_SYNC)) != 0)
53 if (LF_ISSET(DB_TXN_NOWAIT))
54 F_SET(txn, TXN_NOWAIT);
55 + if (LF_ISSET(DB_TXN_NOT_DURABLE))
56 + F_SET(txn, TXN_NOLOG);
58 if ((ret = __txn_begin_int(txn, 0)) != 0)
61 * We should set this value when we write the first log record, not
64 - if (DBENV_LOGGING(dbenv))
65 + if (DBENV_LOGGING(dbenv) && !F_ISSET(txn, TXN_NOLOG))
66 __log_txn_lsn(dbenv, &begin_lsn, NULL, NULL);