qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: nick@bytemark.co.uk
To: qemu-devel@nongnu.orgqemu-devel@nongnu.org
Cc: pbonzini@redhat.com, Nick Thomas <nick@bytemark.co.uk>
Subject: [Qemu-devel] [PATCH 0/3] NBD reconnection behaviour
Date: Mon, 22 Oct 2012 12:09:16 +0100	[thread overview]
Message-ID: <cover.1350901963.git.nick@bytemark.co.uk> (raw)

[-- Attachment #1: Type: text/plain, Size: 44 bytes --]

This is a multi-part message in MIME format.

[-- Attachment #2: Type: text/plain, Size: 1767 bytes --]


Hi all,

This patchset is about making the NBD backend more useful. Currently,
when the NBD server disconnects, the block device in the guest becomes
unusable with no option to recover except to restart the QEMU process.
These patches introduce a reconnect timer that fires every five
seconds until we successfully reconnect.

I/O requests that are inflight when the disconnection occurs, or
requested while disconnected, are failed with an EIO - so the usual
werror/rerror settings apply in those circumstances.

All this means that, assuming you can get the NBD server up again,
only some I/O requests are failed, rather than all of them.

I've got a few more changes to make - specifically:

  * Allowing the reconnect timer delay to be configurable
  * Queuing and retrying I/O requests instead of EIO
  * Proactively killing the TCP connection if the server doesn't
    respond after a timeout.

The rationale for the second is that some guests remount discs r/o
if I/O requests fail (rather than apparently hang), which is a pain.
The third allows us to quickly detect if a TCP connection disappears
without a trace. 

However, I think these patches stand as an improvement on the curent
situation, and I'd rather like some feedback on the best way to do
the futher bits - assuming these patches get eventually accepted!


Nick Thomas (3):
  nbd: Only try to send flush/discard commands if connected to the NBD
    server
  nbd: Explicitly disconnect and fail inflight I/O requests on error,
    then reconnect next I/O request.
  nbd: Move reconnection attempts from each new I/O request to a
    5-second timer

 block/nbd.c |  117 +++++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 93 insertions(+), 24 deletions(-)

-- 
1.7.2.5


             reply	other threads:[~2012-10-22 11:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-22 11:09 nick [this message]
2012-10-22 11:09 ` [Qemu-devel] [PATCH 1/3] nbd: Only try to send flush/discard commands if connected to the NBD server nick
2012-10-23 10:33   ` Kevin Wolf
2012-10-23 11:08     ` Nicholas Thomas
2012-10-23 11:26       ` Kevin Wolf
2012-10-23 15:02       ` Jamie Lokier
2012-10-24 12:16         ` Nicholas Thomas
2012-10-24 12:57           ` Kevin Wolf
2012-10-24 14:32             ` Jamie Lokier
2012-10-24 15:16               ` Paolo Bonzini
2012-10-25  6:36               ` Kevin Wolf
2012-10-25 17:09                 ` Jamie Lokier
2012-10-26  7:59                   ` Kevin Wolf
2012-10-24 14:03           ` Paolo Bonzini
2012-10-24 14:10             ` Paolo Bonzini
2012-10-24 14:12               ` Nicholas Thomas
2012-10-22 11:09 ` [Qemu-devel] [PATCH 2/3] nbd: Explicitly disconnect and fail inflight I/O requests on error, then reconnect next I/O request nick
2012-10-23 10:40   ` Kevin Wolf
2012-10-24 14:31   ` Paolo Bonzini
2012-10-22 11:09 ` [Qemu-devel] [PATCH 3/3] nbd: Move reconnection attempts from each new I/O request to a 5-second timer nick

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=cover.1350901963.git.nick@bytemark.co.uk \
    --to=nick@bytemark.co.uk \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.orgqemu-devel \
    /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).