Commit f2050233 authored by Rusty Russell's avatar Rusty Russell

Handle transactions!

Note: we can still deadlock on traversal vs transaction corner cases.
We handle transactions as single operation, which it logically is.
parent ee79b519
This diff is collapsed.
......@@ -20,9 +20,9 @@
#define DELETE_PROB 8
#define STORE_PROB 4
#define APPEND_PROB 6
#if 0
#define TRANSACTION_PROB 10
#define TRANSACTION_PREPARE_PROB 2
#if 0
#define LOCKSTORE_PROB 5
#endif
#define TRAVERSE_PROB 20
......@@ -144,6 +144,8 @@ static void addrec_db(void)
in_transaction--;
goto next;
}
#if 0
if (in_traverse == 0 && in_transaction && random() % TRANSACTION_PROB == 0) {
if (tdb_transaction_cancel(db) != 0) {
fatal("tdb_transaction_cancel failed");
......@@ -152,6 +154,7 @@ static void addrec_db(void)
goto next;
}
#endif
#endif
#if REOPEN_PROB
if (in_traverse == 0 && in_transaction == 0 && random() % REOPEN_PROB == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment