Issue 5954 - deleting one of several syncrepl consumers deletes the wrong one
Summary: deleting one of several syncrepl consumers deletes the wrong one
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-17 20:05 UTC by Jonathan
Modified: 2014-08-01 21:04 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jonathan 2009-02-17 20:05:29 UTC
Full_Name: Jonathan Clarke
Version: RE24
OS: CentOS
URL: http://milopita.phillipoux.net/jonathan-clarke-090217.patch
Submission from: (NULL) (213.41.243.192)


Hi all,

It seems that when adding syncrepl consumers to be->be_syncinfo, they are added
in LIFO order. However, when deleting the nth syncrepl consumer via a ldapdelete
on cn=config from be->be_syncinfo, the nth entry in the list is removed, which
is not the same one.

To reproduce:
1) If we start with this in cn=config:
> olcSyncRepl: {0}rid=001
> olcSyncRepl: {1}rid=002

The list order is (schematically):
be->be_syncinfo = {rid=002, rid=001}

2) Add add a rid=003, we have in cn=config:
olcSyncRepl: {0}rid=001
olcSyncRepl: {1}rid=002
olcSyncRepl: {2}rid=003

and the list is:
be->be_syncinfo = {rid=003, rid=002, rid=001}

3) We attempt to delete rid=003:
dn: ...,cn=config
changeType: modify
delete: olcSyncRepl
olcSyncRepl: {2}rid=003

The list then contains, value number 2 having been deleted:
be->be_syncinfo = {rid=003, rid=002}

The above patch changes the order syncrepl info is inserted in the list. This
corrects the problem, and I have not seen any other consequences (by running the
test suite and browsing the code).

Is this OK? My apologies if I have missed something big here.
Comment 1 Craig Worgan 2009-02-17 20:17:52 UTC
LOL 

-----Original Message-----
From: openldap-bugs-bounces+worganc=nortel.com@openldap.org
[mailto:openldap-bugs-bounces+worganc=nortel.com@openldap.org] On Behalf
Of jclarke@linagora.com
Sent: Tuesday, February 17, 2009 3:05 PM
To: openldap-its@openldap.org
Subject: (ITS#5954) deleting one of several syncrepl consumers deletes
thewrong one

Full_Name: Jonathan Clarke
Version: RE24
OS: CentOS
URL: http://milopita.phillipoux.net/jonathan-clarke-090217.patch
Submission from: (NULL) (213.41.243.192)


Hi all,

It seems that when adding syncrepl consumers to be->be_syncinfo, they
are added in LIFO order. However, when deleting the nth syncrepl
consumer via a ldapdelete on cn=config from be->be_syncinfo, the nth
entry in the list is removed, which is not the same one.

To reproduce:
1) If we start with this in cn=config:
> olcSyncRepl: {0}rid=001
> olcSyncRepl: {1}rid=002

The list order is (schematically):
be->be_syncinfo = {rid=002, rid=001}

2) Add add a rid=003, we have in cn=config:
olcSyncRepl: {0}rid=001
olcSyncRepl: {1}rid=002
olcSyncRepl: {2}rid=003

and the list is:
be->be_syncinfo = {rid=003, rid=002, rid=001}

3) We attempt to delete rid=003:
dn: ...,cn=config
changeType: modify
delete: olcSyncRepl
olcSyncRepl: {2}rid=003

The list then contains, value number 2 having been deleted:
be->be_syncinfo = {rid=003, rid=002}

The above patch changes the order syncrepl info is inserted in the list.
This corrects the problem, and I have not seen any other consequences
(by running the test suite and browsing the code).

Is this OK? My apologies if I have missed something big here.

Comment 2 Howard Chu 2009-02-17 21:09:13 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Bugs
Comment 3 Howard Chu 2009-02-17 21:09:43 UTC
jclarke@linagora.com wrote:
> Full_Name: Jonathan Clarke
> Version: RE24
> OS: CentOS
> URL: http://milopita.phillipoux.net/jonathan-clarke-090217.patch
> Submission from: (NULL) (213.41.243.192)
>
>
> Hi all,
>
> It seems that when adding syncrepl consumers to be->be_syncinfo, they are added
> in LIFO order. However, when deleting the nth syncrepl consumer via a ldapdelete
> on cn=config from be->be_syncinfo, the nth entry in the list is removed, which
> is not the same one.

Thanks for the patch, fixed in HEAD.

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 4 Quanah Gibson-Mount 2009-02-17 21:17:28 UTC
changed notes
changed state Test to Release
Comment 5 Jonathan 2009-02-18 07:38:12 UTC
hyc@symas.com wrote:
> jclarke@linagora.com wrote:
>   
>> Full_Name: Jonathan Clarke
>> Version: RE24
>> OS: CentOS
>> URL: http://milopita.phillipoux.net/jonathan-clarke-090217.patch
>> Submission from: (NULL) (213.41.243.192)
>>
>>
>> Hi all,
>>
>> It seems that when adding syncrepl consumers to be->be_syncinfo, they are added
>> in LIFO order. However, when deleting the nth syncrepl consumer via a ldapdelete
>> on cn=config from be->be_syncinfo, the nth entry in the list is removed, which
>> is not the same one.
>>     
>
> Thanks for the patch, fixed in HEAD.
>   
This ITS' subject was rather vague. Just for reference, this problem 
only affected in-memory structures, not the actual data in cn=config. 
Always solved by restarting slapd, thus.

Comment 6 Quanah Gibson-Mount 2009-02-24 05:43:14 UTC
changed notes
changed state Release to Closed
Comment 7 OpenLDAP project 2014-08-01 21:04:19 UTC
fixed in HEAD
fixed in RE24