• Marko Mäkelä's avatar
    MDEV-34283 A misplaced btr_cur_need_opposite_intention() check may fail to prevent hangs · 9fac857f
    Marko Mäkelä authored
    btr_cur_t::search_leaf(): Invoke btr_cur_need_opposite_intention() after
    positioning page_cur.rec so that the record will be in the intended page.
    This is something that was broken in
    commit f2096478 or
    commit de4030e4 or related changes.
    
    btr_cur_need_opposite_intention(): Add a debug assertion that would
    catch the misuse.
    
    The "next line of defence" that should have caught this bug in debug builds
    are assertions that mtr_t::m_memo contains MTR_MEMO_X_LOCK for the
    dict_index_t::lock. When btr_cur_need_opposite_intention() holds,
    we should escalate to acquiring an exclusive index->lock in
    btr_cur_t::pessimistic_search_leaf().
    
    Reviewed by: Debarun Banerjee
    9fac857f
btr0cur.cc 220 KB