A number of #if 0 checks that mention MDEV-29835 were added in the MDEV-30400 fix. Those checks will have to be enabled as part of fixing this bug.
Marko Mäkelä
added a comment - In branches where the fix of MDEV-30400 is present, the following simple patch should prevent hangs in page splits and merges:
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index 30432d12afa..97934c7cd4a 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -1050,6 +1050,9 @@ dberr_t btr_cur_t::search_leaf(const dtuple_t *tuple, page_cur_mode_t mode,
ut_ad(mtr->memo_contains_flagged(&index()->lock, MTR_MEMO_X_LOCK));
break;
}
+#if 1 // Work around MDEV-29835 hangs
+ mtr_x_lock_index(index(), mtr);
+#else
if (lock_intention == BTR_INTENTION_DELETE && buf_pool.n_pend_reads &&
trx_sys.history_size_approx() > BTR_CUR_FINE_HISTORY_LENGTH)
/* Most delete-intended operations are due to the purge of history.
@@ -1057,6 +1060,7 @@ dberr_t btr_cur_t::search_leaf(const dtuple_t *tuple, page_cur_mode_t mode,
mtr_x_lock_index(index(), mtr);
else
mtr_sx_lock_index(index(), mtr);
+#endif
break;
#ifdef UNIV_DEBUG
case BTR_CONT_MODIFY_TREE:
A number of #if 0 checks that mention MDEV-29835 were added in the MDEV-30400 fix. Those checks will have to be enabled as part of fixing this bug.
The following deadlock was reproduced with the MDEV-30400 fix. One thread is following the correct latching order (in this case, as part of executing UPDATE…WHERE) when accessing a secondary index tree:
10.6 de4030e4d49805a7ded5c0bfee01cc3fd7623522
#8 0x000055caae8303a4 in btr_block_get (index=..., page=<optimized out>, mode=mode@entry=1, merge=merge@entry=true, mtr=mtr@entry=0x7f30be16a7b0, err=0x7f30be169fa0, err@entry=0x0) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/include/buf0types.h:95
#9 0x000055caae882c71 in btr_estimate_n_rows_in_range_on_level (level=level@entry=0, left_cur=..., right_page_no=<optimized out>, n_rows_on_prev_level=n_rows_on_prev_level@entry=7, is_n_rows_exact=@0x7f30be16a1a0: true, mtr=...) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/include/buf0types.h:135
#10 0x000055caae8b8c0a in btr_estimate_n_rows_in_range (index=index@entry=0x616000e11008, range_start=range_start@entry=0x7f30be16ace0, range_end=range_end@entry=0x7f30be16ad20) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/include/buf0types.h:135
#11 0x000055caae2577bd in ha_innobase::records_in_range (this=0x61d0008fcab8, keynr=<optimized out>, min_key=<optimized out>, max_key=<optimized out>, pages=<optimized out>) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/handler/ha_innodb.cc:14343
Another thread is improperly fetching a parent page while compressing the index tree:
10.6 de4030e4d49805a7ded5c0bfee01cc3fd7623522
#7 0x000055caae8303a4 in btr_block_get (index=..., page=page@entry=61, mode=mode@entry=2, merge=<optimized out>, mtr=mtr@entry=0x7f30c1f35610, err=0x7f30c1f33770, err@entry=0x0) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/include/buf0types.h:95
#8 0x000055caae83b8f7 in btr_can_merge_with_page (cursor=cursor@entry=0x7f30c1f347e0, page_no=page_no@entry=61, merge_block=merge_block@entry=0x7f30c1f33930, mtr=mtr@entry=0x7f30c1f35610) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/btr/btr0btr.cc:5455
#9 0x000055caae859e04 in btr_compress (cursor=cursor@entry=0x7f30c1f347e0, adjust=adjust@entry=false, mtr=mtr@entry=0x7f30c1f35610) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/btr/btr0btr.cc:3775
#10 0x000055caae893e79 in btr_cur_compress_if_useful (cursor=cursor@entry=0x7f30c1f347e0, adjust=adjust@entry=false, mtr=mtr@entry=0x7f30c1f35610) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/include/btr0cur.h:744
#11 0x000055caae8b3407 in btr_cur_pessimistic_delete (err=err@entry=0x7f30c1f34530, has_reserved_extents=has_reserved_extents@entry=1, cursor=cursor@entry=0x7f30c1f347e0, flags=flags@entry=16, rollback=rollback@entry=false, mtr=mtr@entry=0x7f30c1f35610) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/btr/btr0cur.cc:4782
#12 0x000055caae8b3997 in btr_cur_node_ptr_delete (parent=parent@entry=0x7f30c1f347e0, mtr=mtr@entry=0x7f30c1f35610) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/btr/btr0cur.cc:4820
#13 0x000055caae85a22a in btr_compress (cursor=cursor@entry=0x7f30c1f35330, adjust=adjust@entry=false, mtr=mtr@entry=0x7f30c1f35610) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/btr/btr0btr.cc:3893
#14 0x000055caae893e79 in btr_cur_compress_if_useful (cursor=cursor@entry=0x7f30c1f35330, adjust=adjust@entry=false, mtr=mtr@entry=0x7f30c1f35610) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/include/btr0cur.h:744
#15 0x000055caae8b3407 in btr_cur_pessimistic_delete (err=err@entry=0x7f30c1f35280, has_reserved_extents=has_reserved_extents@entry=0, cursor=cursor@entry=0x7f30c1f35330, flags=flags@entry=0, rollback=rollback@entry=false, mtr=mtr@entry=0x7f30c1f35610) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/btr/btr0cur.cc:4782
#16 0x000055caae68f9f5 in row_purge_remove_sec_if_poss_tree (node=node@entry=0x61a00000a908, index=index@entry=0x616000e11008, entry=entry@entry=0x619000c61708) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/row/row0purge.cc:410
The first thread is holding a Shared latch on the index, and it is following the correct latching order. The first thread is holding the level-1 page that the second thread is waiting for, and the second thread is holding the level-0 (leaf) page that the first thread is waiting for. The second thread is holding an Update latch on the index, which does not give it a permission to wait for a parent page latch while holding a child page latch.
Marko Mäkelä
added a comment - The following deadlock was reproduced with the MDEV-30400 fix. One thread is following the correct latching order (in this case, as part of executing UPDATE…WHERE ) when accessing a secondary index tree:
10.6 de4030e4d49805a7ded5c0bfee01cc3fd7623522
#8 0x000055caae8303a4 in btr_block_get (index=..., page=<optimized out>, mode=mode@entry=1, merge=merge@entry=true, mtr=mtr@entry=0x7f30be16a7b0, err=0x7f30be169fa0, err@entry=0x0) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/include/buf0types.h:95
#9 0x000055caae882c71 in btr_estimate_n_rows_in_range_on_level (level=level@entry=0, left_cur=..., right_page_no=<optimized out>, n_rows_on_prev_level=n_rows_on_prev_level@entry=7, is_n_rows_exact=@0x7f30be16a1a0: true, mtr=...) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/include/buf0types.h:135
#10 0x000055caae8b8c0a in btr_estimate_n_rows_in_range (index=index@entry=0x616000e11008, range_start=range_start@entry=0x7f30be16ace0, range_end=range_end@entry=0x7f30be16ad20) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/include/buf0types.h:135
#11 0x000055caae2577bd in ha_innobase::records_in_range (this=0x61d0008fcab8, keynr=<optimized out>, min_key=<optimized out>, max_key=<optimized out>, pages=<optimized out>) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/handler/ha_innodb.cc:14343
Another thread is improperly fetching a parent page while compressing the index tree:
10.6 de4030e4d49805a7ded5c0bfee01cc3fd7623522
#7 0x000055caae8303a4 in btr_block_get (index=..., page=page@entry=61, mode=mode@entry=2, merge=<optimized out>, mtr=mtr@entry=0x7f30c1f35610, err=0x7f30c1f33770, err@entry=0x0) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/include/buf0types.h:95
#8 0x000055caae83b8f7 in btr_can_merge_with_page (cursor=cursor@entry=0x7f30c1f347e0, page_no=page_no@entry=61, merge_block=merge_block@entry=0x7f30c1f33930, mtr=mtr@entry=0x7f30c1f35610) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/btr/btr0btr.cc:5455
#9 0x000055caae859e04 in btr_compress (cursor=cursor@entry=0x7f30c1f347e0, adjust=adjust@entry=false, mtr=mtr@entry=0x7f30c1f35610) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/btr/btr0btr.cc:3775
#10 0x000055caae893e79 in btr_cur_compress_if_useful (cursor=cursor@entry=0x7f30c1f347e0, adjust=adjust@entry=false, mtr=mtr@entry=0x7f30c1f35610) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/include/btr0cur.h:744
#11 0x000055caae8b3407 in btr_cur_pessimistic_delete (err=err@entry=0x7f30c1f34530, has_reserved_extents=has_reserved_extents@entry=1, cursor=cursor@entry=0x7f30c1f347e0, flags=flags@entry=16, rollback=rollback@entry=false, mtr=mtr@entry=0x7f30c1f35610) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/btr/btr0cur.cc:4782
#12 0x000055caae8b3997 in btr_cur_node_ptr_delete (parent=parent@entry=0x7f30c1f347e0, mtr=mtr@entry=0x7f30c1f35610) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/btr/btr0cur.cc:4820
#13 0x000055caae85a22a in btr_compress (cursor=cursor@entry=0x7f30c1f35330, adjust=adjust@entry=false, mtr=mtr@entry=0x7f30c1f35610) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/btr/btr0btr.cc:3893
#14 0x000055caae893e79 in btr_cur_compress_if_useful (cursor=cursor@entry=0x7f30c1f35330, adjust=adjust@entry=false, mtr=mtr@entry=0x7f30c1f35610) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/include/btr0cur.h:744
#15 0x000055caae8b3407 in btr_cur_pessimistic_delete (err=err@entry=0x7f30c1f35280, has_reserved_extents=has_reserved_extents@entry=0, cursor=cursor@entry=0x7f30c1f35330, flags=flags@entry=0, rollback=rollback@entry=false, mtr=mtr@entry=0x7f30c1f35610) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/btr/btr0cur.cc:4782
#16 0x000055caae68f9f5 in row_purge_remove_sec_if_poss_tree (node=node@entry=0x61a00000a908, index=index@entry=0x616000e11008, entry=entry@entry=0x619000c61708) at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/row/row0purge.cc:410
The first thread is holding a Shared latch on the index, and it is following the correct latching order. The first thread is holding the level-1 page that the second thread is waiting for, and the second thread is holding the level-0 (leaf) page that the first thread is waiting for. The second thread is holding an Update latch on the index, which does not give it a permission to wait for a parent page latch while holding a child page latch.
I got stack traces from one hang, but I was not able to analyze the locks held in each thread. The only thread that looked suspicious to me was doing the following:
btr_block_get
btr_insert_into_right_sibling
btr_page_split_and_insert
btr_cur_pessimistic_insert
btr_insert_on_non_leaf_level
btr_attach_half_pages
btr_page_split_and_insert
btr_cur_pessimistic_insert
row_ins_clust_index_entry_low
I think that a recursive call to btr_page_split_and_insert() or btr_compress can potentially lead to this hang.
Marko Mäkelä
added a comment - I got stack traces from one hang, but I was not able to analyze the locks held in each thread. The only thread that looked suspicious to me was doing the following:
btr_block_get
btr_insert_into_right_sibling
btr_page_split_and_insert
btr_cur_pessimistic_insert
btr_insert_on_non_leaf_level
btr_attach_half_pages
btr_page_split_and_insert
btr_cur_pessimistic_insert
row_ins_clust_index_entry_low
I think that a recursive call to btr_page_split_and_insert() or btr_compress can potentially lead to this hang.
My current approach is to tweak btr_cur_need_opposite_intention() so that it will return true in case btr_cur_compress_recommendation() would hold later during the operation, or if a page underflow or overflow is possible. If btr_cur_need_opposite_intention() returns true, the caller will escalate to exclusive dict_index_t::lock acquisition. This looks promising so far, both from the correctness and performance point of view.
Side note: It came as a light surprise to me that an operation that is supposed to shrink the tree can cause a page split:
btr_insert_on_non_leaf_level
btr_cur_pessimistic_delete
btr_cur_node_ptr_delete
btr_cur_pessimistic_delete
btr_cur_node_ptr_delete
btr_compress
Once again, https://rr-project.org made it trivial to check what could have been improved earlier during the mini-transaction execution.
Marko Mäkelä
added a comment - My current approach is to tweak btr_cur_need_opposite_intention() so that it will return true in case btr_cur_compress_recommendation() would hold later during the operation, or if a page underflow or overflow is possible. If btr_cur_need_opposite_intention() returns true , the caller will escalate to exclusive dict_index_t::lock acquisition. This looks promising so far, both from the correctness and performance point of view.
Side note: It came as a light surprise to me that an operation that is supposed to shrink the tree can cause a page split:
btr_insert_on_non_leaf_level
btr_cur_pessimistic_delete
btr_cur_node_ptr_delete
btr_cur_pessimistic_delete
btr_cur_node_ptr_delete
btr_compress
Once again, https://rr-project.org made it trivial to check what could have been improved earlier during the mini-transaction execution.
Another thread is busy with an insert, holding a conflicting latch on the index tree. Perhaps that thread is just unusually slow. This waiting thread has not acquired any other latches, it is waiting for an index latch on the spatial index.
Marko Mäkelä
added a comment - For SPATIAL INDEX , some trouble might remain in this area. I just noticed this on the amd64-ubuntu-1804-clang10-asan builder :
10.6 3b85e3dcc11e9638c9670a299eccdb77a51c1a19
innodb_gis.rtree_purge '64k,innodb' w5 [ fail ] timeout after 900 seconds
…
#7 sux_lock<ssux_lock>::u_lock (this=0x616007285d98, file=0x32479e0 <.str.13> "/buildbot/amd64-ubuntu-1804-clang10-asan/build/storage/innobase/gis/gis0sea.cc", line=1043) at include/sux_lock.h:321
id = 139642136811264
#8 0x00000000024bb4b6 in mtr_t::u_lock (this=0x7f00f7f59660, file=0x80 <error: Cannot access memory at address 0x80>, line=1043, lock=0x616007285d98) at include/mtr0mtr.h:287
No locals.
#9 rtr_search (tuple=0x61a000413520, latch_mode=BTR_MODIFY_LEAF_ALREADY_LATCHED, cursor=0x7f00f7f59a70, mtr=0x7f00f7f59660) at gis/gis0sea.cc:1043
btr_cursor = <optimized out>
rec = <optimized out>
d = <optimized out>
#10 0x00000000020a4a14 in row_purge_remove_sec_if_poss_leaf (node=0x61b000003220, index=0x616007285c20, entry=0x61a000413520) at row/row0purge.cc:460
mtr = {m_start = true, m_commit = false, m_freeing_tree = false, m_last = 0x0, m_last_offset = 0, m_log_mode = 0, m_modifications = 0, m_made_dirty = 0, m_inside_ibuf = 0, m_trim_pages = 0, m_user_space_id = 7, m_memo = {<small_vector_base> = {BeginX = 0x7f00f7f59688, Size = 0, Capacity = 16}, small = {{object = 0x56b46c0 <log_sys+64>, type = 0}, {object = 0x7f00f7f59968, type = 0}, {object = 0x7f00f7f59988, type = 4160068031}, {object = 0x7f00f7f59ba4, type = 520008497}, {object = 0x8122c8 <__asan_memcpy()+680>, type = 0}, {object = 0x56b46c0 <log_sys+64>, type = 50963552}, {object = 0x99, type = 0}, {object = 0x268c07e <safe_mutex_unlock+414>, type = 4160067944}, {object = 0x1ed05b8 <sux_lock<ssux_lock_impl<true> >::u_or_x_unlock(bool, bool)+56>, type = 4198528296}, {object = 0x7f00f7f59858, type = 520008459}, {object = 0x7f00f7f59860, type = 4160067672}, {object = 0x7f00f7f59840, type = 4160067666}, {object = 0x1edc1ac <mtr_t::commit()+3132>, type = 520008312}, {object = 0x7f00f7f59860, type = 4160067648}, {object = 0xfe01efeb30c, type = 67806101}, {object = 0x7f00f7f59858, type = 0}}}, m_log = {m_heap = 0x0, m_list = {<ilist<mtr_buf_t::block_t, void>> = {sentinel_ = {next = 0x7f00f7f597b0, prev = 0x7f00f7f597b0}}, size_ = 1}, m_size = 0, m_first_block = {<ilist_node<void>> = {next = 0x7f00f7f59790, prev = 0x7f00f7f59790}, m_buf_end = 0, m_magic_n = 375767, m_data = "`\237\365\367\000\177\000\000x~\n\002\000\000\000\000\016\066\340E\000\000\000\000\313D\021\003\000\000\000\000\000k\n\002\000\000\000\000P\226\365\367\000\177\000\000\300\037\000\000\000\000\000\000\060^M\004\000\000\000\000@\237\365\367\000\177\000\000\003\000\000\000\000\000\000\000\003\000\000\000\000\000\000\000`\237\365\367\000\177\000\000\000\000\000\000\000\000\000\000\240\224\365\367\000\177\000\000\001\001", '\000' <repeats 14 times>, "#\000\000\000\000\000\000\000\200\357\a\000@`\000\000#\000\000\000\000\000\000\000\200\357\a\000@`\000\000\000\300\035\372\000\177\000\000`\300\035\372\000\177\000\000\210\aC\004\000\000\000\000S\002z\000\000\000\000\000\340\300\035\372\000\177\000\000"..., m_used = 0}}, m_user_space = 0x6130000c1118, m_commit_lsn = 0, m_freed_space = 0x0, m_freed_pages = 0x0}
pcur = {btr_cur = {page_cur = {index = 0x616007285c20, rec = 0x0, offsets = 0x0, block = 0x0}, purge_node = 0x61b000003220, thr = 0x0, flag = 0, tree_height = 0, up_match = 0, up_bytes = 0, low_match = 0, low_bytes = 0, n_fields = 0, n_bytes = 0, fold = 0, path_arr = 0x0, rtr_info = 0x0}, latch_mode = BTR_MODIFY_LEAF, old_rec = 0x0, old_n_core_fields = 0, old_n_fields = 0, rel_pos = 0, block_when_stored = {m_block = 0x0, m_page_id = {m_id = 0}}, modify_clock = 0, pos_state = BTR_PCUR_NOT_POSITIONED, search_mode = PAGE_CUR_RTREE_LOCATE, trx_if_known = 0x0, old_rec_buf = 0x0, buf_size = 0}
success = true
btr_cur = <optimized out>
block = <optimized out>
_db_s = <optimized out>
Another thread is busy with an insert, holding a conflicting latch on the index tree. Perhaps that thread is just unusually slow. This waiting thread has not acquired any other latches, it is waiting for an index latch on the spatial index.
People
Marko Mäkelä
Matthias Leich
Votes:
1Vote for this issue
Watchers:
20Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":1215.3000000715256,"ttfb":329.5,"pageVisibility":"visible","entityId":115804,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"afe43084-2660-414a-b23b-1eef3832c07a","navigationType":0,"readyForUser":1376.1000000238419,"redirectCount":0,"resourceLoadedEnd":1515.9000000953674,"resourceLoadedStart":336.3000000715256,"resourceTiming":[{"duration":343.10000002384186,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":336.3000000715256,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":336.3000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":679.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":343.3000000715256,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":336.60000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":336.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":679.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":352.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":336.8000000715256,"connectEnd":336.8000000715256,"connectStart":336.8000000715256,"domainLookupEnd":336.8000000715256,"domainLookupStart":336.8000000715256,"fetchStart":336.8000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":336.8000000715256,"responseEnd":689.3000000715256,"responseStart":689.3000000715256,"secureConnectionStart":336.8000000715256},{"duration":387.60000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":337,"connectEnd":337,"connectStart":337,"domainLookupEnd":337,"domainLookupStart":337,"fetchStart":337,"redirectEnd":0,"redirectStart":0,"requestStart":337,"responseEnd":724.6000000238419,"responseStart":724.6000000238419,"secureConnectionStart":337},{"duration":391.1999999284744,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":337.3000000715256,"connectEnd":337.3000000715256,"connectStart":337.3000000715256,"domainLookupEnd":337.3000000715256,"domainLookupStart":337.3000000715256,"fetchStart":337.3000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":337.3000000715256,"responseEnd":728.5,"responseStart":728.5,"secureConnectionStart":337.3000000715256},{"duration":391.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":337.5,"connectEnd":337.5,"connectStart":337.5,"domainLookupEnd":337.5,"domainLookupStart":337.5,"fetchStart":337.5,"redirectEnd":0,"redirectStart":0,"requestStart":337.5,"responseEnd":729,"responseStart":729,"secureConnectionStart":337.5},{"duration":391.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":337.90000009536743,"connectEnd":337.90000009536743,"connectStart":337.90000009536743,"domainLookupEnd":337.90000009536743,"domainLookupStart":337.90000009536743,"fetchStart":337.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":337.90000009536743,"responseEnd":729.4000000953674,"responseStart":729.4000000953674,"secureConnectionStart":337.90000009536743},{"duration":499.60000002384186,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":338,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":338,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":837.6000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":391.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":338.2000000476837,"connectEnd":338.2000000476837,"connectStart":338.2000000476837,"domainLookupEnd":338.2000000476837,"domainLookupStart":338.2000000476837,"fetchStart":338.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":338.2000000476837,"responseEnd":730,"responseStart":729.9000000953674,"secureConnectionStart":338.2000000476837},{"duration":499.2999999523163,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":338.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":338.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":837.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":391.89999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":338.60000002384186,"connectEnd":338.60000002384186,"connectStart":338.60000002384186,"domainLookupEnd":338.60000002384186,"domainLookupStart":338.60000002384186,"fetchStart":338.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":338.60000002384186,"responseEnd":730.5,"responseStart":730.5,"secureConnectionStart":338.60000002384186},{"duration":623.3999999761581,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":340.7000000476837,"connectEnd":340.7000000476837,"connectStart":340.7000000476837,"domainLookupEnd":340.7000000476837,"domainLookupStart":340.7000000476837,"fetchStart":340.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":340.7000000476837,"responseEnd":964.1000000238419,"responseStart":964.1000000238419,"secureConnectionStart":340.7000000476837},{"duration":1166.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":346,"connectEnd":346,"connectStart":346,"domainLookupEnd":346,"domainLookupStart":346,"fetchStart":346,"redirectEnd":0,"redirectStart":0,"requestStart":346,"responseEnd":1512.5,"responseStart":1512.5,"secureConnectionStart":346},{"duration":154.10000002384186,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":850.5,"connectEnd":850.5,"connectStart":850.5,"domainLookupEnd":850.5,"domainLookupStart":850.5,"fetchStart":850.5,"redirectEnd":0,"redirectStart":0,"requestStart":850.5,"responseEnd":1004.6000000238419,"responseStart":1004.6000000238419,"secureConnectionStart":850.5},{"duration":387.2000000476837,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":1126.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1126.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1513.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":386.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":1127.2000000476837,"connectEnd":1127.2000000476837,"connectStart":1127.2000000476837,"domainLookupEnd":1127.2000000476837,"domainLookupStart":1127.2000000476837,"fetchStart":1127.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":1127.2000000476837,"responseEnd":1513.7000000476837,"responseStart":1513.7000000476837,"secureConnectionStart":1127.2000000476837},{"duration":388.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":1127.7000000476837,"connectEnd":1127.7000000476837,"connectStart":1127.7000000476837,"domainLookupEnd":1127.7000000476837,"domainLookupStart":1127.7000000476837,"fetchStart":1127.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":1127.7000000476837,"responseEnd":1515.9000000953674,"responseStart":1515.9000000953674,"secureConnectionStart":1127.7000000476837}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":113,"responseStart":330,"responseEnd":342,"domLoading":334,"domInteractive":1572,"domContentLoadedEventStart":1572,"domContentLoadedEventEnd":1633,"domComplete":2243,"loadEventStart":2243,"loadEventEnd":2244,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1527.8000000715256},{"name":"bigPipe.sidebar-id.end","time":1528.7000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":1528.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.end","time":1532.9000000953674},{"name":"activityTabFullyLoaded","time":1653.8000000715256}],"measures":[],"correlationId":"be56b359751602","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":140,"dbReadsTimeInMs":37,"dbConnsTimeInMs":49,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
In branches where the fix of
MDEV-30400is present, the following simple patch should prevent hangs in page splits and merges:diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index 30432d12afa..97934c7cd4a 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -1050,6 +1050,9 @@ dberr_t btr_cur_t::search_leaf(const dtuple_t *tuple, page_cur_mode_t mode,
ut_ad(mtr->memo_contains_flagged(&index()->lock, MTR_MEMO_X_LOCK));
break;
}
+#if 1 // Work around MDEV-29835 hangs
+ mtr_x_lock_index(index(), mtr);
+#else
if (lock_intention == BTR_INTENTION_DELETE && buf_pool.n_pend_reads &&
trx_sys.history_size_approx() > BTR_CUR_FINE_HISTORY_LENGTH)
/* Most delete-intended operations are due to the purge of history.
@@ -1057,6 +1060,7 @@ dberr_t btr_cur_t::search_leaf(const dtuple_t *tuple, page_cur_mode_t mode,
mtr_x_lock_index(index(), mtr);
else
mtr_sx_lock_index(index(), mtr);
+#endif
break;
#ifdef UNIV_DEBUG
A number of #if 0 checks that mention
MDEV-29835were added in theMDEV-30400fix. Those checks will have to be enabled as part of fixing this bug.