Skip to content

Commit

Permalink
MDEV-24834 Assertion mtr->memo_contains_flagged() in btr0cur.cc:1500
Browse files Browse the repository at this point in the history
A too strict debug assertion was introduced in
commit 03ca649 (MDEV-24142).
It turns out that row_ins_sec_index_entry_low() may acquire a stronger
latch on the index. The old rw_lock_own(..., RW_LOCK_S) assertion
would hold also for the SX (Update) latch mode.

btr_cur_search_to_nth_level_func(): Relax the assertion to require
that the mini-transaction hold any of S or U latch.
  • Loading branch information
dr-m committed Feb 10, 2021
1 parent a2fbbba commit bfb4761
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion storage/innobase/btr/btr0cur.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,8 @@ btr_cur_search_to_nth_level_func(
if (!srv_read_only_mode) {
if (s_latch_by_caller) {
ut_ad(mtr->memo_contains_flagged(
&index->lock, MTR_MEMO_S_LOCK));
&index->lock, MTR_MEMO_S_LOCK
| MTR_MEMO_SX_LOCK));
} else if (!modify_external) {
/* BTR_SEARCH_TREE is intended to be used with
BTR_ALREADY_S_LATCHED */
Expand Down

0 comments on commit bfb4761

Please sign in to comment.