Commit 39b9de9c 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 8a4cb681
...@@ -82,9 +82,10 @@ toku_txn_begin_with_xid ( ...@@ -82,9 +82,10 @@ toku_txn_begin_with_xid (
DB_TXN *container_db_txn DB_TXN *container_db_txn
) )
{ {
toku_txn_create_txn(tokutxn, parent_tokutxn, logger, xid, snapshot_type, container_db_txn); int r = toku_txn_create_txn(tokutxn, parent_tokutxn, logger, xid, snapshot_type, container_db_txn);
toku_txn_start_txn(*tokutxn); if (r == 0)
return 0; r = toku_txn_start_txn(*tokutxn);
return r;
} }
DB_TXN * DB_TXN *
...@@ -173,7 +174,7 @@ static void invalidate_xa_xid (TOKU_XA_XID *xid) { ...@@ -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" xid->formatID = -1; // According to the XA spec, -1 means "invalid data"
} }
void int
toku_txn_create_txn ( toku_txn_create_txn (
TOKUTXN *tokutxn, TOKUTXN *tokutxn,
TOKUTXN parent_tokutxn, TOKUTXN parent_tokutxn,
...@@ -234,9 +235,10 @@ toku_txn_create_txn ( ...@@ -234,9 +235,10 @@ toku_txn_create_txn (
if (garbage_collection_debug) { if (garbage_collection_debug) {
verify_snapshot_system(logger); verify_snapshot_system(logger);
} }
return 0;
} }
void int
toku_txn_start_txn(TOKUTXN txn) { toku_txn_start_txn(TOKUTXN txn) {
TOKULOGGER logger = txn->logger; TOKULOGGER logger = txn->logger;
TOKUTXN parent = txn->parent; TOKUTXN parent = txn->parent;
...@@ -320,6 +322,7 @@ toku_txn_start_txn(TOKUTXN txn) { ...@@ -320,6 +322,7 @@ toku_txn_start_txn(TOKUTXN txn) {
} }
} }
toku_mutex_unlock(&logger->txn_list_lock); toku_mutex_unlock(&logger->txn_list_lock);
return 0;
} }
//Used on recovery to recover a transaction. //Used on recovery to recover a transaction.
......
...@@ -32,10 +32,10 @@ int toku_txn_begin_with_xid ( ...@@ -32,10 +32,10 @@ int toku_txn_begin_with_xid (
); );
// Allocate and initialize a txn // 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. // 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); 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 ...@@ -480,21 +480,22 @@ toku_txn_begin(DB_ENV *env, DB_TXN * stxn, DB_TXN ** txn, u_int32_t flags, bool
break; break;
} }
} }
toku_txn_create_txn( r = toku_txn_create_txn(&db_txn_struct_i(result)->tokutxn,
&db_txn_struct_i(result)->tokutxn, stxn ? db_txn_struct_i(stxn)->tokutxn : 0,
stxn ? db_txn_struct_i(stxn)->tokutxn : 0, env->i->logger,
env->i->logger, TXNID_NONE,
TXNID_NONE, snapshot_type,
snapshot_type, result
result );
); if (r != 0)
if (!holds_ydb_lock) { return r;
if (!holds_ydb_lock)
toku_ydb_lock(); toku_ydb_lock();
} r = toku_txn_start_txn(db_txn_struct_i(result)->tokutxn);
toku_txn_start_txn(db_txn_struct_i(result)->tokutxn); if (!holds_ydb_lock)
if (!holds_ydb_lock) {
toku_ydb_unlock(); toku_ydb_unlock();
} if (r != 0)
return r;
//Add to the list of children for the parent. //Add to the list of children for the parent.
if (result->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