s3-passdb: Keep caches coherent

simo idra at samba.org
Sun Aug 21 18:19:07 MDT 2011


On Mon, 2011-08-22 at 09:10 +1000, Andrew Bartlett wrote:
> On Sun, 2011-08-21 at 16:40 +0200, Simo Sorce wrote:
> >     via  d713f9e s3-passdb: Only delete 1 entry from memcache.
> >        via  99bb3ee s3-passdb: Remove always the user from getpwsid
> > cache.
> >        via  1152aa8 s3-passdb: Keep caches coherent 
> 
> Andreas and Simo,
> 
> It seems you have also tripped across the passdb cache - I noticed it
> while working on the py_passdb layer, and wondered if you or anyone on
> the list knew the full background?
> 
> In particular, I wondered if anyone had any numbers on how much the
> passdb cache helps us, and if there is another way we could get that
> benefit?  As you have noticed, keeping the cache coherent takes quite a
> bit of effort.
> 
> In particular, we don't seem to have inter-processes cache coherency,
> except for the pdb_delete_user() call. 
> 
> The only call that uses the cache, as far as I can tell, is
> pdb_getsampwsid(), and it is only populated on pdb_getsampwnam()
> 
> I dug into the history of this cache, which has been moved around and
> re-factored many times, but never managed to find it's original
> incarnation.  Does anyone remember what it was added for?

No, I do not know where it comes from, and I made myself the same
questions. I suspect it may help some in the LDAP case, which can hit
pretty slow servers, but it i just a wild guess, another reason may be
long smbpasswd files.

But had no time to really dig it out so we did the minimum work
necessary to avoid tests failing, when you delete a user in one process
and expect it to be gone everywhere.

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer <simo at samba.org>
Principal Software Engineer at Red Hat, Inc. <simo at redhat.com>



More information about the samba-technical mailing list