Issue 6531 - Modify updateref to generate referrals on the backend
Summary: Modify updateref to generate referrals on the backend
Status: UNCONFIRMED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: 2.4.18
Hardware: All All
: --- enhancement
Target Milestone: 2.7.0
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-23 20:14 UTC by ryans@aweber.com
Modified: 2021-07-13 16:18 UTC (History)
0 users

See Also:


Attachments
rein-ITS6531 patch from FTP server (9.37 KB, patch)
2021-06-03 17:16 UTC, Quanah Gibson-Mount
Details

Note You need to log in before you can comment on or make changes to this issue.
Description ryans@aweber.com 2010-04-23 20:14:49 UTC
Full_Name: Ryan Steele
Version: 2.4.18
OS: Ubuntu Server
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (207.106.239.81)


Per conversation on the #openldap IRC channel on Freenode with Howard Chu, it
has been deemed appropriate to modify the behavior of updateref to answer
referrals on the backend.  This would allow one to use updateref to
automatically chase referrals for individual backends, instead of it being all
or nothing.  Here is the tail end of the channel conversation:


<hyc> when you configure an updateref on a backend, that referral is only
generated in the frontend so putting the overlay on the database, misses it...

<rgsteele> Well, I am intending to set an updateref on that backend

<hyc> then you have a problem

<rgsteele> Hm, so you can't do automatic referrals on individual backends then?

<rgsteele> That was my original question, or at least the intent of it.

<hyc> not using updateref, no

<rgsteele> Does your response imply there's another way?

<hyc> probably we should fix updateref to be generated at the backend level

<rgsteele> That would be good - I'd be happy to write tests or something to help
with that.

<hyc> the "other way" is the normal referral mechanism - using referral entries
inside a database

<hyc> but like I said, updateref is a relic, we've carried it forward without
really adapting it

<hyc> probably should file an ITS about this

<rgsteele> Interesting, I wasn't aware of that method. I'll have to do some
research on that - thanks! Also, is there anything I can do to help get the
process of fixing updateref to generate referrals on the backend?

<rgsteele> I can file the ITS if you like?

<hyc> go ahead
Comment 1 ando@openldap.org 2010-04-24 22:12:13 UTC
> Full_Name: Ryan Steele
> Version: 2.4.18
> OS: Ubuntu Server
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (207.106.239.81)
>
>
> Per conversation on the #openldap IRC channel on Freenode with Howard Chu,
> it
> has been deemed appropriate to modify the behavior of updateref to answer
> referrals on the backend.  This would allow one to use updateref to
> automatically chase referrals for individual backends, instead of it being
> all
> or nothing.  Here is the tail end of the channel conversation:
>
>
> <hyc> when you configure an updateref on a backend, that referral is only
> generated in the frontend so putting the overlay on the database, misses
> it...
>
> <rgsteele> Well, I am intending to set an updateref on that backend
>
> <hyc> then you have a problem
>
> <rgsteele> Hm, so you can't do automatic referrals on individual backends
> then?
>
> <rgsteele> That was my original question, or at least the intent of it.
>
> <hyc> not using updateref, no
>
> <rgsteele> Does your response imply there's another way?
>
> <hyc> probably we should fix updateref to be generated at the backend
> level
>
> <rgsteele> That would be good - I'd be happy to write tests or something
> to help
> with that.
>
> <hyc> the "other way" is the normal referral mechanism - using referral
> entries
> inside a database
>
> <hyc> but like I said, updateref is a relic, we've carried it forward
> without
> really adapting it
>
> <hyc> probably should file an ITS about this
>
> <rgsteele> Interesting, I wasn't aware of that method. I'll have to do
> some
> research on that - thanks! Also, is there anything I can do to help get
> the
> process of fixing updateref to generate referrals on the backend?
>
> <rgsteele> I can file the ITS if you like?
>
> <hyc> go ahead

It is correct that referrals are generated by the frontend, but the
frontend uses information contained in the updateref of each database. 
The slapo-chain needs to be global, in order to intercept those referrals.

Although redesigning referral generation in slapd could streamline things,
I don't quite see what issues can't be addressed using a global instance
of slapo-chain.  You can configure referral chasing differently for
different domains using the chain-uri directive.  I favor fixing only
what's actually broken.

p.

Comment 2 Howard Chu 2010-04-24 22:49:01 UTC
masarati@aero.polimi.it wrote:
>> Full_Name: Ryan Steele
>> Version: 2.4.18
>> OS: Ubuntu Server
>> URL: ftp://ftp.openldap.org/incoming/
>> Submission from: (NULL) (207.106.239.81)
>>
>>
>> Per conversation on the #openldap IRC channel on Freenode with Howard Chu,
>> it
>> has been deemed appropriate to modify the behavior of updateref to answer
>> referrals on the backend.  This would allow one to use updateref to
>> automatically chase referrals for individual backends, instead of it being
>> all
>> or nothing.  Here is the tail end of the channel conversation:
>>
>>
>> <hyc>  when you configure an updateref on a backend, that referral is only
>> generated in the frontend so putting the overlay on the database, misses
>> it...
>>
>> <rgsteele>  Well, I am intending to set an updateref on that backend
>>
>> <hyc>  then you have a problem
>>
>> <rgsteele>  Hm, so you can't do automatic referrals on individual backends
>> then?
>>
>> <rgsteele>  That was my original question, or at least the intent of it.
>>
>> <hyc>  not using updateref, no
>>
>> <rgsteele>  Does your response imply there's another way?
>>
>> <hyc>  probably we should fix updateref to be generated at the backend
>> level
>>
>> <rgsteele>  That would be good - I'd be happy to write tests or something
>> to help
>> with that.
>>
>> <hyc>  the "other way" is the normal referral mechanism - using referral
>> entries
>> inside a database
>>
>> <hyc>  but like I said, updateref is a relic, we've carried it forward
>> without
>> really adapting it
>>
>> <hyc>  probably should file an ITS about this
>>
>> <rgsteele>  Interesting, I wasn't aware of that method. I'll have to do
>> some
>> research on that - thanks! Also, is there anything I can do to help get
>> the
>> process of fixing updateref to generate referrals on the backend?
>>
>> <rgsteele>  I can file the ITS if you like?
>>
>> <hyc>  go ahead
>
> It is correct that referrals are generated by the frontend, but the
> frontend uses information contained in the updateref of each database.
> The slapo-chain needs to be global, in order to intercept those referrals.
>
> Although redesigning referral generation in slapd could streamline things,
> I don't quite see what issues can't be addressed using a global instance
> of slapo-chain.  You can configure referral chasing differently for
> different domains using the chain-uri directive.  I favor fixing only
> what's actually broken.

The request revolves around having different behavior for different databases. 
With a global slapo-chain you cannot turn off referral chasing; URIs that are 
not explicitly configured will still be chased.

Also in terms of logical abstraction the current behavior is wrong; the 
frontend should of course generate the default_referral responses but 
updateref is a per-backend item and should be generated at the backend layer. 
Ideally this would all have been fixed to behave correctly by moving all 
replication support into an overlay, where it properly belongs. As an interim 
step it would be trivial to write an updateref overlay that supersedes the 
current updateref behavior.

-- 
   -- 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 3 ando@openldap.org 2010-04-25 16:14:11 UTC
[snip]

>> Although redesigning referral generation in slapd could streamline
>> things,
>> I don't quite see what issues can't be addressed using a global instance
>> of slapo-chain.  You can configure referral chasing differently for
>> different domains using the chain-uri directive.  I favor fixing only
>> what's actually broken.
>
> The request revolves around having different behavior for different
> databases.
> With a global slapo-chain you cannot turn off referral chasing; URIs that
> are
> not explicitly configured will still be chased.
>
> Also in terms of logical abstraction the current behavior is wrong; the
> frontend should of course generate the default_referral responses but
> updateref is a per-backend item and should be generated at the backend
> layer.
> Ideally this would all have been fixed to behave correctly by moving all
> replication support into an overlay, where it properly belongs. As an
> interim
> step it would be trivial to write an updateref overlay that supersedes the
> current updateref behavior.

As I said, I recognize the usefulness of such a change: I first moved
replication into an overlay (ITS#4261).  I'm questioning its need for the
case at hand.  Perhaps allowing slapo-chain to ignore some URIs would be
easier to implement, and generally useful in other applications.

In any case, I might spare some time to revitalize (ITS#4261), now that
slurpd is no longer around and thus things simplify significantly.

p.

Comment 4 Rein 2010-04-26 14:15:35 UTC
On 04/25/2010 12:49 AM, hyc@symas.com wrote:

> Also in terms of logical abstraction the current behavior is wrong; the
> frontend should of course generate the default_referral responses but
> updateref is a per-backend item and should be generated at the backend layer.
> Ideally this would all have been fixed to behave correctly by moving all
> replication support into an overlay, where it properly belongs. As an interim
> step it would be trivial to write an updateref overlay that supersedes the
> current updateref behavior.

Updateref processing should imo be kept out of any replication modules, 
it is needed in databases where syncrepl isn't configured too.  I'm 
using it on my subordinate databases (with an artificial updatedn so 
that slapd accepts it..) when syncrepl is configured on the superior 
glue database without managing all of the subordinate databases.  I.e, 
the infamous test058...

I was having the same "chain only on some of the databases" requirement 
and is using a patch that allows it. I consider this patch more of a 
hack than a correct solution, which is why I haven't contributed it.  A 
separate updateref overlay apear to me as the best solution.  But for 
what it's worth, my patch is now in:

  ftp://ftp.openldap.org/incoming/rein-ITS6531.patch

An advantage with this patch over a new overlay is that it should be 
usable without any configuration changes (provided the chain overlay 
have already been configured in the databases and found to not work as 
expected there that is ... ;-).

Rein

Comment 5 Howard Chu 2010-07-29 01:22:05 UTC
Rein Tollevik wrote:
> On 04/25/2010 12:49 AM, hyc@symas.com wrote:
>
>> Also in terms of logical abstraction the current behavior is wrong; the
>> frontend should of course generate the default_referral responses but
>> updateref is a per-backend item and should be generated at the backend layer.
>> Ideally this would all have been fixed to behave correctly by moving all
>> replication support into an overlay, where it properly belongs. As an interim
>> step it would be trivial to write an updateref overlay that supersedes the
>> current updateref behavior.
>
> Updateref processing should imo be kept out of any replication modules,
> it is needed in databases where syncrepl isn't configured too.  I'm
> using it on my subordinate databases (with an artificial updatedn so
> that slapd accepts it..) when syncrepl is configured on the superior
> glue database without managing all of the subordinate databases.  I.e,
> the infamous test058...
>
> I was having the same "chain only on some of the databases" requirement
> and is using a patch that allows it. I consider this patch more of a
> hack than a correct solution, which is why I haven't contributed it.  A
> separate updateref overlay apear to me as the best solution.  But for
> what it's worth, my patch is now in:
>
>    ftp://ftp.openldap.org/incoming/rein-ITS6531.patch
>
> An advantage with this patch over a new overlay is that it should be
> usable without any configuration changes (provided the chain overlay
> have already been configured in the databases and found to not work as
> expected there that is ... ;-).

I didn't quite follow the intended usage for this patch. Are other overlays 
expected to override the default over_mod_ref() handler?

-- 
   -- 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 6 Quanah Gibson-Mount 2017-04-07 17:50:39 UTC
moved from Incoming to Software Enhancements
Comment 7 OpenLDAP project 2017-04-12 20:30:41 UTC
RE 2.5?
See also ITS#6942
Comment 8 Quanah Gibson-Mount 2017-04-12 20:30:41 UTC
changed notes
Comment 9 Quanah Gibson-Mount 2021-06-03 17:16:38 UTC
Created attachment 826 [details]
rein-ITS6531 patch from FTP server