All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Teigland <teigland@redhat.com>
To: lvm-devel@redhat.com
Subject: Question: the failure handling for sanlock
Date: Mon, 15 Feb 2021 10:31:27 -0600	[thread overview]
Message-ID: <20210215163127.GA25608@redhat.com> (raw)
In-Reply-To: <20210214101303.GA399193@leoy-ThinkPad-X240s>

On Sun, Feb 14, 2021 at 06:13:03PM +0800, Leo Yan wrote:
>  538         /*
>  539          * FIXME: here is where we should implement a strong form of
>  540          * blkdeactivate, and if it completes successfully, automatically call
>  541          * do_drop() afterward.  (The drop step may not always be necessary
>  542          * if the lvm commands run while shutting things down release all the
>  543          * leases.)
>  544          *
>  545          * run_strong_blkdeactivate();
>  546          * do_drop();
>  547          */
> 
> My first question is why lvmlockctl comments out the failure handling code so
> cannot automatically deactivate drives and cleanup VG/LV locks by default?

Only because that forceful deactivate has not been implemented.

> The second question is what's a suggested flow for failure handling for sanlock?
> If I understand correctly, we can rely on the command "blkdeactivate" to
> deactivates block devices; but if we deactivate the whole block device, it
> might also hurt other VGs/LVs resident on the same drive.  So should we firstly
> deactivate VGs or LVs with "vgchange" or "lvchange" commands rather than
> deactivate the whole block device?  We might consider there have no chance to
> access drive for the drive or fabric malfunction, so cannot make succuss for
> commands "vgchange" and "lvchange".

We only need to forcefully deactivate LVs in the failed VG.  The lvmlockd
man page section "sanlock lease storage failure" describes how this
process can work manually, and mentions doing it automatically in the
future.  In the manual process you'd try to stop applications using the
fs, unmount file systems on the LVs, then try to deactivate the LVs.
Since there are storage issues, the unmount and deactivate might hang, in
which case you could try dmsetup wipe_table on the LVs.  You might just
skip immediately to that last step since there's not a lot of time.

There was a script written in 2017 to automate that final dmsetup step.
It was finished or very close, but I don't remember what kept us from
including it.  An idea to make dmsetup do more of the work perhaps left us
unsure what to do.  Here is the script and some discussion:
https://listman.redhat.com/archives/lvm-devel/2017-September/msg00011.html

There was also a small lvmlockctl patch to replace the
run_strong_blkdeactivate() comment with running the script.

If you can get this to work for your case I'd like to get it included in
lvm.

Dave



  reply	other threads:[~2021-02-15 16:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-14 10:13 Question: the failure handling for sanlock Leo Yan
2021-02-15 16:31 ` David Teigland [this message]
2021-02-22 11:33   ` Leo Yan
2021-02-24  3:16   ` Leo Yan
2021-02-24 18:21     ` David Teigland
2021-02-25 11:11       ` Leo Yan

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=20210215163127.GA25608@redhat.com \
    --to=teigland@redhat.com \
    --cc=lvm-devel@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.