diff options
author | se <se@FreeBSD.org> | 2012-07-04 09:02:12 +0000 |
---|---|---|
committer | se <se@FreeBSD.org> | 2012-07-04 09:02:12 +0000 |
commit | 8b8c2303a1367a15ab7a322db29473fd4b7f5e89 (patch) | |
tree | 1159be7852686e97260b128780be12bec0efb726 /usr.sbin/nscd/cachelib.h | |
parent | e5f970ed4ae0b5e770b2a67c389d8eb77ec82993 (diff) | |
download | FreeBSD-src-8b8c2303a1367a15ab7a322db29473fd4b7f5e89.zip FreeBSD-src-8b8c2303a1367a15ab7a322db29473fd4b7f5e89.tar.gz |
Add the possibility to specify a threshold for the number of negative cache
results required to have the cache return lookup failure.
A new configuration parameter is introduced, which must be set to a value
greater than 1 to activate this feature. The default behavior is unchanged.
The purpose of this change is to allow probes for the existence of an entry
(which are expected to fail), before that entry is added to one of the
queried databases, without the cache returning the stale information from
the probe query until that cache entry expires. If, for example, a new user
account is created after checking that the new account name is available,
the negative cache entry would prevent immediate access to the account.
For that example, the new configuration option
negative-confidence-threshold passwd 2
will require a second negative query result to consider the negative cache
entry for a passwd entry valid, but if the user account has been created
between the queries, then the positive query result from the second query
will be cached and returned.
Diffstat (limited to 'usr.sbin/nscd/cachelib.h')
-rw-r--r-- | usr.sbin/nscd/cachelib.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.sbin/nscd/cachelib.h b/usr.sbin/nscd/cachelib.h index 37f0041..9df50e7 100644 --- a/usr.sbin/nscd/cachelib.h +++ b/usr.sbin/nscd/cachelib.h @@ -92,6 +92,7 @@ struct common_cache_entry_params { size_t satisf_elemsize; /* if entry size is exceeded, * this number of elements will be left, * others will be deleted */ + int confidence_threshold; /* number matching replies required */ struct timeval max_lifetime; /* if 0 then no check is made */ enum cache_policy_t policy; /* policy used for transformations */ }; @@ -116,6 +117,7 @@ struct cache_ht_item_data_ { size_t value_size; struct cache_policy_item_ *fifo_policy_item; + int confidence; /* incremented for each verification */ }; struct cache_ht_item_ { |