mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 03:51:50 +01:00
[t:4953], add some comments
git-svn-id: file:///svn/toku/tokudb@44205 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
15b113f399
commit
eeb3b0d231
2 changed files with 8 additions and 1 deletions
|
@ -172,7 +172,8 @@ struct tokutxn {
|
|||
// Protected by the txn manager lock:
|
||||
TOKUTXN_STATE state;
|
||||
struct toku_list prepared_txns_link; // list of prepared transactions
|
||||
uint32_t num_pin;
|
||||
uint32_t num_pin; // number of threads (all hot indexes) that want this
|
||||
// txn to not transition to commit or abort
|
||||
};
|
||||
|
||||
static inline int
|
||||
|
|
|
@ -774,11 +774,17 @@ exit:
|
|||
}
|
||||
|
||||
// needed for hot indexing
|
||||
|
||||
// prevents a client thread from transitioning txn from LIVE|PREPAREING -> COMMITTING|ABORTING
|
||||
// hot indexing may need a transactions to stay in the LIVE|PREPARING state while it processes
|
||||
// a leafentry.
|
||||
void toku_txn_manager_pin_live_txn_unlocked(TXN_MANAGER UU(txn_manager), TOKUTXN txn) {
|
||||
assert(txn->state == TOKUTXN_LIVE || txn->state == TOKUTXN_PREPARING);
|
||||
txn->num_pin++;
|
||||
}
|
||||
|
||||
// allows a client thread to go back to being able to transition txn
|
||||
// from LIVE|PREPAREING -> COMMITTING|ABORTING
|
||||
void toku_txn_manager_unpin_live_txn_unlocked(TXN_MANAGER txn_manager, TOKUTXN txn) {
|
||||
assert(txn->state == TOKUTXN_LIVE || txn->state == TOKUTXN_PREPARING);
|
||||
assert(txn->num_pin > 0);
|
||||
|
|
Loading…
Add table
Reference in a new issue