db-4.2.52_p2-TXN.patch 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. The patch can be applied to the BDB source using patch(1) as follows
  7. cd db-4.2.52
  8. patch -p0 < openldap-src/build/BerkeleyDB42.patch
  9. (modify directory paths as necessary), then recompile and reinstall
  10. the BerkeleyDB 4.2 library, and then build and install OpenLDAP
  11. Software.
  12. The patch should not be applied to Berkeley DB 4.3.
  13. Index: dbinc/db.in
  14. ===================================================================
  15. RCS file: /var/CVSROOT/bdb42/dbinc/db.in,v
  16. retrieving revision 1.1.1.1
  17. retrieving revision 1.2
  18. diff -u -r1.1.1.1 -r1.2
  19. --- dbinc/db.in 25 Nov 2003 21:58:02 -0000 1.1.1.1
  20. +++ dbinc/db.in 17 Jul 2004 16:07:23 -0000 1.2
  21. @@ -839,6 +839,7 @@
  22. #define TXN_NOWAIT 0x040 /* Do not wait on locks. */
  23. #define TXN_RESTORED 0x080 /* Transaction has been restored. */
  24. #define TXN_SYNC 0x100 /* Sync on prepare and commit. */
  25. +#define TXN_NOLOG 0x200 /* Do not log this transaction. */
  26. u_int32_t flags;
  27. };
  28. Index: txn/txn.c
  29. ===================================================================
  30. RCS file: /var/CVSROOT/bdb42/txn/txn.c,v
  31. retrieving revision 1.1.1.2
  32. retrieving revision 1.2
  33. diff -u -r1.1.1.2 -r1.2
  34. --- txn/txn.c 17 Dec 2003 21:43:53 -0000 1.1.1.2
  35. +++ txn/txn.c 17 Jul 2004 16:07:27 -0000 1.2
  36. @@ -127,7 +127,7 @@
  37. if ((ret = __db_fchk(dbenv,
  38. "txn_begin", flags,
  39. DB_DIRTY_READ | DB_TXN_NOWAIT |
  40. - DB_TXN_NOSYNC | DB_TXN_SYNC)) != 0)
  41. + DB_TXN_NOSYNC | DB_TXN_SYNC | DB_TXN_NOT_DURABLE)) != 0)
  42. return (ret);
  43. if ((ret = __db_fcchk(dbenv,
  44. "txn_begin", flags, DB_TXN_NOSYNC, DB_TXN_SYNC)) != 0)
  45. @@ -193,6 +193,8 @@
  46. F_SET(txn, TXN_SYNC);
  47. if (LF_ISSET(DB_TXN_NOWAIT))
  48. F_SET(txn, TXN_NOWAIT);
  49. + if (LF_ISSET(DB_TXN_NOT_DURABLE))
  50. + F_SET(txn, TXN_NOLOG);
  51. if ((ret = __txn_begin_int(txn, 0)) != 0)
  52. goto err;
  53. @@ -328,7 +330,7 @@
  54. * We should set this value when we write the first log record, not
  55. * here.
  56. */
  57. - if (DBENV_LOGGING(dbenv))
  58. + if (DBENV_LOGGING(dbenv) && !F_ISSET(txn, TXN_NOLOG))
  59. __log_txn_lsn(dbenv, &begin_lsn, NULL, NULL);
  60. else
  61. ZERO_LSN(begin_lsn);