Closes #1868 A parent can prelock a table, and then the child, or vice versa without crashing.

This does not add any performance optimizations

git-svn-id: file:///svn/toku/tokudb@13337 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
Yoni Fogel 2013-04-16 23:57:55 -04:00
parent bf03fe85e1
commit 2e7835e6b5

View file

@ -4881,7 +4881,8 @@ int
toku_brt_note_table_lock (BRT brt, TOKUTXN txn)
{
if (brt->h->txnid_that_created_or_locked_when_empty != toku_txn_get_txnid(txn) &&
brt_is_empty(brt, toku_txn_logger(txn))) {
brt_is_empty(brt, toku_txn_logger(txn)) &&
brt->h->txnid_that_created_or_locked_when_empty == 0) {
assert(brt->h->txnid_that_created_or_locked_when_empty == 0);
brt->h->txnid_that_created_or_locked_when_empty = toku_txn_get_txnid(txn);
int r = toku_txn_note_brt(txn, brt);