Issue 8788 - slapd-pcache undef not compatible with mdb
Summary: slapd-pcache undef not compatible with mdb
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: documentation (show other issues)
Version: 2.4.45
Hardware: All All
: --- normal
Target Milestone: 2.6.0
Assignee: Quanah Gibson-Mount
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-11 15:02 UTC by Quanah Gibson-Mount
Modified: 2021-10-25 22:05 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 Quanah Gibson-Mount 2017-12-11 15:02:05 UTC
Full_Name: Quanah Gibson-Mount
Version: 2.4.45
OS: N/A
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (47.208.148.239)


The pcache backend to slapd has the option for attr sets to note if an attribute
that being cached is not defined in the local schema by prefixing it with
"undef:", such as "undef:myattr".  While this functionality works fine when
pcache is using back-bdb or back-hdb, it does not work with back-mdb.  In the
case where back-mdb is used, an error will be logged if the hidden "pcaache"
loglevel is used, but it will still attempt to answer queries (it will return no
results, but with a success return code).


At a minimum, the documentation needs to be updated to note this feature
incompatibility.  It would be additionally useful if either slapd would refuse
to start if undef was used on top of back-mdb, or pcache would log an error that
it could not answer the result from the cache, and fall back to doing a direct
lookup.
Comment 1 Howard Chu 2017-12-11 17:15:32 UTC
quanah@openldap.org wrote:
> Full_Name: Quanah Gibson-Mount
> Version: 2.4.45
> OS: N/A
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (47.208.148.239)
> 
> 
> The pcache backend to slapd has the option for attr sets to note if an attribute
> that being cached is not defined in the local schema by prefixing it with
> "undef:", such as "undef:myattr".  While this functionality works fine when
> pcache is using back-bdb or back-hdb, it does not work with back-mdb.  In the
> case where back-mdb is used, an error will be logged if the hidden "pcaache"
> loglevel is used, but it will still attempt to answer queries (it will return no
> results, but with a success return code).

pcache uses slap_bv2tmp_ad() to register undef attributes. It looks like 
there's a bug here in that it doesn't initialize ad->ad_index. (bv2undef 
initializes this to zero.) Of course, that still doesn't change the fact that 
back-mdb requires schema to be fully defined.

> At a minimum, the documentation needs to be updated to note this feature
> incompatibility.  It would be additionally useful if either slapd would refuse
> to start if undef was used on top of back-mdb, or pcache would log an error that
> it could not answer the result from the cache, and fall back to doing a direct
> lookup.

-- 
   -- 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 2 Quanah Gibson-Mount 2021-06-23 15:40:32 UTC
Need to document in pcache manpage that undef option is not compatible with back-mdb as it requires a fully defined schema.
Comment 4 Quanah Gibson-Mount 2021-06-24 18:42:16 UTC
Commits: 
  • f6dcc600 
by Quanah Gibson-Mount at 2021-06-24T17:48:21+00:00 
ITS#8788 - Document that "undef" is not usable with back-mdb