Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.4.3, 10.5.0
Description
The recently added test innodb.innodb_wl6326 hangs in 10.4, because a query
SELECT a00,a01 FROM t1 WHERE a00 = 'cp'; |
causes ha_innobase::records_in_range() to be called with min_key=NULL. No secondary indexes have been defined on the table; only PRIMARY KEY(a00,a01,a02,a03,a04,a05,a06).
That section of the test is demonstrating that only some pages of the table are supposed to be latched.
The hang is caused by ‘too broad’ ha_innobase::records_in_range() calls. Those calls were introduced by an early commit of MDEV-16188. With the parent of that commit, the following test will not hang:
git checkout bc43bf3e430c20bc2178e584215bd443054709d6 mysql-test/suite/innodb/t/innodb_wl6326.*
|
(cd path/to/build/mysql-test; ./mtr innodb.innodb_wl6326)
|
I would expect the too broad ha_innobase::records_in_range() calls to cause a performance regression, especially if they are being invoked for each and every query. InnoDB will not cache the results of that call in any way.
Attachments
Issue Links
- is caused by
-
MDEV-16188 Use in-memory PK filters built from range index scans
-
- Closed
-
- relates to
-
MDEV-22242 B-trees can become extremely skewed
-
- Closed
-
-
MDEV-26389 (records_in_range) Query plan regression after upgrading from 10.3 to 10.5
-
- Open
-
Activity
This bug had been fixed some time ago but the test was not enabled until now.
The test still turns out to fail on 10.5. I merged 10.4 to 10.5, but I had to keep the test disabled.
./mtr --enable-disabled innodb.innodb_wl6326 &
|
sleep 60
|
killall -ABRT mariadbd
|
fg
|
10.5 ccc06931c3c7be094f6dcddeb45589f06cf0c8af |
CURRENT_TEST: innodb.innodb_wl6326
|
mysqltest: At line 335: query 'SELECT a00,a01 FROM t1 WHERE a00 = 'aa'' failed: 2013: Lost connection to MySQL server during query
|
Here is the stack trace of the DEBUG_SYNC hang, showing the unexpected or unwanted ha_innobase::records_in_range() invocation:
10.5 ccc06931c3c7be094f6dcddeb45589f06cf0c8af |
#12 0x000055bfb1ae3db5 in buf_page_get_gen (page_id=..., zip_size=<optimized out>, rw_latch=<optimized out>, guess=<optimized out>, mode=<optimized out>, file=<optimized out>, line=3137295672, mtr=0x7fef7c0230a8, err=0x0, allow_ibuf_merge=<optimized out>) at /mariadb/10.5m/storage/innobase/buf/buf0buf.cc:3980
|
#13 0x000055bfb1a963d7 in btr_cur_search_to_nth_level_func (index=<optimized out>, level=<optimized out>, tuple=<optimized out>, mode=<optimized out>, latch_mode=<optimized out>, cursor=<optimized out>, ahi_latch=0x0, file=0x55bfb1faf524 "/mariadb/10.5m/storage/innobase/btr/btr0cur.cc", line=6195, mtr=0x7fefbaff9538, autoinc=0) at /mariadb/10.5m/storage/innobase/btr/btr0cur.cc:1604
|
#14 0x000055bfb1ab4af6 in btr_estimate_n_rows_in_range_low (index=<optimized out>, tuple1=<optimized out>, tuple2=<optimized out>, nth_attempt=<optimized out>) at /mariadb/10.5m/storage/innobase/btr/btr0cur.cc:6191
|
#15 0x000055bfb1ab4947 in btr_estimate_n_rows_in_range (index=0x55bfb3b46ac0, tuple1=0x80, tuple2=0x0) at /mariadb/10.5m/storage/innobase/btr/btr0cur.cc:6520
|
#16 0x000055bfb181cffb in ha_innobase::records_in_range (this=0x7fef7c01cc60, keynr=<optimized out>, min_key=0x7fefbaff9b88, max_key=0x7fefbaff9ba8, pages=0x7fefbaff9b60) at /mariadb/10.5m/storage/innobase/handler/ha_innodb.cc:14053
|
#17 0x000055bfb13c45f7 in handler::multi_range_read_info_const (this=0x7fef7c01cc60, keyno=128, seq=0x7fefbaff9db0, seq_init_param=<optimized out>, n_ranges_arg=<optimized out>, bufsz=<optimized out>, flags=0x7fefbaff9c44, cost=0x7fefbaff9d20) at /mariadb/10.5m/sql/multi_range_read.cc:177
|
#18 0x000055bfb13c736e in DsMrr_impl::dsmrr_info_const (this=0x7fef7c01d160, keyno=0, seq=0x0, seq_init_param=0x7fefc68b35e5 <__pthread_cond_wait+485>, n_ranges=0, bufsz=0x7fefbaff9cdc, flags=<optimized out>, cost=<optimized out>) at /mariadb/10.5m/sql/multi_range_read.cc:1708
|
#19 0x000055bfb16265bc in check_quick_select (param=0x7fefbaffa5b8, idx=0, tree=0x7fef7c022140, update_tbl_stats=<optimized out>, mrr_flags=<optimized out>, bufsize=<optimized out>, cost=<optimized out>, index_only=<optimized out>, is_ror_scan=<optimized out>) at /mariadb/10.5m/sql/opt_range.cc:11113
|
#20 get_key_scans_params (param=0x7fefbaffa5b8, tree=<optimized out>, index_read_must_be_used=<optimized out>, update_tbl_stats=<optimized out>, read_time=<optimized out>) at /mariadb/10.5m/sql/opt_range.cc:7400
|
#21 0x000055bfb1620ba6 in SQL_SELECT::test_quick_select (this=0x7fef7c0151b8, thd=0x7fef7c000d48, keys_to_use=..., prev_tables=<optimized out>, limit=<optimized out>, force_quick_range=<optimized out>, ordered_output=<optimized out>, remove_false_parts_of_where=<optimized out>, only_single_index_range_scan=<optimized out>) at /mariadb/10.5m/sql/opt_range.cc:2897
|
#22 0x000055bfb12a4549 in get_quick_record_count (thd=0x7fef7c000d48, select=0x7fef7c0151b8, table=0x7fef7c01be68, keys=0x7fef7c0140c8, limit=18446744073709551615) at /mariadb/10.5m/sql/sql_select.cc:4712
|
#23 make_join_statistics (join=<optimized out>, tables_list=..., keyuse_array=<optimized out>) at /mariadb/10.5m/sql/sql_select.cc:5437
|
#24 0x000055bfb129ec19 in JOIN::optimize_inner (this=0x7fef7c0134d0) at /mariadb/10.5m/sql/sql_select.cc:2260
|
#25 0x000055bfb12997e4 in JOIN::optimize (this=0x7fef7c0134d0) at /mariadb/10.5m/sql/sql_select.cc:1606
|
#26 0x000055bfb1293633 in mysql_select (thd=0x7fef7c000d48, tables=<optimized out>, fields=..., conds=<optimized out>, og_num=<optimized out>, order=<optimized out>, group=<optimized out>, having=<optimized out>, proc_param=<optimized out>, select_options=<optimized out>, result=<optimized out>, unit=<optimized out>, select_lex=<optimized out>) at /mariadb/10.5m/sql/sql_select.cc:4654
|
#27 0x000055bfb12934c5 in handle_select (thd=0x7fef7c000d48, lex=0x7fef7c004c88, result=0x7fef7c0134a8, setup_tables_done_option=<optimized out>) at /mariadb/10.5m/sql/sql_select.cc:417
|
#28 0x000055bfb126943f in execute_sqlcom_select (thd=0x7fef7c000d48, all_tables=0x7fef7c0120a8) at /mariadb/10.5m/sql/sql_parse.cc:6168
|
#29 0x000055bfb1260b0d in mysql_execute_command (thd=0x7fef7c000d48) at /mariadb/10.5m/sql/sql_parse.cc:3901
|
#30 0x000055bfb125b948 in mysql_parse (thd=0x7fef7c000d48, rawbuf=0x7fef7c0118a0 "SELECT a00,a01 FROM t1 WHERE a00 = 'aa'", length=<optimized out>, parser_state=<optimized out>, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /mariadb/10.5m/sql/sql_parse.cc:7953
|
#31 0x000055bfb1258336 in dispatch_command (command=COM_QUERY, thd=0x7fef7c000d48, packet=0x7fef7c008489 "SELECT a00,a01 FROM t1 WHERE a00 = 'aa'", packet_length=39, is_com_multi=false, is_next_command=false) at /mariadb/10.5m/sql/sql_parse.cc:1839
|
Finally, here is the relevant part of the test, highlighting that the purpose of the test is to demonstrate that the INSERT is locking part of the tree, not affecting reads of other parts of the tree:
--connection con1
|
SET DEBUG_SYNC = 'before_insert_pessimitic_row_ins_clust SIGNAL reached WAIT_FOR continue'; |
# Cause modify_tree
|
--send
|
INSERT INTO t1 (a00) VALUES ('bfb'); |
|
--connection con2
|
SET DEBUG_SYNC = 'now WAIT_FOR reached'; |
# Not blocked searches |
SELECT a00,a01 FROM t1 WHERE a00 = 'aa'; |
Due to the ha_innobase::records_in_range() call, the hanging query is unnecessarily accessing a locked part of the B-tree.
The hang is reproducible with current 10.5.
I've added print-outs to explore what records_in_range() calls are made: https://gist.github.com/spetrunia/237a49b60b874631326d0733a202c9c9
Server stderr before the hang:
...
|
AAA query: INSERT INTO t1 (a00) VALUES ('ge')
|
AAA query: INSERT INTO t1 (a00) VALUES ('gf')
|
AAA query: INSERT INTO t1 (a00) VALUES ('gg')
|
AAA query: INSERT INTO t1 (a00) VALUES ('gh')
|
AAA query: ANALYZE TABLE t1
|
AAA query: SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1'
|
AAA query: SET GLOBAL innodb_limit_optimistic_insert_debug = 0
|
AAA query: SET DEBUG_SYNC = 'RESET'
|
AAA query: INSERT INTO t1 (a00) VALUES ('bfa')
|
AAA query: SET DEBUG_SYNC = 'before_insert_pessimitic_row_ins_clust SIGNAL reached WAIT_FOR continue'
|
AAA query: SET DEBUG_SYNC = 'now WAIT_FOR reached'
|
AAA query: INSERT INTO t1 (a00) VALUES ('bfb')
|
AAA query: SELECT a00,a01 FROM t1 WHERE a00 = 'aa'
|
AAA ha_innobase(t1)->records_in_range(key=0, min_key=0x7f8bf8057ec0, max_key=0x7f8bf8057ee0)=
|
Note that this is the first records_in_range() call made for the entire testcase
In the debugger:
it hangs here:
Thread 16 (Thread 0x7f8bf805b700 (LWP 21446)):
|
#0 0x00007f8bfdc7e9f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x55f026e33750) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
|
#1 __pthread_cond_wait_common (abstime=0x0, mutex=0x55f026e33700, cond=0x55f026e33728) at pthread_cond_wait.c:502
|
#2 __pthread_cond_wait (cond=0x55f026e33728, mutex=0x55f026e33700) at pthread_cond_wait.c:655
|
#3 0x000055f023b5524c in os_event::wait (this=0x55f026e336e8) at /home/psergey/dev-git2/10.5-cl/storage/innobase/os/os0event.cc:158
|
#4 0x000055f023b54d30 in os_event::wait_low (this=0x55f026e336e8, reset_sig_count=1) at /home/psergey/dev-git2/10.5-cl/storage/innobase/os/os0event.cc:325
|
#5 0x000055f023b5504d in os_event_wait_low (event=0x55f026e336e8, reset_sig_count=1) at /home/psergey/dev-git2/10.5-cl/storage/innobase/os/os0event.cc:502
|
#6 0x000055f023c81409 in sync_array_wait_event (arr=0x55f026cd2178, cell=@0x7f8bf8052478: 0x55f026cd2348) at /home/psergey/dev-git2/10.5-cl/storage/innobase/sync/sync0arr.cc:472
|
#7 0x000055f023c8630c in rw_lock_s_lock_spin (lock=0x7f8bf2430a10, pass=0, file_name=0x55f024443b38 "/home/psergey/dev-git2/10.5-cl/storage/innobase/btr/btr0cur.cc", line=6195) at /home/psergey/dev-git2/10.5-cl/storage/innobase/sync/sync0rw.cc:367
|
#8 0x000055f023d53f43 in rw_lock_s_lock_func (lock=0x7f8bf2430a10, pass=0, file_name=0x55f024443b38 "/home/psergey/dev-git2/10.5-cl/storage/innobase/btr/btr0cur.cc", line=6195) at /home/psergey/dev-git2/10.5-cl/storage/innobase/include/sync0rw.ic:285
|
#9 0x000055f023d54de4 in pfs_rw_lock_s_lock_func (lock=0x7f8bf2430a10, pass=0, file_name=0x55f024443b38 "/home/psergey/dev-git2/10.5-cl/storage/innobase/btr/btr0cur.cc", line=6195) at /home/psergey/dev-git2/10.5-cl/storage/innobase/include/sync0rw.ic:647
|
#10 0x000055f023d60786 in buf_page_mtr_lock (block=0x7f8bf2430960, rw_latch=1, mtr=0x7f8bf80577a0, file=0x55f024443b38 "/home/psergey/dev-git2/10.5-cl/storage/innobase/btr/btr0cur.cc", line=6195) at /home/psergey/dev-git2/10.5-cl/storage/innobase/buf/buf0buf.cc:3238
|
#11 0x000055f023d628d5 in buf_page_get_low (page_id=..., zip_size=0, rw_latch=1, guess=0x0, mode=10, file=0x55f024443b38 "/home/psergey/dev-git2/10.5-cl/storage/innobase/btr/btr0cur.cc", line=6195, mtr=0x7f8bf80577a0, err=0x7f8bf8052920, allow_ibuf_merge=false) at /home/psergey/dev-git2/10.5-cl/storage/innobase/buf/buf0buf.cc:3928
|
#12 0x000055f023d62b28 in buf_page_get_gen (page_id=..., zip_size=0, rw_latch=1, guess=0x0, mode=10, file=0x55f024443b38 "/home/psergey/dev-git2/10.5-cl/storage/innobase/btr/btr0cur.cc", line=6195, mtr=0x7f8bf80577a0, err=0x7f8bf8052920, allow_ibuf_merge=false) at /home/psergey/dev-git2/10.5-cl/storage/innobase/buf/buf0buf.cc:3981
|
#13 0x000055f023d1f4f8 in btr_cur_search_to_nth_level_func (index=0x7f8bb890bb08, level=0, tuple=0x7f8bb4024ce8, mode=PAGE_CUR_GE, latch_mode=1, cursor=0x7f8bf8053700, ahi_latch=0x0, file=0x55f024443b38 "/home/psergey/dev-git2/10.5-cl/storage/innobase/btr/btr0cur.cc", line=6195, mtr=0x7f8bf80577a0, autoinc=0) at /home/psergey/dev-git2/10.5-cl/storage/innobase/btr/btr0cur.cc:1604
|
#14 0x000055f023d321ee in btr_estimate_n_rows_in_range_low (index=0x7f8bb890bb08, tuple1=0x7f8bf8057d10, tuple2=0x7f8bf8057d30, nth_attempt=1) at /home/psergey/dev-git2/10.5-cl/storage/innobase/btr/btr0cur.cc:6191
|
#15 0x000055f023d32e25 in btr_estimate_n_rows_in_range (index=0x7f8bb890bb08, tuple1=0x7f8bf8057d10, tuple2=0x7f8bf8057d30) at /home/psergey/dev-git2/10.5-cl/storage/innobase/btr/btr0cur.cc:6521
|
#16 0x000055f023a5ca31 in ha_innobase::records_in_range (this=0x7f8bb401e730, keynr=0, min_key=0x7f8bf8057ec0, max_key=0x7f8bf8057ee0, pages=0x7f8bf8057e90) at /home/psergey/dev-git2/10.5-cl/storage/innobase/handler/ha_innodb.cc:14059
|
#17 0x000055f02349363e in handler::multi_range_read_info_const (this=0x7f8bb401e730, keyno=0, seq=0x7f8bf8058070, seq_init_param=0x7f8bf80580a0, n_ranges_arg=0, bufsz=0x7f8bf8057f74, flags=0x7f8bf8057f70, cost=0x7f8bf8058720) at /home/psergey/dev-git2/10.5-cl/sql/multi_range_read.cc:177
|
#18 0x000055f02349738c in DsMrr_impl::dsmrr_info_const (this=0x7f8bb401ec30, keyno=0, seq=0x7f8bf8058070, seq_init_param=0x7f8bf80580a0, n_ranges=0, bufsz=0x7f8bf8058638, flags=0x7f8bf8058634, cost=0x7f8bf8058720) at /home/psergey/dev-git2/10.5-cl/sql/multi_range_read.cc:1708
|
#19 0x000055f023a66d86 in ha_innobase::multi_range_read_info_const (this=0x7f8bb401e730, keyno=0, seq=0x7f8bf8058070, seq_init_param=0x7f8bf80580a0, n_ranges=0, bufsz=0x7f8bf8058638, flags=0x7f8bf8058634, cost=0x7f8bf8058720) at /home/psergey/dev-git2/10.5-cl/storage/innobase/handler/ha_innodb.cc:20578
|
The range endpoints are:
(gdb) p *min_key
|
$9 = {key = 0x7f9054022cf8 "aa", ' ' <repeats 198 times>..., length = 255, keypart_map = 1, flag = HA_READ_KEY_EXACT}
|
(gdb) p *max_key
|
$10 = {key = 0x7f90540233f8 "aa", ' ' <repeats 198 times>..., length = 255, keypart_map = 1, flag = HA_READ_AFTER_KEY}
|
that is, it is asking for records_in_range(a00 = 'aa') which is perfectly reasonable.
marko, I don't see anything wrong with what records_in_range() calls are made by the optimizer, here.
psergey, I am sorry for wasting your time.
I was initially suspecting that this could have something to do with MDEV-16678, but adding an explicit wait_all_purged.inc before the critical part did not affect anything.
A better suspect for the test failure could be the removal of the MLOG_COMP_END_COPY_CREATED operations in MDEV-12353, which affected the way how B-tree pages are split during INSERT operations. This test is aiming for a specific layout of the B-tree, and that change could likely ruin it.
Already the first page split of the test seems to go unexpectedly. The records (aa,ab,ac) are supposed to go into the left leaf page, and the (ad,ae,af,ag,ah) into the right leaf. What happens instead is that (aa,ab,ac,ad,ae,af,ag) will go into the left leaf and (ah) into the right leaf.
Because PAGE_LAST_INSERT is no longer reset to 0, btr_page_get_split_rec_to_right() would behave differently, resulting in a different tree structure. With the following code changes to ensure that PAGE_LAST_INSERT will remain at compatible state, the test will succeed:
diff --git a/storage/innobase/btr/btr0bulk.cc b/storage/innobase/btr/btr0bulk.cc
|
index 4fdae95c173..d199f1230dc 100644
|
--- a/storage/innobase/btr/btr0bulk.cc
|
+++ b/storage/innobase/btr/btr0bulk.cc
|
@@ -466,28 +466,20 @@ inline void PageBulk::finishPage()
|
}
|
|
ut_ad(!m_index->is_spatial());
|
- ut_ad(!page_get_instant(m_page));
|
- ut_ad(!mach_read_from_2(PAGE_HEADER + PAGE_N_DIRECTION + m_page));
|
|
if (fmt != COMPRESSED)
|
{
|
static_assert(PAGE_N_DIR_SLOTS == 0, "compatibility");
|
- alignas(8) byte page_header[PAGE_N_RECS + 2];
|
+ alignas(8) byte page_header[PAGE_N_HEAP + 2];
|
mach_write_to_2(page_header + PAGE_N_DIR_SLOTS,
|
1 + (slot0 - slot) / PAGE_DIR_SLOT_SIZE);
|
mach_write_to_2(page_header + PAGE_HEAP_TOP, m_heap_top - m_page);
|
mach_write_to_2(page_header + PAGE_N_HEAP,
|
(PAGE_HEAP_NO_USER_LOW + m_rec_no) |
|
uint16_t{fmt != REDUNDANT} << 15);
|
- memset_aligned<2>(page_header + PAGE_FREE, 0, 4);
|
- static_assert(PAGE_GARBAGE == PAGE_FREE + 2, "compatibility");
|
- mach_write_to_2(page_header + PAGE_LAST_INSERT, m_cur_rec - m_page);
|
- mach_write_to_2(page_header + PAGE_DIRECTION_B - 1, PAGE_RIGHT);
|
- mach_write_to_2(page_header + PAGE_N_DIRECTION, m_rec_no);
|
- memcpy_aligned<2>(page_header + PAGE_N_RECS,
|
- page_header + PAGE_N_DIRECTION, 2);
|
m_mtr.memcpy(*m_block, PAGE_HEADER + m_page, page_header,
|
sizeof page_header);
|
+ m_mtr.write<2>(*m_block, PAGE_HEADER + PAGE_N_RECS + m_page, m_rec_no);
|
m_mtr.memcpy(*m_block, page_offset(slot), slot0 - slot);
|
}
|
else
|
@@ -501,14 +493,7 @@ inline void PageBulk::finishPage()
|
mach_write_to_2(PAGE_HEADER + PAGE_N_HEAP + m_page,
|
(PAGE_HEAP_NO_USER_LOW + m_rec_no) | 1U << 15);
|
mach_write_to_2(PAGE_HEADER + PAGE_N_RECS + m_page, m_rec_no);
|
- mach_write_to_2(PAGE_HEADER + PAGE_LAST_INSERT + m_page,
|
- static_cast<ulint>(m_cur_rec - m_page));
|
- mach_write_to_2(PAGE_HEADER + PAGE_DIRECTION_B - 1 + m_page, PAGE_RIGHT);
|
}
|
-
|
- ut_ad(m_total_data + page_dir_calc_reserved_space(m_rec_no) <=
|
- page_get_free_space_of_empty(m_is_comp));
|
- m_block->skip_flush_check= false;
|
}
|
|
/** Mark end of insertion to the page. Scan all records to set page dirs,
|
@@ -522,6 +507,15 @@ inline void PageBulk::finish()
|
finishPage<DYNAMIC>();
|
else
|
finishPage<REDUNDANT>();
|
+
|
+ ut_ad(!page_header_get_field(m_page, PAGE_FREE));
|
+ ut_ad(!page_header_get_field(m_page, PAGE_GARBAGE));
|
+ ut_ad(!page_header_get_field(m_page, PAGE_LAST_INSERT));
|
+ ut_ad(page_header_get_field(m_page, PAGE_INSTANT) == PAGE_NO_DIRECTION);
|
+ ut_ad(!page_header_get_field(m_page, PAGE_N_DIRECTION));
|
+ ut_ad(m_total_data + page_dir_calc_reserved_space(m_rec_no) <=
|
+ page_get_free_space_of_empty(m_is_comp));
|
+ m_block->skip_flush_check= false;
|
}
|
|
/** Commit inserts done to the page
|
diff --git a/storage/innobase/page/page0page.cc b/storage/innobase/page/page0page.cc
|
index 2458a40ec1d..f402792671b 100644
|
--- a/storage/innobase/page/page0page.cc
|
+++ b/storage/innobase/page/page0page.cc
|
@@ -562,8 +562,11 @@ page_copy_rec_list_end(
|
|
const mtr_log_t log_mode = new_page_zip
|
? mtr->set_log_mode(MTR_LOG_NONE) : MTR_LOG_NONE;
|
- ut_d(const bool was_empty = page_dir_get_n_heap(new_page)
|
- == PAGE_HEAP_NO_USER_LOW);
|
+ const bool was_empty = page_dir_get_n_heap(new_page)
|
+ == PAGE_HEAP_NO_USER_LOW;
|
+ alignas(2) byte h[PAGE_N_DIRECTION + 2 - PAGE_LAST_INSERT];
|
+ memcpy_aligned<2>(h, PAGE_HEADER + PAGE_LAST_INSERT + new_page,
|
+ sizeof h);
|
|
if (index->is_spatial()) {
|
ulint max_to_move = page_get_n_recs(
|
@@ -584,6 +587,11 @@ page_copy_rec_list_end(
|
} else {
|
page_copy_rec_list_end_no_locks(new_block, block, rec,
|
index, mtr);
|
+ if (was_empty) {
|
+ mtr->memcpy<mtr_t::MAYBE_NOP>(*new_block, PAGE_HEADER
|
+ + PAGE_LAST_INSERT
|
+ + new_page, h, sizeof h);
|
+ }
|
}
|
|
/* Update PAGE_MAX_TRX_ID on the uncompressed page. |
This would also require that the test changes of the MLOG_COMP_END_COPY_CREATED removal be reverted.
I will double-check the tree layout. I was under the impression that the change was an improvement, making index trees smaller.
It turns out that this issue had likely been fixed in MariaDB 10.5.2, but the test failed due to MDEV-22242 that had been introduced in 10.5.2.
Note: The rowid filter that was introduced in
MDEV-16188is supposed to only be used on secondary indexes. In the test case, the table only contains the PRIMARY KEY, and yet the too-broad ha_innobase::records_in_range() calls are being submitted. Also, disabling the ROWID filter does not prevent the too-broad calls:SET optimizer_switch='rowid_filter=off';
The test would still hang at the line
I checked what change in
MDEV-16188actually affects this. That was somewhat hard, becauseMDEV-16188was pushed as a ‘jungle’ of commits, but I hope that I found the right command:git diff 5b996782be6b752ce50a0ecaa222b0688aa9e75d..33907360f56789cd9b467b40e66412eb0a0aff28 sql
The only changes to records_in_range() calls are in handler::multi_range_read_info_const() in sql/multi_range_read.cc. I tried reverting those changes in MDEV-21535-workaround.patch
. Note: this will likely break the rowid filter in some way! As expected, the test no longer hung.