From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Eric Blake <eblake@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Jiahui Cen <cenjiahui@huawei.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
John Snow <jsnow@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
zhang.zhanghailiang@huawei.com, fangying1@huawei.com
Subject: Re: [PATCH v5 0/9] block: Add retry for werror=/rerror= mechanism
Date: Thu, 25 Feb 2021 20:24:04 +0300 [thread overview]
Message-ID: <98889aad-0ade-e8fd-080b-ca45b237d9d8@virtuozzo.com> (raw)
In-Reply-To: <92e02bd7-7f29-01b2-91e8-73c3fc689cba@redhat.com>
23.02.2021 16:41, Eric Blake wrote:
> On 2/23/21 3:40 AM, Stefan Hajnoczi wrote:
>> On Fri, Feb 05, 2021 at 06:13:06PM +0800, Jiahui Cen wrote:
>>> This patch series propose to extend the werror=/rerror= mechanism to add
>>> a 'retry' feature. It can automatically retry failed I/O requests on error
>>> without sending error back to guest, and guest can get back running smoothly
>>> when I/O is recovred.
>>
>> This patch series implements a retry followed by werror/rerror=report
>> after a timeout. This mechanism could be made more generic (and the code
>> could be simplified) by removing the new werror/rerror=retry action and
>> instead implementing the retry/timeout followed by *any* werror=/rerror=
>> policy chosen by the user.
>>
>> In other words, if the retry interval is non-zero, retry the request and
>> check for timeouts. When the timeout is reached, obey the
>> werror=/rerror= action.
>>
>> This is more flexible than hard-coding werror=retry to mean retry
>> timeout followed by werror=report.
>>
>> For example:
>>
>> werror=stop,write-retry-interval=1000,write-retry-timeout=15000,
>> rerror=report,read-retry-interval=1000,read-retry-timeout=15000
>>
>> Failed write requests will be retried once a second for 15 seconds.
>> If the timeout is reached the guest is stopped.
>>
>> Failed read requests will be retried once a second for 15 seconds. If
>> the timeout is reached the error is reported to the guest.
>
> You may also want to look at what the NBD block device already
> implements for retries, and see if making retry generic to the block
> layer in general can do everything already possible in the NBD code, at
> which point the NBD code can be simplified. Vladimir (added in cc) is
> the best point of contact there.
>
Hi!
There are some specific things for retrying in NBD client code, that may not make sense for generic code:
We try to handle not some generic error but tcp connection problems. So
1. We NBD retries we wanted to retry only requests failed due to connection loss.
So, if NBD server successfully reply with -EIO to client request, we don't retry and just report -EIO.
Such things can be distinguished only inside NBD driver.
2. Timeout is specific too: we start timer when we detected the connection lost for the first time.
During the specified time all current requests are waiting for reconnect, they'll be retried if
connection established.
On timeout all current requests (waiting for reconnect) will report failure, as well as all further
requests will report failure immediately (until successful reconnect).
Still, of course, NBD driver is over-complicated by reconnect feature (especially with reconnect thread:) and
it would be cool to split some parts to be separate...
--
Best regards,
Vladimir
prev parent reply other threads:[~2021-02-25 17:26 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-05 10:13 [PATCH v5 0/9] block: Add retry for werror=/rerror= mechanism Jiahui Cen
2021-02-05 10:13 ` [PATCH v5 1/9] qapi/block-core: Add retry option for error action Jiahui Cen
2021-02-22 17:22 ` Stefan Hajnoczi
2021-02-05 10:13 ` [PATCH v5 2/9] block-backend: Introduce retry timer Jiahui Cen
2021-02-05 10:13 ` [PATCH v5 3/9] block-backend: Add device specific retry callback Jiahui Cen
2021-02-22 17:24 ` Stefan Hajnoczi
2021-02-05 10:13 ` [PATCH v5 4/9] block-backend: Enable retry action on errors Jiahui Cen
2021-02-22 17:12 ` Stefan Hajnoczi
2021-02-05 10:13 ` [PATCH v5 5/9] block-backend: Add timeout support for retry Jiahui Cen
2021-02-05 10:13 ` [PATCH v5 6/9] block: Add error retry param setting Jiahui Cen
2021-02-22 17:16 ` Stefan Hajnoczi
2021-02-05 10:13 ` [PATCH v5 7/9] virtio_blk: Add support for retry on errors Jiahui Cen
2021-02-05 10:13 ` [PATCH v5 8/9] scsi-bus: Refactor the code that retries requests Jiahui Cen
2021-02-05 10:13 ` [PATCH v5 9/9] scsi-disk: Add support for retry on errors Jiahui Cen
2021-02-10 1:22 ` [PATCH v5 0/9] block: Add retry for werror=/rerror= mechanism Jiahui Cen
2021-02-22 11:00 ` Stefan Hajnoczi
2021-02-22 17:25 ` Stefan Hajnoczi
2021-02-23 9:40 ` Stefan Hajnoczi
2021-02-23 10:20 ` Jiahui Cen
2021-02-23 13:41 ` Eric Blake
2021-02-25 17:24 ` Vladimir Sementsov-Ogievskiy [this message]
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=98889aad-0ade-e8fd-080b-ca45b237d9d8@virtuozzo.com \
--to=vsementsov@virtuozzo.com \
--cc=armbru@redhat.com \
--cc=cenjiahui@huawei.com \
--cc=eblake@redhat.com \
--cc=fangying1@huawei.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=zhang.zhanghailiang@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).