[Date Prev][Date Next]
Overlays: freeing resources on a hijacked Operation
- To: openldap-devel@OpenLDAP.org
- Subject: Overlays: freeing resources on a hijacked Operation
- From: David Hawes <firstname.lastname@example.org>
- Date: Wed, 1 Sep 2004 17:04:53 -0400
- Content-disposition: inline
- Organization: Middleware Services
- User-agent: KMail/1.5.3
I have recently finished an overlay that I call 'addpartial' that intercepts
an add operation, determines if the entry to be added exists, and if so,
determines if anything has changed and modifies the appropriate attributes.
If the entry does not exist, the add proceeds as expected. If the entry does
exist yet is identical to the existing entry, the add will silently return
LDAP_SUCCESS. The intent of this overlay is to do partial record replication
from a master to its slaves, while upstream replication data (from our
Registry, in this case) can be full records. Before this overlay, we were
doing deletes and adds for each entry changed in our Registry (ugh!), so we
were effectively slowing down our directories. The overlay can do a steady
400-500 records compared per second on entries with approximately 20-40
attributes (very rough numbers). I know other people faced with this problem
effectively diff entries at another level--this overlay simply does that at
the LDAP level. I provide this information in the hope that others will find
this useful. I'd love to polish it up and contribute it, if so.
My apologies for that long-winded description. Now on to my question.
After the overlay has finished doing what it needs to do, it sends
LDAP_SUCCESS to the client and then returns. If I return LDAP_SUCCESS, my
server runs out of memory at around 1 million entries (starts eating up swap
and then segfaults). However, if I return SLAP_CB_CONTINUE, the server does
not run out of memory (tested up to 20 million entries). I assume that
something in the original add Operation needs to be freed, but I am not sure
what. Could anyone point me in the right direction for this case? The
overlay works fine when I return SLAP_CB_CONTINUE, but there are some
misleading errors left in the logs (68: entry already exists) as it tries to
complete the original operation.
I appreciate any help or guidance for this. Also, I have to say I really love
the concept of overlays.