Commit f16fade4 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:4890], undo last checkin, was a little hasty

git-svn-id: file:///svn/toku/tokudb@43733 c7de825b-a66e-492c-adef-691d508d4ae1
parent 108c319e
......@@ -82,9 +82,10 @@ toku_txn_begin_with_xid (
DB_TXN *container_db_txn
)
{
toku_txn_create_txn(tokutxn, parent_tokutxn, logger, xid, snapshot_type, container_db_txn);
toku_txn_start_txn(*tokutxn);
return 0;
int r = toku_txn_create_txn(tokutxn, parent_tokutxn, logger, xid, snapshot_type, container_db_txn);
if (r == 0)
r = toku_txn_start_txn(*tokutxn);
return r;
}
DB_TXN *
......@@ -173,7 +174,7 @@ static void invalidate_xa_xid (TOKU_XA_XID *xid) {
xid->formatID = -1; // According to the XA spec, -1 means "invalid data"
}
void
int
toku_txn_create_txn (
TOKUTXN *tokutxn,
TOKUTXN parent_tokutxn,
......@@ -234,9 +235,10 @@ toku_txn_create_txn (
if (garbage_collection_debug) {
verify_snapshot_system(logger);
}
return 0;
}
void
int
toku_txn_start_txn(TOKUTXN txn) {
TOKULOGGER logger = txn->logger;
TOKUTXN parent = txn->parent;
......@@ -320,6 +322,7 @@ toku_txn_start_txn(TOKUTXN txn) {
}
}
toku_mutex_unlock(&logger->txn_list_lock);
return 0;
}
//Used on recovery to recover a transaction.
......
......@@ -32,10 +32,10 @@ int toku_txn_begin_with_xid (
);
// Allocate and initialize a txn
void toku_txn_create_txn(TOKUTXN *txn_ptr, TOKUTXN parent, TOKULOGGER logger, TXNID xid, TXN_SNAPSHOT_TYPE snapshot_type, DB_TXN *container_db_txn);
int toku_txn_create_txn(TOKUTXN *txn_ptr, TOKUTXN parent, TOKULOGGER logger, TXNID xid, TXN_SNAPSHOT_TYPE snapshot_type, DB_TXN *container_db_txn);
// Assign a txnid. Log the txn begin in the recovery log. Initialize the txn live lists.
void toku_txn_start_txn(TOKUTXN txn);
int toku_txn_start_txn(TOKUTXN txn);
int toku_txn_load_txninfo (TOKUTXN txn, TXNINFO info);
......
......@@ -480,21 +480,22 @@ toku_txn_begin(DB_ENV *env, DB_TXN * stxn, DB_TXN ** txn, u_int32_t flags, bool
break;
}
}
toku_txn_create_txn(
&db_txn_struct_i(result)->tokutxn,
stxn ? db_txn_struct_i(stxn)->tokutxn : 0,
env->i->logger,
TXNID_NONE,
snapshot_type,
result
);
if (!holds_ydb_lock) {
r = toku_txn_create_txn(&db_txn_struct_i(result)->tokutxn,
stxn ? db_txn_struct_i(stxn)->tokutxn : 0,
env->i->logger,
TXNID_NONE,
snapshot_type,
result
);
if (r != 0)
return r;
if (!holds_ydb_lock)
toku_ydb_lock();
}
toku_txn_start_txn(db_txn_struct_i(result)->tokutxn);
if (!holds_ydb_lock) {
r = toku_txn_start_txn(db_txn_struct_i(result)->tokutxn);
if (!holds_ydb_lock)
toku_ydb_unlock();
}
if (r != 0)
return r;
//Add to the list of children for the parent.
if (result->parent) {
......
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