mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
Addresses #1849 If a child prelocks a table (and gains the magic 'no rolltmp needed' flag),
it can pass it to its parent when it commits. git-svn-id: file:///svn/toku/tokudb@13338 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
2e7835e6b5
commit
a102472122
1 changed files with 12 additions and 3 deletions
|
@ -60,8 +60,17 @@ char *toku_strdup_in_rollback(TOKUTXN txn, const char *s) {
|
|||
return toku_memdup_in_rollback(txn, s, strlen(s)+1);
|
||||
}
|
||||
|
||||
static int note_brt_used_in_parent_txn(OMTVALUE brtv, u_int32_t UU(index), void*parentv) {
|
||||
return toku_txn_note_brt(parentv, brtv);
|
||||
static int note_brt_used_in_txns_parent(OMTVALUE brtv, u_int32_t UU(index), void*txnv) {
|
||||
TOKUTXN child = txnv;
|
||||
TOKUTXN parent = child->parent;
|
||||
BRT brt = brtv;
|
||||
int r = toku_txn_note_brt(parent, brt);
|
||||
if (r==0 &&
|
||||
brt->h->txnid_that_created_or_locked_when_empty == toku_txn_get_txnid(child)) {
|
||||
//Pass magic "no rolltmp needed" flag to parent.
|
||||
brt->h->txnid_that_created_or_locked_when_empty = toku_txn_get_txnid(parent);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
int toku_rollback_commit(TOKUTXN txn, YIELDF yield, void*yieldv) {
|
||||
|
@ -114,7 +123,7 @@ int toku_rollback_commit(TOKUTXN txn, YIELDF yield, void*yieldv) {
|
|||
}
|
||||
|
||||
// Note the open brts, the omts must be merged
|
||||
r = toku_omt_iterate(txn->open_brts, note_brt_used_in_parent_txn, txn->parent);
|
||||
r = toku_omt_iterate(txn->open_brts, note_brt_used_in_txns_parent, txn);
|
||||
assert(r==0);
|
||||
|
||||
r = toku_maybe_spill_rollbacks(txn->parent);
|
||||
|
|
Loading…
Add table
Reference in a new issue