[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: multiple subordinates and shm_key - not a good idea

matthew sporleder wrote:
I am using openldap 2.3.21 and bdb 4.4.20 (both compiled 64-bit) on solaris 10.

It seems that using multiple shm_keys in slapd.conf with many
subordinate databases results in unusable data.  I'm about to try and
re-import with the same shm_key on all of the subordinates.  (ugh!)

Shared memory is managed directly by the BerkeleyDB library, not OpenLDAP itself. Whether a database is subordinate or not in OpenLDAP has no impact on BerkeleyDB; BerkeleyDB hasn't got any clue of what the calling application is doing with those databases and keys. All BerkeleyDB knows is that you're accessing multiple distinct database environments. Each BDB environment must be completely separate. When you're using BDB with plain environment files, you must configure them all in separate filesystem directories. When using shared memory regions the requirement doesn't change; every environment must be separate. Using the same shm_key for all the environment regions is guaranteed to fail.

It's not a good idea to try to use shared memory without reading the standard Unix documentation on shared memory. See the ipcs manpage for information on diagnosing shared memory usage. Notice that a single BDB environment is composed of many shared memory regions, occupying a range of keys starting from the one you specify and on upward. You can't use consecutive keys in your configuration because the subsequent keys are already in use.
-- Howard Chu
Chief Architect, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc
OpenLDAP Core Team http://www.openldap.org/project/