Browse Source

tdb2: enable transactions in tdbtorture

Rusty Russell 15 years ago
parent
commit
04b2feefda
1 changed files with 3 additions and 5 deletions
  1. 3 5
      ccan/tdb2/tools/tdbtorture.c

+ 3 - 5
ccan/tdb2/tools/tdbtorture.c

@@ -20,8 +20,8 @@
 #define DELETE_PROB 8
 #define DELETE_PROB 8
 #define STORE_PROB 4
 #define STORE_PROB 4
 #define APPEND_PROB 6
 #define APPEND_PROB 6
-//#define TRANSACTION_PROB 10
-//#define TRANSACTION_PREPARE_PROB 2
+#define TRANSACTION_PROB 10
+#define TRANSACTION_PREPARE_PROB 2
 #define LOCKSTORE_PROB 5
 #define LOCKSTORE_PROB 5
 #define TRAVERSE_PROB 20
 #define TRAVERSE_PROB 20
 #define TRAVERSE_READ_PROB 20
 #define TRAVERSE_READ_PROB 20
@@ -171,9 +171,7 @@ static void addrec_db(void)
 	}
 	}
 
 
 	if (in_traverse == 0 && in_transaction && random() % TRANSACTION_PROB == 0) {
 	if (in_traverse == 0 && in_transaction && random() % TRANSACTION_PROB == 0) {
-		if (tdb_transaction_cancel(db) != 0) {
-			fatal("tdb_transaction_cancel failed");
-		}
+		tdb_transaction_cancel(db);
 		in_transaction--;
 		in_transaction--;
 		goto next;
 		goto next;
 	}
 	}