Howard Chu:
> The attached patches add support for OpenLDAP's MDB (Memory-Mapped Database)
> library to the postfix-2.10-20120908 source.
>
> I don't consider this a final patch; pretty sure it works but also would like
> feedback on how some things were done. Also, I didn't see any instructions
> anywhere on how to write the corresponding _README file, it kind of looks like
> nroff output. manpage updates also need to be written.
The README source files are in the "proto" subdirectory. They are
transformed into hyperlinked HTML and ASCII text, under control of
appropriate Makefiles. The embedded manpages in source files are
managed separately.
> The first patch adds a lock handler to the dict interface. I needed this
> first, because MDB is fully transactional and does its own locking/concurrency
> management. In particular, it does MVCC so readers always run lockless; since
> they're fully isolated there's no actual need for "shared locks."
In the case of Postfix, most daemon applications are readers, while
postmap and postalias are writers. The readers use per-query locks,
while the writers use a global lock while they rewrite the table
from scratch.
In the case of DBM (which consists of two files) that is the best
one can do. In the case of CDB and (soon) Berkeley DB it's better
to rename the file into place after rewriting it from scratch.
> I think this was a necessary feature for the dict interface in general;
> arbitrary apps shouldn't need to know anything about how a particular table
> implementation handles locking. In particular, dict implementations ought to
> be free to use semaphores, process-shared mutexes, or anything else that comes
> in handy.
As explained above, one size does not fit all, different apps have
different requirements.
I'll have a look at the lock handler code and see if it will cause
any new problems with the existing maps.
Wietse
> I'm happy to write up the corresponding doc updates, when someone tells me
> where to begin. In the meantime, you can read up on our MDB library here:
> http://highlandsun.com/hyc/mdb/
> --
> -- Howard Chu
> CTO, Symas Corp. http://www.symas.com
> Director, Highland Sun http://highlandsun.com/hyc/
> Chief Architect, OpenLDAP http://www.openldap.org/project/
[ Attachment, skipping... ]
[ Attachment, skipping... ]