Re: [Nbd] NBD wishlist items?
On Fri, Jun 22, 2007 at 11:36:49AM -0400, Paul Clements wrote:
> Wouter Verhelst wrote:
> >I'm thinking it would be good to extend the protocol with two packets,
> >one PING and one PONG (or so) that could be sent by either the client or
> >the server, and that could allow either of them to check whether the
> >other is still there. It should include a timeout of (say) 60 seconds
> >(this could probably be negotiated during the handshake) during which
> >the other side has to reply with the appropriate packet; if it doesn't,
> >it is assumed dead and the connection will be killed.
>
> Yeah, that's the way to do it -- I actually hacked together something
> similar a long time back, but I've solved it well enough in user-space
> (by pinging the server address) so I never got the patch into the kernel.
Yes, but pinging the server only helps if it's the server that's dead;
it doesn't help to clean up stray nbd-server processes. It also doesn't
help if you want to use a rootfs that somehow involves NBD, as the LTSP
people want to.
A protocol extension that lets both the server and the client initiate
this keepalive probe would deal with both issues (provided we do not
somehow swap out nbd-client).
> >Implementing this backwards-compatibly is going to be the hardest part,
> >I guess. Perhaps opening one of the NBD devices to call a specific ioctl
> >to verify whether it supports this interface, and then setting a bit in
> >the field of 'reserved' bits in the handshake could work, but I'm not
> >sure how this would be best done.
>
> There'd probably be an ioctl to enable this ping packet, so you could
> just call the ioctl and ignore failure (for older kernels). Then there'd
> be a new packet flag for this ping packet (or maybe just use a
> zero-length read or write, assuming the nbd-server just ignores those
> and returns a response). That way it would almost completely backward
> compatible.
Sorry, I'm not sure I understand that bit. Could you elaborate?
--
<Lo-lan-do> Home is where you have to wash the dishes.
-- #debian-devel, Freenode, 2004-09-22
Reply to: