]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb/tools/tdbtorture.c
Completely unhobble tdbtorture.
[ccan] / ccan / tdb / tools / tdbtorture.c
index aadc8afa3aa8e42cd7f03c1257dbe986c67625e1..796fe26cc008eeba973bf9812ca731bf12fd24ce 100644 (file)
@@ -20,7 +20,6 @@
 #define DELETE_PROB 8
 #define STORE_PROB 4
 #define APPEND_PROB 6
-#if 0
 #define TRANSACTION_PROB 10
 #define TRANSACTION_PREPARE_PROB 2
 #define LOCKSTORE_PROB 5
@@ -28,7 +27,6 @@
 #define TRAVERSE_READ_PROB 20
 #define TRAVERSE_MOD_PROB 100
 #define TRAVERSE_ABORT_PROB 500
-#endif
 #define CULL_PROB 100
 #define KEYLEN 3
 #define DATALEN 100
@@ -144,6 +142,7 @@ static void addrec_db(void)
                in_transaction--;
                goto next;
        }
+
        if (in_traverse == 0 && in_transaction && random() % TRANSACTION_PROB == 0) {
                if (tdb_transaction_cancel(db) != 0) {
                        fatal("tdb_transaction_cancel failed");