[SSSD] [PATCHES] sss_cache tool invalidates records in memory cache

Michal Židek mzidek at redhat.com
Fri Sep 14 15:16:08 UTC 2012


On 09/13/2012 07:59 PM, Simo Sorce wrote:
> Main questions:
> the invalidation functions seem to be called unconditionally, what
> prevent cache invalidation durint a normal log rotation ?
> Shouldn't cache invalidation happen exclusively when sss_cache is asking
> to drop caches ?
>

It would be nice to have these two operations separate, but I do not
know how to do it if we are to use SIGHUP for this. The application
does not know what is the origin of SIGHUP, so it has to do both
operations. For now, I wrote FIXME comment to the code in the new patch.

Question: What do we plan to use to signal SSSD to reload configuration
during runtime? Isn't it SIGHUP too? I am not sure now, but if it is 
SIGHUP, then we need to reinitialize memory caches every time SIGHUP is
received by monitor (this is what the patch does right know). So maybe
it is not that bad after all.

>
> Nack:
>
> I do not like the following function as it is largely a copy/paste of
> sss_mmap_cache_init.
> Why donp;t you simply pass a pointer to struct sss_mc_ctx *mc_ctx
> release it, and then simply call sss_mmap_cache_init() from scratch ?
>
> Also n_elem is currently hardcoded, so saving it is not really useful,
> however I would also *really* not save it as on cache invalidation you
> will want to go and see if the configuration also changed and get the
> new number of elements.
> This is a perfect time to do that because you are killing the old file
> and creating a new one so changing size during this operation is
> actually a good idea (if needed).
>
> Same for memcache_timeout parameters (which are already parametrized and
> can be fetched from CONFDB_NSS_CONF_ENTRY / CONFDB_MEMCACHE_TIMEOUT
>

I removed the old invalidate function and created new called
sss_mmap_cache_reinit. This function is used for re-initialize
already initialized memory cache. I think the name is more suitable,
because it now allows to change entry timeout and cache size.

New patches are attached.

Thanks
Michal

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-tools_util.h-provides-signal_sssd-function.patch
Type: text/x-patch
Size: 7395 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20120914/3507421a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-sss_cache-tool-invalidates-records-in-memory-cache.patch
Type: text/x-patch
Size: 6419 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20120914/3507421a/attachment-0001.bin>


More information about the sssd-devel mailing list