mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
[t:2811], add some comments
git-svn-id: file:///svn/toku/tokudb@26097 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
15fe9a5247
commit
9d3a1416c3
2 changed files with 22 additions and 0 deletions
|
@ -241,6 +241,13 @@ void toku_rollback_txn_close (TOKUTXN txn) {
|
|||
r = toku_omt_delete_at(txn->logger->live_root_txns, idx);
|
||||
assert(r==0);
|
||||
}
|
||||
//
|
||||
// if this txn created a snapshot, make necessary modifications to list of snapshot txnids and live_list_reverse
|
||||
// the order of operations is important. We first remove the txnid from the list of snapshot txnids. This is
|
||||
// necessary because root snapshot transactions are in their own live lists. If we do not remove
|
||||
// the txnid from the snapshot txnid list first, then when we go to make the modifications to
|
||||
// live_list_reverse, we have trouble. We end up never removing (id, id) from live_list_reverse
|
||||
//
|
||||
if (txn->snapshot_type != TXN_SNAPSHOT_NONE && (txn->parent==NULL || txn->snapshot_type == TXN_SNAPSHOT_CHILD)) {
|
||||
{
|
||||
u_int32_t idx;
|
||||
|
|
15
newbrt/txn.c
15
newbrt/txn.c
|
@ -196,6 +196,21 @@ int toku_txn_begin_with_xid (
|
|||
r = toku_omt_insert_at(logger->live_txns, result, toku_omt_size(logger->live_txns));
|
||||
if (r!=0) goto died;
|
||||
|
||||
//
|
||||
// maintain the data structures necessary for MVCC:
|
||||
// 1. add txn to list of live_root_txns if this is a root transaction
|
||||
// 2. if the transaction is creating a snapshot:
|
||||
// - create a live list for the transaction
|
||||
// - add the id to the list of snapshot ids
|
||||
// - make the necessary modifications to the live_list_reverse
|
||||
//
|
||||
// The order of operations is important here, and must be taken
|
||||
// into account when the transaction is closed. The txn is added
|
||||
// to the live_root_txns first (if it is a root txn). This has the implication
|
||||
// that a root level snapshot transaction is in its own live list. This fact
|
||||
// is taken into account when the transaction is closed.
|
||||
//
|
||||
|
||||
// add ancestor information, and maintain global live root txn list
|
||||
if (parent_tokutxn==NULL) {
|
||||
//Add txn to list (omt) of live root txns
|
||||
|
|
Loading…
Add table
Reference in a new issue