[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Nbd] [PATCH] Add transaction log support and integrity test



On Sat, May 21, 2011 at 09:18:36AM +0100, Alex Bligh wrote:
> This patch introduces transaction logs and an integrity test.
> A transaction log consists of the protocol bytes moved between server
> and client EXCEPT for the data itself. This is useful for debugging,
> and also for replaying against a server to perform an integrity
> test of that server.
> 
> nbd-tester-client now includes an integrity test, which replays
> a transaction log, generating test data to write for write requests,
> and checking read requests read the same data back. I believe that
> prior to this test, no real integrity checking of data was performed.

Correct, mainly because I hadn't sat down and done it yet. Thanks :-)

> The shipped transaction log includes a tar plus untar, plus a dbench
> run.
> 
> I believe this patch also fixes a bug in handling large requests. This
> element:
> > @@ -1520,6 +1536,7 @@ int mainloop(CLIENT *client) {
> >  				DEBUG("buf->net, ");
> >  				writeit(client->net, buf, writelen);
> >  				len -= currlen;
> > +				request.from += currlen;
> >  				currlen = (len < BUFSIZE) ? len : BUFSIZE;
> >  				p = buf;
> >  				writelen = currlen;
> shows request.from was not being incremented on a large read, which
> caused expread() to read the data from the same place in the
> file on each iteration of the while loop. This could cause
> data corruption.

Right, thanks for catching that.

[...]
> nbd-tester-client.tr is made using the "maketr" script. The reason for
> not making this as part of the build process is that
> a) it needs to be run as root
> b) it introduces a number of different dependencies (including
>    dbench, an an arbitrary large tarball).
> c) it can be rebuilt easily, but will inevitably contain slightly
>    different data
> d) the build process is linux specific, whereas the output is
>    OS independent.
  e) if we're going to test a server's functionality, it's generally a
     good idea not to generate data for that test by the same (possibly
     broken) implementation of that server itself (even if it is highly
     unlikely for wrong data to cause the test to produce a false
     positive, as is the case here).

-- 
The volume of a pizza of thickness a and radius z can be described by
the following formula:

pi zz a



Reply to: