Commit c7f7d3e8 authored by Yoni Fogel's avatar Yoni Fogel

Addresses #2164 refs[t:2164] Take brtheader lock when accessing zombie/live...

Addresses #2164 refs[t:2164] Take brtheader lock when accessing zombie/live lists during fdelete on commit.

git-svn-id: file:///svn/toku/tokudb@15878 c7de825b-a66e-492c-adef-691d508d4ae1
parent beff378e
...@@ -5226,6 +5226,7 @@ int toku_brt_remove_on_commit(TOKUTXN txn, DBT* iname_dbt_p, DBT* iname_within_c ...@@ -5226,6 +5226,7 @@ int toku_brt_remove_on_commit(TOKUTXN txn, DBT* iname_dbt_p, DBT* iname_within_c
struct brt_header *h = toku_cachefile_get_userdata(cf); struct brt_header *h = toku_cachefile_get_userdata(cf);
BRT brt; BRT brt;
//Any arbitrary brt of that header is fine. //Any arbitrary brt of that header is fine.
toku_brtheader_lock(h);
if (!toku_list_empty(&h->live_brts)) { if (!toku_list_empty(&h->live_brts)) {
brt = toku_list_struct(toku_list_head(&h->live_brts), struct brt, live_brt_link); brt = toku_list_struct(toku_list_head(&h->live_brts), struct brt, live_brt_link);
} }
...@@ -5234,6 +5235,7 @@ int toku_brt_remove_on_commit(TOKUTXN txn, DBT* iname_dbt_p, DBT* iname_within_c ...@@ -5234,6 +5235,7 @@ int toku_brt_remove_on_commit(TOKUTXN txn, DBT* iname_dbt_p, DBT* iname_within_c
assert(!toku_list_empty(&h->zombie_brts)); assert(!toku_list_empty(&h->zombie_brts));
brt = toku_list_struct(toku_list_head(&h->zombie_brts), struct brt, zombie_brt_link); brt = toku_list_struct(toku_list_head(&h->zombie_brts), struct brt, zombie_brt_link);
} }
toku_brtheader_unlock(h);
r = toku_txn_note_brt(txn, brt); r = toku_txn_note_brt(txn, brt);
if (r!=0) return r; if (r!=0) return r;
} }
......
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