Full_Name: Pierre Schweitzer
Version: HEAD
OS: Ubuntu
URL: http://fc.isima.fr/~schweitz/schweitz/0001-In-the-SQL-backend-add-code-to-h…
Submission from: (NULL) (90.27.237.49)
Hi,
here is a patch to handle a possible connection loss to DBMS for the SQL
backend. Right now, in case of connection loss, slapd just denied any entry
lookup with an error 80 (backend error).
With this patch, before preparing any req on the given connection handle, the
backend will first try to check whether the connection is active by issue a
dummy query. In case it's not, it will close the previous connection and open a
new one. And then, will prepare the req on the connection link.
I made this choice of developement because, preparing statement, executing it
and then, only looking whether it fails to re-submit would have been more
complex, since it would have required to start over the whole process for the
query (statement preparation and such) while preparation & execution aren't not
in the same function.
This patch has been tested and validated in production on the ReactOS Foundation
infrastructure.
The attached patch file is derived from OpenLDAP Software. All of the
modifications to OpenLDAP Software represented in the following patch(es) were
developed by Pierre Schweitzer (pierre(a)reactos.org). I have not assigned rights
and/or interest in this work to any party.
I, Pierre Schweitzer, hereby place the following modifications to OpenLDAP
Software (and only these modifications) into the public domain. Hence, these
modifications may be freely used and/or redistributed for any purpose with or
without attribution and/or other notice.
Regards,
Pierre
Ulrich.Windl(a)rz.uni-regensburg.de wrote:
> Full_Name: Ulrich Windl
> Version: 2.4.26
> OS: Linux (SLES11 SP2)
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (132.199.152.129)
>
>
> I was able to set up a master LDAP server and a replication consumer using the
> physical host names and TLS. However when I tried to bind slapd on a virtual IP
> address ("interface alias"), I never got slapd working (even though I fixed the
> certificates for TLS, of course). Dynamic configuration ("cn=config") seems to
> make things very difficult, because slapd ends in a state where _nobody_ can
> make configuration changes.
Use the openldap-technical mailing list to ask for configuration help.
You talk about IP addresses and yet in your quoted text below you are using
hostnames. Be consistent when you post your question to the mailing list
otherwise no one will understand what you're asking for.
Closing this ITS.
> It seems slapd tried to use the wrong URI (using the physical host where nobody
> is listening):
> slapd[10036]: slap_client_connect: URI=ldap://phost.domain.org/ Error,
> ldap_start_tls failed (-1)
> slapd[10036]: do_syncrepl: rid=002 rc -1 retrying
>
> slapd is listening on ldap://vhost.domain.org/ however.
>
> I read lots of procedures using Google, but could not find the solution for this
> problem. Thus I suggest to add documentation how to configure such a scenario:
>
> 1) Set up an LDAP Master server that provides service on a specific IP address
> using TLS
> 2) Set up a replication consumer that provides service on a specific IP address
> using TLS also
> 3) The replication consumer should use the address where the master server
> listens for replication
>
> It sounds like an every-day setup, but I failed multiple times, thus the request
> for documentation.
>
>
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/
Full_Name: Ulrich Windl
Version: 2.4.26
OS: Linux (SLES11 SP2)
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (132.199.152.129)
I was able to set up a master LDAP server and a replication consumer using the
physical host names and TLS. However when I tried to bind slapd on a virtual IP
address ("interface alias"), I never got slapd working (even though I fixed the
certificates for TLS, of course). Dynamic configuration ("cn=config") seems to
make things very difficult, because slapd ends in a state where _nobody_ can
make configuration changes.
It seems slapd tried to use the wrong URI (using the physical host where nobody
is listening):
slapd[10036]: slap_client_connect: URI=ldap://phost.domain.org/ Error,
ldap_start_tls failed (-1)
slapd[10036]: do_syncrepl: rid=002 rc -1 retrying
slapd is listening on ldap://vhost.domain.org/ however.
I read lots of procedures using Google, but could not find the solution for this
problem. Thus I suggest to add documentation how to configure such a scenario:
1) Set up an LDAP Master server that provides service on a specific IP address
using TLS
2) Set up a replication consumer that provides service on a specific IP address
using TLS also
3) The replication consumer should use the address where the master server
listens for replication
It sounds like an every-day setup, but I failed multiple times, thus the request
for documentation.
kb9vqf(a)pearsoncomputing.net wrote:
>> kb9vqf(a)pearsoncomputing.net wrote:
>>> Full_Name: Timothy Pearson
>>> Version: 2.4.31
>>> OS: Debian Wheezy
>>> URL: ftp://ftp.openldap.org/incoming/
>>> Submission from: (NULL) (131.156.2.26)
>>>
>>>
>>> The setup:
>>> Multi-master syncrepl on two servers
>>> Identical hardware and software between servers
>>> Self-signed TLS using common (private) CA certificate
>>>
>>> The problem:
>>> slapd on one server crashes repeatably within a minute of slapd
> starting on the
>>> other server. slapd works reliably if and only if the other server is not
>>> running a slapd process.
>>
>> 1) 2.4.31 is ancient. Current is 2.4.35. Please provide a backtrace
> against a
>> current OpenLDAP release.
>>
>> 2) Your backtrace shows a crash in a slapi plugin. If the bug is in your
> plugin there's nothing we can do about it.
>>
>> 3) Don't touch the individual files inside the slapd configuration
> database.
>> Use "slapcat -n0".
>
> Thank you for your prompt response. In the backtrace I posted, which
> portion suggests that the crash occurred in a plugin? I would have
> expected to see at least one frame in something other than
> ../../../../servers/slapd.
Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffe356c700 (LWP 10433)]
0x00007ffff5a32475 in *__GI_raise (sig=<optimized out>) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x00007ffff5a32475 in *__GI_raise (sig=<optimized out>) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007ffff5a356f0 in *__GI_abort () at abort.c:92
#2 0x00007ffff5a6d52b in __libc_message (do_abort=<optimized out>,
fmt=<optimized out>) at ../sysdeps/unix/sysv/linux/libc_fatal.c:189
#3 0x00007ffff5a76d76 in malloc_printerr (action=3, str=0x7ffff5b4f170
"munmap_chunk(): invalid pointer", ptr=<optimized out>) at malloc.c:6283
#4 0x00007ffff63d214a in slapi_op_search_callback (op=0x7fffe3569fd0,
rs=<optimized out>, prc=<optimized out>) at
../../../../../servers/slapd/slapi/slapi_overlay.c:313
#5 slapi_op_search_callback (op=0x7fffe3569fd0, rs=<optimized out>,
prc=<optimized out>) at ../../../../../servers/slapd/slapi/slapi_overlay.c:296
#6 0x00007ffff63d304f in slapi_op_func (rs=0x7fffe3569f60, op=<optimized out>)
at ../../../../../servers/slapd/slapi/slapi_overlay.c:631
#7 slapi_op_func (op=0x7fffe3569fd0, rs=0x7fffe3569f60) at
../../../../../servers/slapd/slapi/slapi_overlay.c:556
The slapi_* functions would not be present in the stack trace unless you had
configured a slapi plugin on this database.
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/
> kb9vqf(a)pearsoncomputing.net wrote:
>> Full_Name: Timothy Pearson
>> Version: 2.4.31
>> OS: Debian Wheezy
>> URL: ftp://ftp.openldap.org/incoming/
>> Submission from: (NULL) (131.156.2.26)
>>
>>
>> The setup:
>> Multi-master syncrepl on two servers
>> Identical hardware and software between servers
>> Self-signed TLS using common (private) CA certificate
>>
>> The problem:
>> slapd on one server crashes repeatably within a minute of slapd
starting on the
>> other server. slapd works reliably if and only if the other server is not
>> running a slapd process.
>
> 1) 2.4.31 is ancient. Current is 2.4.35. Please provide a backtrace
against a
> current OpenLDAP release.
>
> 2) Your backtrace shows a crash in a slapi plugin. If the bug is in your
plugin there's nothing we can do about it.
>
> 3) Don't touch the individual files inside the slapd configuration
database.
> Use "slapcat -n0".
Thank you for your prompt response. In the backtrace I posted, which
portion suggests that the crash occurred in a plugin? I would have
expected to see at least one frame in something other than
../../../../servers/slapd.
I am not directly modifying the config database text files, but did not
know the correct method to dump the existing files. Thanks for the
command!
dusan.fric(a)t-systems.sk wrote:
> --_000_B3C9B2D7E2866A479BAEDF530AA0293D2C5FE65416TSSKKEEXCCR1s_
> Content-Type: text/plain; charset="us-ascii"
> Content-Transfer-Encoding: quoted-printable
>
> Hi guys,
>
> good news, the issue is solved. We changed db setting (DB_CONFIG) as follow=
> s:
>
> set_lk_detect DB_LOCK_RANDOM
>
> (instead of bad set_lk_detect DB_LOCK_EXPIRE)
>
> and no hangs until now.
That's great, but why was it set to DB_LOCK_EXPIRE in the first place?
DB_LOCK_RANDOM is the default, you should not be changing this setting without
a good reason and good knowledge of what you're doing.
>
> We can also find the same issue described here
>
> http://www.openldap.org/lists/openldap-technical/201102/msg00074.html
>
>
> FYI - customer's test confirmed it.
>
> Thanks for your suggestions and help.
>
> Regards,
> Dusan
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/