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

Re: Updating a private schema (cn=config)?



Am Donnerstag 11 Dezember 2008 16:39:24 schrieb Andrzej Jan Taramina:
> Howard replied:
> > This was just discussed on -technical as well. You can delete
> > individual
> > schema elements using ldapmodify. You cannot delete entire cn=config
> > entries
> > (using ldapdelete). There are no plans to change this behavior for
> > schema in
> > the future.
>
> Using ldapmodify for individual entries is painful in the extreme, since
> each entry only has a single attribute...basically a monster string with
> all the schema constraints in it.
>
> > > > What about any entries that depend on the schema? Will they be
> >
> > affected...
> >
> > The answer is "it depends"...
>
> Depends on what?  I would really like to know what OpenLDAP does internally
> by way of linking entries back to their schema definitions, and when such
> linkages are used.
>
> > In general, once you start using a schema, you're stuck with it.
> > (Which is one
> > reason why ldapdelete for schema entries will never be implemented.)
>
> That makes no sense. Checking to see if there are entries that depend on
> the schema before attempting the delete and declining the delete if there
> are such entries makes sense.
But is very time consuming and resource intensive. E.g. checking for the 
presence of an AttributeType requires a full scan of the database if that 
AttributeType is not indexed, I think. Additionally this check would have to 
be done with the thread pool paused (i.e. no other operation would be 
processed) or at least with every database set into read only mode, to avoid
races. 
I am not even sure if it would be possilbe with all backends types that we 
currently support (think of back-ldap or back-meta). 

> A blanket refusal to do such a delete is inappropriate, IMO.
But the safest option we can currently offer, IMO.

[..]
> Not receiving any practical tips on how to update a whole private schema in
> one fell swoop, here's what I did and what seemed to work fine:
>
> 1) Delete all entries that depend on the schema you need to updated (used
> ldapmodify) 2) Shut down slapd
> 3) sudo rm /etc/ldap/slapd.d/cn=config/cn=schema/cn={4}myschema.ldif. 
> Change the last part to refer to your custom schema. I'm using latest
> Ubuntu Intrepid OpenLDAP, so the location of the cn=config dir may be
> different for you. 4) Restart slapd
> 5) Use ldapadd to add your modified schema
> 6) Use ldapadd to re-add your schema entries.
>
> This worked well for me, since I have entry deletion/creation ldif
> declarations that are automatically generated by our application....no
> problems detected so far.
>
> Anyone see any issues with this approach?
I should work I think.

> Seems to me that the whole alternate configuration approach using cn=config
> in the database is still very much a work in progress.
I'd say it works pretty well already in most cases. And yes of course things 
can always be improved. Help with that is always welcome, BTW.

-- 
Ralf