From 2e7835e6b51b44cf34a9666adcd473860b3361e6 Mon Sep 17 00:00:00 2001 From: Yoni Fogel Date: Tue, 16 Apr 2013 23:57:55 -0400 Subject: [PATCH] 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 --- newbrt/brt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/newbrt/brt.c b/newbrt/brt.c index 7ef6a9b851a..4edfa699487 100644 --- a/newbrt/brt.c +++ b/newbrt/brt.c @@ -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);