mariadb/mysql-test/suite/innodb_gis/t
Marko Mäkelä f9cac8d2cb MDEV-30400 Assertion height == btr_page_get_level(...) on INSERT
This also fixes part of MDEV-29835 Partial server freeze
which is caused by violations of the latching order that was
defined in https://dev.mysql.com/worklog/task/?id=6326
(WL#6326: InnoDB: fix index->lock contention). Unless the
current thread is holding an exclusive dict_index_t::lock,
it must acquire page latches in a strict parent-to-child,
left-to-right order. Not all cases are fixed yet. Failure to
follow the correct latching order will cause deadlocks of threads
due to lock order inversion.

As part of these changes, the BTR_MODIFY_TREE mode is modified
so that an Update latch (U a.k.a. SX) will be acquired on the
root page, and eXclusive latches (X) will be acquired on all pages
leading to the leaf page, as well as any left and right siblings
of the pages along the path. The test innodb.innodb_wl6326
will be removed, because at the time the DEBUG_SYNC point is hit,
the thread is actually holding several page latches that will be
blocking a concurrent SELECT statement.

We also remove double bookkeeping that was caused due to excessive
information hiding in mtr_t::m_memo. We simply let mtr_t::m_memo
store information of latched pages, and ensure that
mtr_memo_slot_t::object is never a null pointer.
The tree_blocks[] and tree_savepoints[] were redundant.

mtr_t::get_already_latched(): Look up a latched page in mtr_t::m_memo.
This avoids many redundant entries in mtr_t::m_memo, as well as
redundant calls to buf_page_get_gen() for blocks that had already
been looked up in a mini-transaction.

btr_get_latched_root(): Return a pointer to an already latched root page.
This replaces btr_root_block_get() in cases where the mini-transaction
has already latched the root page.

btr_page_get_parent(): Fetch a parent page that was already latched
in BTR_MODIFY_TREE, by invoking mtr_t::get_already_latched().
If needed, upgrade the root page U latch to X.
This avoids bloating mtr_t::m_memo as well as redundant
buf_pool.page_hash lookups. For non-QUICK CHECK TABLE as well as for
B-tree defragmentation, we will invoke btr_cur_search_to_nth_level().

btr_cur_search_to_nth_level(): This will only be used for non-leaf
(level>0) B-tree searches that were formerly named BTR_CONT_SEARCH_TREE
or BTR_CONT_MODIFY_TREE. In MDEV-29835, this function could be
removed altogether, or retained for the case of
CHECK TABLE without QUICK.

btr_cur_t::search_leaf(): Replaces btr_cur_search_to_nth_level()
for searches to level=0 (the leaf level).

btr_cur_t::pessimistic_search_leaf(): Implement the new
BTR_MODIFY_TREE latching logic in the case that page splits
or merges will be needed. The parent pages (and their siblings)
should already be latched on the first dive to the leaf and be
present in mtr_t::m_memo; there should be no need for
BTR_CONT_MODIFY_TREE. This pre-latching almost suffices;
MDEV-29835 will have to revise it and remove work-arounds where
mtr_t::get_already_latched() fails to find a block.

rtr_search_to_nth_level(): A SPATIAL INDEX version of
btr_search_to_nth_level() that can search to any level
(including the leaf level).

rtr_search_leaf(), rtr_insert_leaf(): Wrappers for
rtr_search_to_nth_level().

rtr_search(): Replaces rtr_pcur_open().

rtr_cur_restore_position(): Remove an unused constant parameter.

btr_pcur_open_on_user_rec(): Remove the constant parameter
mode=PAGE_CUR_GE.

btr_cur_latch_leaves(): Update a pre-existing mtr_t::m_memo entry
for the current leaf page.

row_ins_clust_index_entry_low(): Use a new
mode=BTR_MODIFY_ROOT_AND_LEAF to gain access to the root page
when mode!=BTR_MODIFY_TREE, to write the PAGE_ROOT_AUTO_INC.

btr_cur_t::open_leaf(): Some clean-up.

mtr_t::lock_register(): Register a page latch on a buffer-fixed block.

BTR_SEARCH_TREE, BTR_CONT_SEARCH_TREE: Remove.

BTR_CONT_MODIFY_TREE: Note that this is only used by
rtr_search_to_nth_level().

btr_pcur_optimistic_latch_leaves(): Replaces
btr_cur_optimistic_latch_leaves().

ibuf_delete_rec(): Acquire ibuf.index->lock.u_lock() in order
to avoid a deadlock with ibuf_insert_low(BTR_MODIFY_PREV).

Tested by: Matthias Leich
2023-01-19 17:19:18 +02:00
..
0.test
1.test MDEV-4750 follow-up: Reduce disabling innodb_stats_persistent 2021-08-31 13:55:02 +03:00
alter_spatial_index.test Merge 10.5 into 10.6 2022-11-08 17:37:22 +02:00
bug16236208.test MDEV-13467: Feature request: Support for ST_Distance_Sphere() 2021-03-27 10:42:39 +01:00
bug16266012.test MDEV-14057 InnoDB GIS tests fail. 2020-03-18 13:55:21 +04:00
bug17057168.test MariaDB adjustments to innodb_gis tests. 2017-10-25 06:47:08 +03:00
check_rtree.test
create_spatial_index.test Merge 10.5 into 10.6 2021-03-31 12:04:50 +03:00
geometry.test MDEV-4750 follow-up: Reduce disabling innodb_stats_persistent 2021-08-31 13:55:02 +03:00
gis.test MDEV-4750 follow-up: Reduce disabling innodb_stats_persistent 2021-08-31 13:55:02 +03:00
gis_split_inf.test MDEV-14057 InnoDB GIS tests fail. 2020-03-18 13:55:21 +04:00
gis_split_nan.test MDEV-13626: Merge InnoDB test cases from MySQL 5.7 2017-10-25 06:47:08 +03:00
innodb_gis_rtree.test Create 'main' test directory and move 't' and 'r' there 2018-03-29 13:59:44 +03:00
kill_server.test Adjust tests after commit b5615eff0d 2019-04-02 11:03:28 +03:00
multi_pk.test MSAN: Disable some slow tests 2022-06-30 13:00:58 +03:00
point_basic.test MDEV-4750 follow-up: Reduce disabling innodb_stats_persistent 2021-08-31 13:55:02 +03:00
point_big.test MDEV-4750 follow-up: Reduce disabling innodb_stats_persistent 2021-08-31 13:55:02 +03:00
precise.test Merge 10.2 into 10.3 2021-03-31 08:01:03 +03:00
repeatable_spatial.test MDEV-13626: Merge InnoDB test cases from MySQL 5.7 2017-10-25 06:47:08 +03:00
rollback.test Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3 2017-10-30 20:47:39 +04:00
rt_precise.test MDEV-4750 follow-up: Reduce disabling innodb_stats_persistent 2021-08-31 13:55:02 +03:00
rtree.test MDEV-13467: Feature request: Support for ST_Distance_Sphere() 2021-03-27 10:42:39 +01:00
rtree_add_index.test MDEV-19485: Crash on purge after ADD SPATIAL INDEX 2019-05-16 14:33:24 +03:00
rtree_compress.test MDEV-14057 InnoDB GIS tests fail 2018-01-04 19:46:23 +02:00
rtree_compress2.test Merge branch '10.3' into 10.4 2019-09-06 11:53:10 +02:00
rtree_concurrent_srch.test MDEV-515 Reduce InnoDB undo logging for insert into empty table 2021-01-25 18:41:27 +02:00
rtree_create_inplace.test MDEV-13626: Merge InnoDB test cases from MySQL 5.7 2017-10-25 06:47:08 +03:00
rtree_debug.test MDEV-21360 global debug_dbug pre-test value restoration issues 2020-01-15 18:06:24 +01:00
rtree_drop_index.test MariaDB adjustments to innodb_gis tests. 2017-10-25 06:47:08 +03:00
rtree_estimate.test MDEV-16188 Post-merge corrections and adjustments 2019-02-04 22:44:33 -08:00
rtree_multi_pk.test MDEV-14057 InnoDB GIS tests fail. 2020-03-18 13:55:21 +04:00
rtree_purge.test MSAN: Disable some slow tests 2022-06-30 13:00:58 +03:00
rtree_recovery.test Re-remove the file kill_and_restart_mysqld.inc 2017-12-14 08:40:09 +02:00
rtree_rollback1.test Enable tests for --embedded 2020-01-20 08:41:13 +02:00
rtree_rollback2.test Enable tests for --embedded 2020-01-20 08:41:13 +02:00
rtree_search.test MDEV-14209 innodb_gis.rtree_debug produces huge server error logs 2018-01-29 23:02:12 +02:00
rtree_split.test MDEV-30400 Assertion height == btr_page_get_level(...) on INSERT 2023-01-19 17:19:18 +02:00
rtree_temporary.test MDEV-29507 InnoDB: Failing assertion: table->n_rec_locks == 0 2022-09-12 09:27:46 +03:00
rtree_undo.test MDEV-14057 InnoDB GIS tests fail 2018-01-04 19:46:23 +02:00
types.test MDEV-4750 follow-up: Reduce disabling innodb_stats_persistent 2021-08-31 13:55:02 +03:00
update_root.test Speed up of innodb_gis.update_root test 10x by adding BEGIN/COMMIT 2021-06-19 03:46:00 +03:00