tdb: add -k option to tdbtorture
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 24 Feb 2010 00:23:05 +0000 (10:53 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 24 Feb 2010 00:23:05 +0000 (10:53 +1030)
commitececeffd85db1b27c07cdf91a921fd203006daf6
tree6eed31503cfe5af4c348bb00d4db8cc92cf9b7e7
parent8c3fda4318adc71899bc41486d5616da3a91a688
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>
lib/tdb/tools/tdbtorture.c