All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Teigland <teigland@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] Question on LVB when the node that held EX lock crash
Date: Wed, 16 Nov 2016 09:08:12 -0600	[thread overview]
Message-ID: <20161116150812.GA27810@redhat.com> (raw)
In-Reply-To: <80ce8256-5489-9ca5-508f-ed740f0fa9f2@suse.com>

On Wed, Nov 16, 2016 at 04:42:09PM +0800, Eric Ren wrote:
> On 11/16/2016 04:29 PM, Eric Ren wrote:
> > Hi David and all,
> > 
> > I am debugging an issue of ocfs2 that relates to LVB value. I will try
> > to make it a pure DLM question:
> > 
> > Two nodes (N1, N2) try to truncate the same file(R1) concurrently.
> > 
> > N1                                         N2
> > lock(R1, EX)
> > changing LVB: x
> >                                               lock(R1, EX)
> > convert(R1, NULL)
> > flush LVB
> >                                               changing LVB: x -> y
> >                                               crash
> 
> Hmm, here should be a long story of DLM recovery;-)
> 
> Eric
> > convert(R1, EX)
> > get LVB
> > Qustion: what is the LVB then? x or y?
> > ======
> > 
> > Is this a valid question? or am I missing something?

It's a good question, and it's been enough years that the details are now
hazy.  I think the current behavior emulates the original VMS dlm model
fairly well, so any documentation you can find on that may help.

If you look at the recover_lvb() comment, you'll see a little information
about this.  The LVB can be lost in a crash in some fairly common cases,
and in those cases, the dlm should set the VALNOTVALID flag to tell the
application that the LVB may be lost/stale.  So, an application cannot
rely entirely on the LVB, and must be able to go without it, or
reconstruct the value, i.e. the LVB data is usually used as part of an
optimization (e.g. caching).

The two cases mentioned in that comment are:

1. if N1 was R1 master when N2 crashed: N1 would purge the EX lock from
N2, and set VALNOTVALID on R1, because the latest LVB from N2 was never
seen by N1.

2. if N2 was R1 master when N2 crashed: N1 would become the new R1 master
(if it kept a NL lock on it), and would set VALNOTVALID because it doesn't
know if N2 had any EX locks from other nodes that might have also crashed,
or an LVB that had been updated since N1 last saw it.

Dave



  reply	other threads:[~2016-11-16 15:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-16  8:29 [Cluster-devel] Question on LVB when the node that held EX lock crash Eric Ren
2016-11-16  8:42 ` Eric Ren
2016-11-16 15:08   ` David Teigland [this message]
2016-11-17  9:30     ` Eric Ren
2016-11-30  9:07     ` Eric Ren
2016-11-30 16:16       ` David Teigland
2016-12-01  9:51         ` Eric Ren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161116150812.GA27810@redhat.com \
    --to=teigland@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.