-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
Inside the cppsuite framework, there are numerous ways where we can rollback the current active transaction. The functions can_commit, insert or update checks if the current test needs to rollback. If so, we return back false, and the test needs to perform a rollback. The function commit performs WiredTiger's commit_transaction(), if the function call fails, internally WT performs a rollback.
It is possible that a particular test can be stuck when rollbacks are continuously called. Currently there is some functionality inside CPP tests, where we check if there is a large amount of continous rollbacks in hs_cleanup.cxx.
if (tc->update(cursor, coll.id, key_value_t(key_tmp))) { if (tc->transaction.can_commit()) { if (tc->transaction.commit()) rollback_retries = 0; else ++rollback_retries; } } else { tc->transaction.rollback(); ++rollback_retries; } testutil_assert(rollback_retries < MAX_ROLLBACKS);
This ticket aims to provide a better method of asserting when a test continuously perform transaction rollbacks. This can be done by moving the above functionality and assert inside the CPP framework (most likely thread_context.cxx). The idea is to have an internal counter which tracks the number of rollbacks and add the assert in can_commit, insert, update, or commit.