-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
__wt_txn_begin has the following code/comment:
/* * Stall here if the cache is completely full. We have allocated a transaction ID which * makes it possible for eviction to decide we're contributing to the problem and return * WT_ROLLBACK. The WT_SESSION.begin_transaction API can't return rollback, continue on. */ WT_RET_ERROR_OK(__wt_cache_eviction_check(session, false, true, NULL), WT_ROLLBACK); __wt_txn_get_snapshot(session);
The comment says "We have allocated a transaction ID which makes it possible ..". We have not allocated the transaction ID yet, that is why we can check for eviction without rolling back. "not" is missing in the comment.
Unless I am reading this wrong, should be a trivial fix.
Note:
__wt_txn_id_check() does the allocation of the txn-id using __wt_txn_id_alloc. This happens as part of actual modification in a transaction by __txn_next_op. So allocation of a txn-id is deferred until there is some modification. Hence I believe when calling __wt_txn_begin we have not yet allocated a txn-id when we check for eviction.