All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gregory Farnum <gfarnum@redhat.com>
To: Mauricio Garavaglia <mauricio@medallia.com>,
	Jason Dillaman <dillaman@redhat.com>
Cc: ceph-devel <ceph-devel@vger.kernel.org>
Subject: Re: Prevent rbd mapping/mounting on multiple hosts workaround
Date: Mon, 8 Feb 2016 07:41:40 -0800	[thread overview]
Message-ID: <CAJ4mKGb4x3Wn=hK_qz_p-fkWxcjQSJnotX=mz4pfM-DyPCQxZw@mail.gmail.com> (raw)
In-Reply-To: <CAAVaRixPMWYibHFmmZmVgYB3RjPWaO2-gEhoyTnCHpBkkZjbgQ@mail.gmail.com>

On Fri, Feb 5, 2016 at 6:24 AM, Mauricio Garavaglia
<mauricio@medallia.com> wrote:
> Hello,
>
> In the January Tech Talk (PostgreSQL on Ceph under Mesos/Aurora with
> Docker [https://youtu.be/OqlC7S3cUKs]) we presented a challenge we are
> facing at Medallia when running databases on ceph under
> mesos/aurora/docker; which is related to prevent mapping/mounting the
> same rbd image in two hosts at the same time during network
> partitions.
>
> As a workaround it was mentioned that we are wrapping rbd in a shell
> script that executes extra logic around certain operations:
>
> - On Map; rbd lock add <image>
>         - If no success; then
>                 - "rbd status <image>": check for Watchers, 3 times each 15 secs
>                         - If found, ABORT the mapping. The image is
> still in use in a host that is healthy
>                 - "ceph osd blacklist add <previous lock holder>".
> Image locked without a watcher
>                 - steal the lock in <image>
>         - map the image
>
> - On Unmap;
>         - rbd lock remove
>
> - On reboot of server;
>         - "ceph osd blacklist rm <self>"
>
> I was wondering if this mechanism could be incorporated as part of the
> rbd CLI, of course controlled by an option during map. We'll be happy
> to work on it, but want to check the feasibility of having the patch
> accepted.

I actually thought we had a disable-by-default config option in later
releases that grab the locks before allowing a mount, but now I can't
find it. Jason?
-Greg

  reply	other threads:[~2016-02-08 15:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAAVaRixeAPiyK2Xx1=nXAZBD=8ckctgFV=6Ag2EyTsAGhPrPUw@mail.gmail.com>
2016-02-05 14:24 ` Fwd: Prevent rbd mapping/mounting on multiple hosts workaround Mauricio Garavaglia
2016-02-08 15:41   ` Gregory Farnum [this message]
2016-02-08 20:44     ` Jason Dillaman
2016-02-08 22:41       ` Bill Sanders
2016-02-09  1:25         ` Jason Dillaman

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='CAJ4mKGb4x3Wn=hK_qz_p-fkWxcjQSJnotX=mz4pfM-DyPCQxZw@mail.gmail.com' \
    --to=gfarnum@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=dillaman@redhat.com \
    --cc=mauricio@medallia.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.