diff options
author | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2016-07-12 02:51:18 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2017-03-21 17:26:08 +0100 |
commit | 66c272c383c52343b5a201ab59ca2e0e1ee8ee2c (patch) | |
tree | 0aa22d27d941d0692e67d829bfbb7e4e6584348c /doc | |
parent | 3909b0e2897f56b1b50d66c0bde76fcaa111ce25 (diff) | |
download | bcfg2-66c272c383c52343b5a201ab59ca2e0e1ee8ee2c.tar.gz bcfg2-66c272c383c52343b5a201ab59ca2e0e1ee8ee2c.tar.bz2 bcfg2-66c272c383c52343b5a201ab59ca2e0e1ee8ee2c.zip |
Server/Plugins/Ldap: Cache the results of the Ldap queries
Using the OnDemandDict removes the results of Ldap queries from the
client_metadata cache. We add a new cache per hostname cache for the
single ldap queries and add a new configuration option to enable
caching until the cache is expired manually via XML-RPC.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/development/caching.txt | 3 | ||||
-rw-r--r-- | doc/server/plugins/grouping/ldap.txt | 26 |
2 files changed, 23 insertions, 6 deletions
diff --git a/doc/development/caching.txt b/doc/development/caching.txt index 83ec0290f..c8b7aba14 100644 --- a/doc/development/caching.txt +++ b/doc/development/caching.txt @@ -67,6 +67,9 @@ Currently known caches are: | pkg_sets | <Collection.cachekey>`, | | for clients | | | hash of the initial package selection | | | +-------------+---------------------------------------+-------------------------------------------------+------------------------------------------------------+ +| Ldap, | Hostname, ``<query name>`` | :func:`processed result of the query | Cached results from the Ldap queries | +| results, | | <Bcfg2.Server.Plugins.LdapQuery.process_result>`| | ++-------------+---------------------------------------+-------------------------------------------------+------------------------------------------------------+ These are enumerated so that they can be expired as needed by other plugins or other code points. diff --git a/doc/server/plugins/grouping/ldap.txt b/doc/server/plugins/grouping/ldap.txt index af18680d2..311bab9f5 100644 --- a/doc/server/plugins/grouping/ldap.txt +++ b/doc/server/plugins/grouping/ldap.txt @@ -87,6 +87,26 @@ If you wish, you could customize these values in your ``bcfg2.conf``:: retries = 3 retry_delay = 3.0 +Caching ++++++++ + +This module could not know, if a value changed on the LDAP server. So it does not cache +the results of the LDAP queries by default. + +You could enable the cache of the results in your ``bcfg2.conf``: + + [ldap] + cache = on + +If you enable the caching, you have to expire it manually. This module provides a XML-RPC +method for this purpose: :func:`Ldap.expire_cache +<Bcfg2.Server.Plugins.Ldap.expire_cache>`. + +Even without enabling caching, the results of the LDAP queries are cached, but are +discarded before each client run. If you access the Ldap results of different client, you +may get cached results of the last run of this client. If you do not want this behaviour, +you can disable the caching completely by setting it to ``off``. + Class reference --------------- @@ -251,9 +271,3 @@ Known Issues ------------ * At this point there is no support for SSL/TLS. -* This module could not know, if a value changed on the LDAP server. So it could not - expire the client metadata cache sanely. - If you are using aggressive caching mode, this plugin will expire the metadata cache - for a single client at the start of a client run. If you are using LDAP data from - another client in a template, you will probably get the cached values from the last - client run of that other client. |