Hi all,
Today I have two questions involving indexing. First, my understanding is that if a new index has been added to slapd.conf, it won't be used until slapd is stopped, slapindex is run and slapd is started again. However, if there aren't any entries yet in the database that carry a new attribute to be indexed, then there's actually nothing to index. Also, the man page for it states that "Slapindex is used to regenerate slapd(8) indices based upon the current contents of a database." Could this also be a hint that slapindex does need relevant data to process before it can produce any indices? I expect to be wrong about this, but I'd rather be sure.
Second, regarding consumers, if a new index is added to a provider, does the same index also have to be added and (re)generated with slapindex on its consumers before it will be available there as well? I would expect so, but again, I'm not completely certain.
Thanks,
Jaap
Hi all,
Today I have two questions involving indexing. First, my understanding is that if a new index has been added to slapd.conf, it won't be used until slapd is stopped, slapindex is run and slapd is started again.
This is correct, since slapd needs to be restarted in order to read the modified slapd.conf. If you just modify the file, slapd won't know it's been modified. On the contrary, if you add the index by modifying cn=config accordingly, slapd does not need to be restarted, and slapindex does not need to be run.
However, if there aren't any entries yet in the database that carry a new attribute to be indexed, then there's actually nothing to index. Also, the man page for it states that "Slapindex is used to regenerate slapd(8) indices based upon the current contents of a database." Could this also be a hint that slapindex does need relevant data to process before it can produce any indices? I expect to be wrong about this, but I'd rather be sure.
Correct. If you know for sure that the newly indexed attribute is not contained in any entry in the database, you don't need to run slapindex.
Second, regarding consumers, if a new index is added to a provider, does the same index also have to be added and (re)generated with slapindex on its consumers before it will be available there as well? I would expect so, but again, I'm not completely certain.
If you want to index that attribute on the consumer, then you need to stop it, reconfigure it accordingly, run slapindex and restart slapd. There is no strict requirement about having identical indexes on the producer and on the consumers. However, it makes sense that if an attribute needs to be indexed, it needs to be everywhere.
p.
--On Thursday, December 17, 2009 2:52 PM +0100 Jaap Winius jwinius@umrk.nl wrote:
Hi all,
Today I have two questions involving indexing. First, my understanding is that if a new index has been added to slapd.conf, it won't be used until slapd is stopped, slapindex is run and slapd is started again. However, if there aren't any entries yet in the database that carry a new attribute to be indexed, then there's actually nothing to index. Also, the man page for it states that "Slapindex is used to regenerate slapd(8) indices based upon the current contents of a database." Could this also be a hint that slapindex does need relevant data to process before it can produce any indices? I expect to be wrong about this, but I'd rather be sure.
Second, regarding consumers, if a new index is added to a provider, does the same index also have to be added and (re)generated with slapindex on its consumers before it will be available there as well? I would expect so, but again, I'm not completely certain.
slapindex only needs to be run if the attribute already exists with data. Also, OpenLDAP 2.4, if you are using the config database instead of slapd.conf, can background the index generation task.
And yes, if you want the replicas to index the data, you need to add it to each of them.
--Quanah
--
Quanah Gibson-Mount Principal Software Engineer Zimbra, Inc -------------------- Zimbra :: the leader in open source messaging and collaboration
openldap-technical@openldap.org