[PATCHES] Cleanup dead records in messages.tdb
Christof Schmitt
cs at samba.org
Wed Apr 2 18:04:07 MDT 2014
On Wed, Apr 02, 2014 at 01:20:34PM -0700, Jeremy Allison wrote:
> On Wed, Apr 02, 2014 at 01:19:50PM -0700, Jeremy Allison wrote:
> > On Wed, Apr 02, 2014 at 10:02:34PM +0200, Volker Lendecke wrote:
> > > On Wed, Apr 02, 2014 at 10:20:15AM -0700, Jeremy Allison wrote:
> > > > > Can we avoid the traverse in the normal case? Is it really
> > > > > that the smbds in your case left corrupt keys behind? In
> > > > > remove_child_pid we know which child died, so we could
> > > > > directly check and delete its record. Traverses always scare
> > > > > me :-)
> > > >
> > > > We could always add a new message MSG_SMB_MSG_VALIDATE
> > > > and have it act the same as MSG_SMB_BRL_VALIDATE does in
> > > > cleaning up the brl lock db. That way we only traverse
> > > > in the 'known child fail' case.
> > >
> > > The point is -- I want to avoid the traverse. I wanted to
> > > know from Christof whether there was more damage than just
> > > orphaned records. Those could be cleaned up in a more
> > > straightforward manner, avoiding traverse completely.
> >
> > Ah - I get what you want to do here. Let me have
> > a go at it ... :-).
>
> Or you can Christof, don't want to steal your
> thunder here :-).
I did not have much time today to follow-up on this. My thought was that
the messages.tdb is a local file, never managed by ctdb and it should be
small, so that traversals should only have a small impact. The advantage
of the traversal would be that it also catches stale records that for
some reason have not been cleaned up previously.
That said, i also see Volker's point that dead records in messages.tdb
should only result from unclean exits, and we can just remove the PID
from messages.tdb that just exited. That call could be added to
remove_child_pid().
I will rewrite the patch later this week.
Christof
More information about the samba-technical
mailing list