All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilya Dryomov <idryomov@gmail.com>
To: Douglas Fuller <dfuller@redhat.com>
Cc: Josh Durgin <jdurgin@redhat.com>,
	Ceph Development <ceph-devel@vger.kernel.org>
Subject: Re: [PATCH 4/6] osd_client, rbd: update event interface for watch/notify2
Date: Wed, 17 Jun 2015 16:41:02 +0300	[thread overview]
Message-ID: <CAOi1vP_gS-0smEFYzZRggQ0msPVUkgjou-HqM=kG8UL57qdkfg@mail.gmail.com> (raw)
In-Reply-To: <16ACAFCB-0E28-4762-BDF9-E68B7FE5D817@redhat.com>

On Wed, Jun 17, 2015 at 4:28 PM, Douglas Fuller <dfuller@redhat.com> wrote:
>
>> On Jun 16, 2015, at 7:18 PM, Josh Durgin <jdurgin@redhat.com> wrote:
>>
>> On 06/12/2015 08:56 AM, Douglas Fuller wrote:
>>>
>>> @@ -3132,6 +3132,26 @@ static void rbd_watch_cb(u64 ver, u64 notify_id, u8 opcode, s32 return_code,
>>>              rbd_warn(rbd_dev, "notify_ack ret %d", ret);
>>>  }
>>>
>>> +static void rbd_watch_error_cb(void *arg, u64 cookie, int err)
>>> +{
>>> +    struct rbd_device *rbd_dev = (struct rbd_device *)arg;
>>> +    int ret;
>>> +
>>> +    dout("%s: watch error %d on cookie %llu\n", rbd_dev->header_name,
>>> +            err, cookie);
>>> +    rbd_warn(rbd_dev, "%s: watch error %d on cookie %llu\n",
>>> +             rbd_dev->header_name, err, cookie);
>>> +
>>> +    /* reset watch */
>>> +    rbd_dev_refresh(rbd_dev);
>>> +    rbd_dev_header_unwatch_sync(rbd_dev);
>>> +    ret = rbd_dev_header_watch_sync(rbd_dev);
>>> +    BUG_ON(ret); /* XXX: was the image deleted? can we be more graceful? */
>>> +    rbd_dev_refresh(rbd_dev);
>>
>> Why refresh before and after unwatching? Only the second one seems
>> necessary.
>
> The first one isn’t strictly necessary; I can remove it if you want.
>
> If we get a watch error, we may very well have a situation in which we need to stop I/O to the device because the underlying image has been deleted or its features have changed. We don’t actually do that yet (we just print a warning message), but the extra refresh was to handle that case early, even before we bothered trying to re-establish the watch.--

We should remove it, for consistency if nothing else.  Also, when you
are mapping image, it's rbd_dev_header_watch_sync() that fails if the
header object doesn't exist and such.  So I'd rather it failing in the
same place if an image got deleted from under a client or something
else went wrong instead of keeping in mind that it's the get_size (or
whatever) method that is called first on refresh and expect failures
there.

Thanks,

                Ilya
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2015-06-17 13:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-12 15:56 [PATCH 0/6] support watch/notify version 2 Douglas Fuller
2015-06-12 15:56 ` [PATCH 1/6] ceph/rbd: add support for watch notify payloads Douglas Fuller
2015-06-16 21:22   ` Josh Durgin
2015-06-12 15:56 ` [PATCH 2/6] ceph/rbd: add support for header version 2 and 3 Douglas Fuller
2015-06-16 21:23   ` Josh Durgin
2015-06-12 15:56 ` [PATCH 3/6] ceph/rbd: update watch-notify ceph_osd_op Douglas Fuller
2015-06-16 22:00   ` Josh Durgin
2015-06-12 15:56 ` [PATCH 4/6] osd_client, rbd: update event interface for watch/notify2 Douglas Fuller
2015-06-16 14:58   ` Mike Christie
2015-06-16 17:05     ` Douglas Fuller
2015-06-16 23:18   ` Josh Durgin
2015-06-17 13:28     ` Douglas Fuller
2015-06-17 13:41       ` Ilya Dryomov [this message]
2015-06-12 15:56 ` [PATCH 5/6] osd_client: add support for notify payloads via notify event Douglas Fuller
2015-06-16 15:26   ` Mike Christie
2015-06-16 17:22     ` Douglas Fuller
2015-06-12 15:56 ` [PATCH 6/6] osd_client: send watch ping messages Douglas Fuller
2015-06-16 15:07   ` Mike Christie

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='CAOi1vP_gS-0smEFYzZRggQ0msPVUkgjou-HqM=kG8UL57qdkfg@mail.gmail.com' \
    --to=idryomov@gmail.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=dfuller@redhat.com \
    --cc=jdurgin@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.