tdb: add -k option to tdbtorture
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 22 Apr 2010 04:24:06 +0000 (13:54 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 22 Apr 2010 04:24:06 +0000 (13:54 +0930)
commite5af0ce79c74f11daae2a8514e398c40535e2e67
tree4d3f8ed92a61da98b5fa7f70b2494499c5b3d60b
parent65bc926d1a9cb3af18cae6b1462b832a5bcec561
tdb: add -k option to tdbtorture

To test the case of death of a process during transaction commit, add
a -k (kill random) option to tdbtorture.  The easiest way to do this
is to make every worker a child (unless there's only one child), which
is why this patch is bigger than you might expect.

Using -k without -t (always transactions) you expect corruption, though
it doesn't happen every time.  With -t, we currently get corruption but
the next patch fixes that.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from commit ececeffd85db1b27c07cdf91a921fd203006daf6)
lib/tdb/tools/tdbtorture.c