]> git.sur5r.net Git - openldap/blob - build/BerkeleyDB42.patch
Enhance OL_ARG_ENABLE for overridable defaults, trim some redundancy in
[openldap] / build / BerkeleyDB42.patch
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.
6
7 The patch can be applied to the BDB source using patch(1) as follows
8         cd db-4.2.52
9         patch -p0 < openldap-src/build/BerkeleyDB42.patch
10
11 (modify directory paths as necessary), then recompile and reinstall
12 the BerkeleyDB 4.2 library, and then build and install OpenLDAP
13 Software.
14
15 The patch should not be applied to Berkeley DB 4.3.
16
17
18 Index: dbinc/db.in
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
26 @@ -839,6 +839,7 @@
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. */
31         u_int32_t       flags;
32  };
33  
34 Index: txn/txn.c
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
42 @@ -127,7 +127,7 @@
43         if ((ret = __db_fchk(dbenv,
44             "txn_begin", flags,
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)
48                 return (ret);
49         if ((ret = __db_fcchk(dbenv,
50             "txn_begin", flags, DB_TXN_NOSYNC, DB_TXN_SYNC)) != 0)
51 @@ -193,6 +193,8 @@
52                 F_SET(txn, TXN_SYNC);
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);
57  
58         if ((ret = __txn_begin_int(txn, 0)) != 0)
59                 goto err;
60 @@ -328,7 +330,7 @@
61          * We should set this value when we write the first log record, not
62          * here.
63          */
64 -       if (DBENV_LOGGING(dbenv))
65 +       if (DBENV_LOGGING(dbenv) && !F_ISSET(txn, TXN_NOLOG))
66                 __log_txn_lsn(dbenv, &begin_lsn, NULL, NULL);
67         else
68                 ZERO_LSN(begin_lsn);