summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/tdb/tools/tdbtorture.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/tdb/tools/tdbtorture.c b/lib/tdb/tools/tdbtorture.c
index 9265cf07aa..0c9bbd613d 100644
--- a/lib/tdb/tools/tdbtorture.c
+++ b/lib/tdb/tools/tdbtorture.c
@@ -18,6 +18,7 @@
#define STORE_PROB 4
#define APPEND_PROB 6
#define TRANSACTION_PROB 10
+#define TRANSACTION_PREPARE_PROB 2
#define LOCKSTORE_PROB 5
#define TRAVERSE_PROB 20
#define TRAVERSE_READ_PROB 20
@@ -109,6 +110,11 @@ static void addrec_db(void)
goto next;
}
if (in_transaction && random() % TRANSACTION_PROB == 0) {
+ if (random() % TRANSACTION_PREPARE_PROB == 0) {
+ if (tdb_transaction_prepare_commit(db) != 0) {
+ fatal("tdb_transaction_prepare_commit failed");
+ }
+ }
if (tdb_transaction_commit(db) != 0) {
fatal("tdb_transaction_commit failed");
}