proxycache \fBbdb 10000 1 50 100\fP
.RE
+.TP
+.B proxyattrset <index> <attrs...>
+Used to associate a set of attributes <attrs..> with an <index>. Each attribute
+set is associated with an integer from 0 to <numattrsets>-1. These indices are
+used by the \fBproxytemplate\fP directive to define cacheable templates.
+A set of attributes cannot be empty. A set of attributes can contain the
+special attributes "*" (all user attributes), "+" (all operational attributes)
+or both; in the latter case, any other attribute is redundant and should
+be avoided for clarity. A set of attributes can contain "1.1" as the only
+attribute; in this case, only the presence of the entries is cached.
+
.TP
.B proxycachequeries <queries>
Specify the maximum number of queries to cache. The default is 10000.
+.TP
+.B proxycheckcacheability { TRUE | FALSE }
+Check whether the results of a query being cached can actually be returned
+from the cache by the proxy DSA. When enabled, the entries being returned
+while caching the results of a query are checked to ensure consistency
+with the schema known to the proxy DSA. In case of failure, the query
+is not cached. By default, the check is off.
+
.TP
.B proxysavequeries { TRUE | FALSE }
Specify whether the cached queries should be saved across restarts
If new sets and templates are added, or if other details of the pcache
overlay configuration changed, this feature should not be affected.
-.TP
-.B proxyattrset <index> <attrs...>
-Used to associate a set of attributes <attrs..> with an <index>. Each attribute
-set is associated with an integer from 0 to <numattrsets>-1. These indices are
-used by the \fBproxytemplate\fP directive to define cacheable templates.
-A set of attributes cannot be empty. A set of attributes can contain the
-special attributes "*" (all user attributes), "+" (all operational attributes)
-or both; in the latter case, any other attribute is redundant and should
-be avoided for clarity. A set of attributes can contain "1.1" as the only
-attribute; in this case, only the presence of the entries is cached.
-
.TP
.B proxytemplate <template_string> <attrset_index> <ttl> [<negttl> [<limitttl>]]
Specifies a cacheable template and "time to live" <ttl> of queries
unsigned long num_cached_queries; /* total number of cached queries */
unsigned long max_queries; /* upper bound on # of cached queries */
int save_queries; /* save cached queries across restarts */
+ int check_cacheability; /* check whether a query is cacheable */
int numattrsets; /* number of attribute sets */
int cur_entries; /* current number of entries cached */
int max_entries; /* max number of entries cached */
if ( !si->over ) {
/* check if the entry contains undefined
* attributes/objectClasses (ITS#5680) */
- if ( test_filter( op, rs->sr_entry, si->query.filter ) != LDAP_COMPARE_TRUE ) {
+ if ( cm->check_cacheability && test_filter( op, rs->sr_entry, si->query.filter ) != LDAP_COMPARE_TRUE ) {
Debug( pcache_debug, "%s: query not cacheable because of schema issues in DN \"%s\"\n",
op->o_log_prefix, rs->sr_entry->e_name.bv_val, 0 );
goto over;
"( OLcfgOvAt:2.6 NAME 'olcProxySaveQueries' "
"DESC 'Save cached queries for hot restart' "
"SYNTAX OMsBoolean )", NULL, NULL },
+ { "proxyCheckCacheability", "TRUE|FALSE",
+ 2, 2, 0, ARG_ON_OFF|ARG_OFFSET, (void *)offsetof(cache_manager, check_cacheability),
+ "( OLcfgOvAt:2.7 NAME 'olcProxyCheckCacheability' "
+ "DESC 'Check whether the results of a query are cacheable, e.g. for schema issues' "
+ "SYNTAX OMsBoolean )", NULL, NULL },
{ NULL, NULL, 0, 0, 0, ARG_IGNORED }
};
"DESC 'ProxyCache configuration' "
"SUP olcOverlayConfig "
"MUST ( olcProxyCache $ olcProxyAttrset $ olcProxyTemplate ) "
- "MAY ( olcProxyResponseCB $ olcProxyCacheQueries $ olcProxySaveQueries ) )",
+ "MAY ( olcProxyResponseCB $ olcProxyCacheQueries $ olcProxySaveQueries $ olcProxyCheckCacheability ) )",
Cft_Overlay, pccfg, NULL, pc_cfadd },
{ "( OLcfgOvOc:2.2 "
"NAME 'olcPcacheDatabase' "
cm->cur_entries = 0;
cm->max_queries = 10000;
cm->save_queries = 0;
+ cm->check_cacheability = 0;
cm->response_cb = PCACHE_RESPONSE_CB_TAIL;
cm->defer_db_open = 1;
cm->cc_period = 1000;