From 2ffd296c6afce3c0abcf7953b9a2f8bd91ee4ea6 Mon Sep 17 00:00:00 2001
From: Wietse Venema
Date: Sat, 28 Sep 2013 00:00:00 -0500
Subject: [PATCH] postfix-2.11-20130928
---
postfix/HISTORY | 11 ++++
postfix/README_FILES/LMDB_README | 30 ++++++++++-
postfix/html/LMDB_README.html | 31 ++++++++++-
postfix/html/oqmgr.8.html | 11 ++--
postfix/html/postconf.5.html | 12 +++++
postfix/html/qmgr.8.html | 11 ++--
postfix/man/man5/postconf.5 | 5 ++
postfix/man/man8/oqmgr.8 | 10 ++--
postfix/man/man8/qmgr.8 | 10 ++--
postfix/mantools/postlink | 1 +
postfix/proto/LMDB_README.html | 31 ++++++++++-
postfix/proto/postconf.proto | 9 ++++
postfix/src/global/mail_params.c | 13 ++++-
postfix/src/global/mail_params.h | 6 ++-
postfix/src/global/mail_version.h | 2 +-
postfix/src/global/mkmap_lmdb.c | 42 ---------------
postfix/src/master/master_vars.c | 6 ---
postfix/src/oqmgr/qmgr.c | 12 ++---
postfix/src/postscreen/postscreen.c | 2 -
postfix/src/qmgr/qmgr.c | 12 ++---
postfix/src/util/dict_lmdb.c | 83 +++++++++++++++++++++--------
21 files changed, 244 insertions(+), 106 deletions(-)
diff --git a/postfix/HISTORY b/postfix/HISTORY
index 1e58fa1c9..d9d9d5b2f 100644
--- a/postfix/HISTORY
+++ b/postfix/HISTORY
@@ -18943,3 +18943,14 @@ Apologies for any names omitted.
util/dict_open.c, util/dict_alloc.c, util/dict_lmdb.c,
postmap/postmap.c, postalias/postalias.c, proto/LMDB_README.html,
proto/postconf.proto.
+
+20130928
+
+ Cleanup: the lmdb_max_readers property is now configurable.
+ This is a hard limit built into the OpenLDAP library that
+ causes requests to fail when the number of open read
+ transactions exceeds the limit. When this happens the LMDB
+ client logs a MDB_READERS_FULL warning and continues with
+ reduced performance. Files: util/dict_lmdb.c, util/dict_lmdb.h,
+ global/mail_params.h, global/mail_params.c, proto/postconf.proto,
+ proto/LMDB_README.html.
diff --git a/postfix/README_FILES/LMDB_README b/postfix/README_FILES/LMDB_README
index 5d3baeb17..13203e68e 100644
--- a/postfix/README_FILES/LMDB_README
+++ b/postfix/README_FILES/LMDB_README
@@ -39,13 +39,19 @@ The exact pathnames depend on how OpenLDAP LMDB was installed.
CCoonnffiigguurree LLMMDDBB sseettttiinnggss
-Postfix provides one configuration parameter that controls OpenLDAP LMDB
-database behavior.
+Postfix provides configuration parameters that control OpenLDAP LMDB database
+behavior.
* lmdb_map_size (default: 16777216). This setting specifies the initial
OpenLDAP LMDB database size limit in bytes. Each time a database becomes
full, its size limit is doubled.
+ * lmdb_max_readers (default: $default_process_limit). This specifies a hard
+ limit on the number of read transactions that may be open at the same time
+ for the same OpenLDAP LMDB database. When this number is too small, the
+ Postfix LMDB client will log MDB_READERS_FULL warnings, and will run with
+ reduced performance.
+
MMiissssiinngg pptthhrreeaadd lliibbrraarryy ttrroouubbllee
When building Postfix fails with:
@@ -68,6 +74,26 @@ that don't exist with other Postfix databases. Some failure modes have been
eliminated on the course of time. The writeup below reflects the status as of
of LMDB 0.9.8.
+UUnneexxppeecctteedd ""rreeaaddeerrss ffuullll"" eerrrroorrss..
+
+Problem:
+ Under heavy load, database read operations fail with MDB_READERS_FULL
+ errors. This problem does not exist with other Postfix databases.
+
+Background:
+ The LMDB implementation enforces a hard limit on the number of simultaneous
+ read requests for the same database environment. This limit must be
+ specified with the lmdb_max_readers configuration parameter.
+
+Mitigation:
+ Postfix logs a warning suggesting that the lmdb_max_readers parameter value
+ be increased, and retries the failed operation for a limited number of
+ times while running with reduced performance.
+
+Prevention:
+ Monitor your LMDB files for MDB_READERS_FULL errors and make the necessary
+ adjustments. Consider using CDB for read-mostly databases.
+
NNoonn--oobbvviioouuss rreeccoovveerryy wwiitthh ppoossttmmaapp((11))//ppoossttaalliiaass((11))//ttllssmmggrr((88)) ffrroomm aa ccoorrrruupptteedd
ddaattaabbaassee..
diff --git a/postfix/html/LMDB_README.html b/postfix/html/LMDB_README.html
index 2c6dbb597..0ca095db9 100644
--- a/postfix/html/LMDB_README.html
+++ b/postfix/html/LMDB_README.html
@@ -69,7 +69,7 @@ build Postfix with OpenLDAP LMDB support, use something like:
- Postfix provides one configuration parameter that controls
+
Postfix provides configuration parameters that control
OpenLDAP LMDB database behavior.
@@ -78,6 +78,13 @@ OpenLDAP LMDB database behavior.
the initial OpenLDAP LMDB database size limit in bytes. Each time
a database becomes full, its size limit is doubled.
+-
lmdb_max_readers (default: $default_process_limit). This
+specifies a hard limit on the number of read transactions that may
+be open at the same time for the same OpenLDAP LMDB database. When
+this number is too small, the Postfix LMDB client will log
+MDB_READERS_FULL warnings, and will run with reduced performance.
+
+
@@ -113,6 +120,28 @@ failure modes that don't exist with other Postfix databases. Some
failure modes have been eliminated on the course of time.
The writeup below reflects the status as of of LMDB 0.9.8.
+ Unexpected "readers full" errors.
+
+
+
+- Problem:
-
Under heavy load, database read
+operations fail with MDB_READERS_FULL errors. This problem does not
+exist with other Postfix databases.
+
+- Background:
-
The LMDB implementation enforces a
+hard limit on the number of simultaneous read requests for the same
+database environment. This limit must be specified with the
+lmdb_max_readers configuration parameter.
+
+- Mitigation:
-
Postfix logs a warning suggesting
+that the lmdb_max_readers parameter value be increased, and retries
+the failed operation for a limited number of times while running
+with reduced performance.
+
+- Prevention:
-
Monitor your LMDB files for
+MDB_READERS_FULL errors and make the necessary adjustments.
+Consider using CDB for read-mostly databases.
+