Skip to content

Commit 03ca649

Browse files
committed
MDEV-24142: Replace InnoDB rw_lock_t with sux_lock
InnoDB buffer pool block and index tree latches depend on a special kind of read-update-write lock that allows reentrant (recursive) acquisition of the 'update' and 'write' locks as well as an upgrade from 'update' lock to 'write' lock. The 'update' lock allows any number of reader locks from other threads, but no concurrent 'update' or 'write' lock. If there were no requirement to support an upgrade from 'update' to 'write', we could compose the lock out of two srw_lock (implemented as any type of native rw-lock, such as SRWLOCK on Microsoft Windows). Removing this requirement is very difficult, so in commit f7e7f487d4b06695f91f6fbeb0396b9d87fc7bbf we implemented an 'update' mode to our srw_lock. Re-entrant or recursive locking is mostly needed when writing or freeing BLOB pages, but also in crash recovery or when merging buffered changes to an index page. The re-entrancy allows us to attach a previously acquired page to a sub-mini-transaction that will be committed before whatever else is holding the page latch. The SUX lock supports Shared ('read'), Update, and eXclusive ('write') locking modes. The S latches are not re-entrant, but a single S latch may be acquired even if the thread already holds an U latch. The idea of the U latch is to allow a write of something that concurrent readers do not care about (such as the contents of BTR_SEG_LEAF, BTR_SEG_TOP and other page allocation metadata structures, or the MDEV-6076 PAGE_ROOT_AUTO_INC). (The PAGE_ROOT_AUTO_INC field is only updated when a dict_table_t for the table exists, and only read when a dict_table_t for the table is being added to dict_sys.) block_lock::u_lock_try(bool for_io=true) is used in buf_flush_page() to allow concurrent readers but no concurrent modifications while the page is being written to the data file. That latch will be released by buf_page_write_complete() in a different thread. Hence, we use the special lock owner value FOR_IO. The index_lock::u_lock() improves concurrency on operations that involve non-leaf index pages. The interface has been cleaned up a little. We will use x_lock_recursive() instead of x_lock() when we know that a lock is already held by the current thread. Similarly, a lock upgrade from U to X is only allowed via u_x_upgrade() or x_lock_upgraded() but not via x_lock(). We will disable the LatchDebug and sync_array interfaces to InnoDB rw-locks. The SEMAPHORES section of SHOW ENGINE INNODB STATUS output will no longer include any information about InnoDB rw-locks, only TTASEventMutex (cmake -DMUTEXTYPE=event) waits. This will make a part of the 'innotop' script dead code. The block_lock buf_block_t::lock will not be covered by any PERFORMANCE_SCHEMA instrumentation. SHOW ENGINE INNODB MUTEX and INFORMATION_SCHEMA.INNODB_MUTEXES will no longer output source code file names or line numbers. The dict_index_t::lock will be identified by index and table names, which should be much more useful. PERFORMANCE_SCHEMA is lumping information about all dict_index_t::lock together as event_name='wait/synch/sxlock/innodb/index_tree_rw_lock'. buf_page_free(): Remove the file,line parameters. The sux_lock will not store such diagnostic information. buf_block_dbg_add_level(): Define as empty macro, to be removed in a subsequent commit. Unless the build was configured with cmake -DPLUGIN_PERFSCHEMA=NO the index_lock dict_index_t::lock will be instrumented via PERFORMANCE_SCHEMA. Similar to commit 1669c88 we will distinguish lock waits by registering shared_lock,exclusive_lock events instead of try_shared_lock,try_exclusive_lock. Actual 'try' operations will not be instrumented at all. rw_lock_list: Remove. After MDEV-24167, this only covered buf_block_t::lock and dict_index_t::lock. We will output their information by traversing buf_pool or dict_sys.
1 parent d46b424 commit 03ca649

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1289
-4493
lines changed

mysql-test/suite/innodb/disabled.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
##############################################################################
1212

1313
create-index-debug : MDEV-13680 InnoDB may crash when btr_page_alloc() fails
14+
innodb_wl6326_big : MDEV-24142 FIXME: no instrumentation

mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -243,15 +243,6 @@ innodb_dict_lru_count_idle server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NU
243243
innodb_dblwr_writes server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of doublewrite operations that have been performed (innodb_dblwr_writes)
244244
innodb_dblwr_pages_written server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of pages that have been written for doublewrite operations (innodb_dblwr_pages_written)
245245
innodb_page_size server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value InnoDB page size in bytes (innodb_page_size)
246-
innodb_rwlock_s_spin_waits server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of rwlock spin waits due to shared latch request
247-
innodb_rwlock_x_spin_waits server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of rwlock spin waits due to exclusive latch request
248-
innodb_rwlock_sx_spin_waits server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of rwlock spin waits due to sx latch request
249-
innodb_rwlock_s_spin_rounds server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of rwlock spin loop rounds due to shared latch request
250-
innodb_rwlock_x_spin_rounds server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of rwlock spin loop rounds due to exclusive latch request
251-
innodb_rwlock_sx_spin_rounds server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of rwlock spin loop rounds due to sx latch request
252-
innodb_rwlock_s_os_waits server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of OS waits due to shared latch request
253-
innodb_rwlock_x_os_waits server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of OS waits due to exclusive latch request
254-
innodb_rwlock_sx_os_waits server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of OS waits due to sx latch request
255246
dml_reads dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of rows read
256247
dml_inserts dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of rows inserted
257248
dml_deletes dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of rows deleted
@@ -373,7 +364,7 @@ SPACE NAME ENCRYPTION_SCHEME KEYSERVER_REQUESTS MIN_KEY_VERSION CURRENT_KEY_VERS
373364
Warnings:
374365
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_tablespaces_encryption but the InnoDB storage engine is not installed
375366
select * from information_schema.innodb_mutexes;
376-
NAME CREATE_FILE CREATE_LINE OS_WAITS
367+
NAME OS_WAITS
377368
Warnings:
378369
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_mutexes but the InnoDB storage engine is not installed
379370
select * from information_schema.innodb_sys_semaphore_waits;

mysql-test/suite/innodb/r/monitor.result

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,6 @@ innodb_dict_lru_count_idle disabled
209209
innodb_dblwr_writes disabled
210210
innodb_dblwr_pages_written disabled
211211
innodb_page_size disabled
212-
innodb_rwlock_s_spin_waits disabled
213-
innodb_rwlock_x_spin_waits disabled
214-
innodb_rwlock_sx_spin_waits disabled
215-
innodb_rwlock_s_spin_rounds disabled
216-
innodb_rwlock_x_spin_rounds disabled
217-
innodb_rwlock_sx_spin_rounds disabled
218-
innodb_rwlock_s_os_waits disabled
219-
innodb_rwlock_x_os_waits disabled
220-
innodb_rwlock_sx_os_waits disabled
221212
dml_reads disabled
222213
dml_inserts disabled
223214
dml_deletes disabled
@@ -272,15 +263,6 @@ lock_row_lock_time disabled
272263
lock_row_lock_time_max disabled
273264
lock_row_lock_waits disabled
274265
lock_row_lock_time_avg disabled
275-
innodb_rwlock_s_spin_waits disabled
276-
innodb_rwlock_x_spin_waits disabled
277-
innodb_rwlock_sx_spin_waits disabled
278-
innodb_rwlock_s_spin_rounds disabled
279-
innodb_rwlock_x_spin_rounds disabled
280-
innodb_rwlock_sx_spin_rounds disabled
281-
innodb_rwlock_s_os_waits disabled
282-
innodb_rwlock_x_os_waits disabled
283-
innodb_rwlock_sx_os_waits disabled
284266
set global innodb_monitor_enable = "%lock*";
285267
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '%lock*'
286268
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";

mysql-test/suite/innodb_i_s/innodb_mutexes.result

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_MUTEXES;
22
Table Create Table
33
INNODB_MUTEXES CREATE TEMPORARY TABLE `INNODB_MUTEXES` (
44
`NAME` varchar(4000) NOT NULL DEFAULT '',
5-
`CREATE_FILE` varchar(4000) NOT NULL DEFAULT '',
6-
`CREATE_LINE` int(11) unsigned NOT NULL DEFAULT 0,
75
`OS_WAITS` bigint(21) unsigned NOT NULL DEFAULT 0
86
) ENGINE=MEMORY DEFAULT CHARSET=utf8

mysql-test/suite/perfschema/r/sxlock_func.result

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ ORDER BY event_name;
3939
event_name
4040
wait/synch/rwlock/innodb/dict_operation_lock
4141
wait/synch/rwlock/innodb/fil_space_latch
42-
select operation from performance_schema.events_waits_history_long
43-
where event_name like "wait/synch/sxlock/%"
44-
and operation = "shared_lock" limit 1;
45-
operation
46-
shared_lock
47-
select operation from performance_schema.events_waits_history_long
48-
where event_name like "wait/synch/sxlock/%"
49-
and operation = "exclusive_lock" limit 1;
50-
operation
51-
exclusive_lock
42+
SELECT event_name FROM performance_schema.events_waits_history_long
43+
WHERE event_name = 'wait/synch/sxlock/innodb/index_tree_rw_lock'
44+
AND operation IN ('try_shared_lock','shared_lock') LIMIT 1;
45+
event_name
46+
wait/synch/sxlock/innodb/index_tree_rw_lock
47+
SELECT event_name from performance_schema.events_waits_history_long
48+
WHERE event_name = 'wait/synch/sxlock/innodb/index_tree_rw_lock'
49+
AND operation IN ('try_exclusive_lock','exclusive_lock') LIMIT 1;
50+
event_name
51+
wait/synch/sxlock/innodb/index_tree_rw_lock
5252
UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';

mysql-test/suite/perfschema/t/sxlock_func.test

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,26 +52,15 @@ ORDER BY event_name;
5252

5353
# Make sure some shared_lock operations have been executed
5454

55-
select operation from performance_schema.events_waits_history_long
56-
where event_name like "wait/synch/sxlock/%"
57-
and operation = "shared_lock" limit 1;
55+
SELECT event_name FROM performance_schema.events_waits_history_long
56+
WHERE event_name = 'wait/synch/sxlock/innodb/index_tree_rw_lock'
57+
AND operation IN ('try_shared_lock','shared_lock') LIMIT 1;
5858

5959
# Make sure some exclusive_lock operations have been executed
6060

61-
select operation from performance_schema.events_waits_history_long
62-
where event_name like "wait/synch/sxlock/%"
63-
and operation = "exclusive_lock" limit 1;
64-
65-
# The following operations are not verified in this test:
66-
# - shared_exclusive_lock
67-
# - try_shared_lock
68-
# - try_shared_exclusive_lock
69-
# - try_exclusive_lock
70-
# because to observe them:
71-
# - there must be an actual code path using the operation
72-
# (this affects try operations, which are not all used)
73-
# - there must be a repeatable scenario to trigger the
74-
# code path, to use as payload in the test script
61+
SELECT event_name from performance_schema.events_waits_history_long
62+
WHERE event_name = 'wait/synch/sxlock/innodb/index_tree_rw_lock'
63+
AND operation IN ('try_exclusive_lock','exclusive_lock') LIMIT 1;
7564

7665
# Cleanup
7766

storage/innobase/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ SET(INNOBASE_SOURCES
234234
include/row0upd.h
235235
include/row0upd.ic
236236
include/row0vers.h
237+
include/rw_lock.h
237238
include/srv0mon.h
238239
include/srv0mon.ic
239240
include/srv0srv.h
@@ -242,8 +243,7 @@ SET(INNOBASE_SOURCES
242243
include/sync0arr.ic
243244
include/sync0debug.h
244245
include/sync0policy.h
245-
include/sync0rw.h
246-
include/sync0rw.ic
246+
include/sux_lock.h
247247
include/sync0sync.h
248248
include/sync0types.h
249249
include/trx0i_s.h
@@ -329,7 +329,6 @@ SET(INNOBASE_SOURCES
329329
srv/srv0start.cc
330330
sync/srw_lock.cc
331331
sync/sync0arr.cc
332-
sync/sync0rw.cc
333332
sync/sync0debug.cc
334333
sync/sync0sync.cc
335334
trx/trx0i_s.cc

storage/innobase/btr/btr0btr.cc

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,6 @@ btr_height_get(
299299

300300
/* Release the S latch on the root page. */
301301
mtr->memo_release(root_block, MTR_MEMO_PAGE_S_FIX);
302-
303-
ut_d(sync_check_unlock(&root_block->lock));
304302
}
305303

306304
return(height);
@@ -728,7 +726,7 @@ void btr_page_free(dict_index_t* index, buf_block_t* block, mtr_t* mtr,
728726
: PAGE_HEADER + PAGE_BTR_SEG_TOP];
729727
fseg_free_page(seg_header,
730728
index->table->space, id.page_no(), mtr, space_latched);
731-
buf_page_free(id, mtr, __FILE__, __LINE__);
729+
buf_page_free(id, mtr);
732730

733731
/* The page was marked free in the allocation bitmap, but it
734732
should remain exclusively latched until mtr_t::commit() or until it
@@ -2782,8 +2780,7 @@ btr_page_split_and_insert(
27822780
ut_ad(!dict_index_is_online_ddl(cursor->index)
27832781
|| (flags & BTR_CREATE_FLAG)
27842782
|| dict_index_is_clust(cursor->index));
2785-
ut_ad(rw_lock_own_flagged(dict_index_get_lock(cursor->index),
2786-
RW_LOCK_FLAG_X | RW_LOCK_FLAG_SX));
2783+
ut_ad(cursor->index->lock.have_u_or_x());
27872784

27882785
block = btr_cur_get_block(cursor);
27892786
page = buf_block_get_frame(block);
@@ -2933,9 +2930,8 @@ btr_page_split_and_insert(
29332930
&& page_is_leaf(page)
29342931
&& !dict_index_is_online_ddl(cursor->index)) {
29352932

2936-
mtr->memo_release(
2937-
dict_index_get_lock(cursor->index),
2938-
MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK);
2933+
mtr->memo_release(&cursor->index->lock,
2934+
MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK);
29392935

29402936
/* NOTE: We cannot release root block latch here, because it
29412937
has segment header and already modified in most of cases.*/

storage/innobase/btr/btr0bulk.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ PageBulk::release()
834834
finish();
835835

836836
/* We fix the block because we will re-pin it soon. */
837-
buf_block_buf_fix_inc(m_block, __FILE__, __LINE__);
837+
buf_block_buf_fix_inc(m_block);
838838

839839
/* No other threads can modify this block. */
840840
m_modify_clock = buf_block_get_modify_clock(m_block);
@@ -949,9 +949,7 @@ BtrBulk::pageCommit(
949949
page_bulk->set_modified();
950950
}
951951

952-
ut_ad(!rw_lock_own_flagged(&m_index->lock,
953-
RW_LOCK_FLAG_X | RW_LOCK_FLAG_SX
954-
| RW_LOCK_FLAG_S));
952+
ut_ad(!m_index->lock.have_any());
955953

956954
/* Compress page if it's a compressed table. */
957955
if (page_bulk->getPageZip() != NULL && !page_bulk->compress()) {

storage/innobase/btr/btr0cur.cc

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,9 @@ btr_cur_latch_leaves(
344344
case BTR_MODIFY_PREV:
345345
mode = latch_mode == BTR_SEARCH_PREV ? RW_S_LATCH : RW_X_LATCH;
346346
/* latch also left sibling */
347-
rw_lock_s_lock(&block->lock);
347+
block->lock.s_lock();
348348
left_page_no = btr_page_get_prev(block->frame);
349-
rw_lock_s_unlock(&block->lock);
349+
block->lock.s_unlock();
350350

351351
if (left_page_no != FIL_NULL) {
352352
latch_leaves.savepoints[0] = mtr_set_savepoint(mtr);
@@ -783,14 +783,14 @@ btr_cur_optimistic_latch_leaves(
783783
modify_clock, file, line, mtr));
784784
case BTR_SEARCH_PREV:
785785
case BTR_MODIFY_PREV:
786-
rw_lock_s_lock(&block->lock);
786+
block->lock.s_lock();
787787
if (block->modify_clock != modify_clock) {
788-
rw_lock_s_unlock(&block->lock);
788+
block->lock.s_unlock();
789789
return false;
790790
}
791791
const uint32_t curr_page_no = block->page.id().page_no();
792792
const uint32_t left_page_no = btr_page_get_prev(block->frame);
793-
rw_lock_s_unlock(&block->lock);
793+
block->lock.s_unlock();
794794

795795
const rw_lock_type_t mode = *latch_mode == BTR_SEARCH_PREV
796796
? RW_S_LATCH : RW_X_LATCH;
@@ -1481,27 +1481,31 @@ btr_cur_search_to_nth_level_func(
14811481
upper_rw_latch = RW_X_LATCH;
14821482
break;
14831483
case BTR_CONT_MODIFY_TREE:
1484-
case BTR_CONT_SEARCH_TREE:
1485-
/* Do nothing */
14861484
ut_ad(srv_read_only_mode
14871485
|| mtr->memo_contains_flagged(&index->lock,
14881486
MTR_MEMO_X_LOCK
14891487
| MTR_MEMO_SX_LOCK));
1490-
if (dict_index_is_spatial(index)
1491-
&& latch_mode == BTR_CONT_MODIFY_TREE) {
1492-
/* If we are about to locating parent page for split
1488+
if (index->is_spatial()) {
1489+
/* If we are about to locate parent page for split
14931490
and/or merge operation for R-Tree index, X latch
14941491
the parent */
14951492
upper_rw_latch = RW_X_LATCH;
1496-
} else {
1497-
upper_rw_latch = RW_NO_LATCH;
1493+
break;
14981494
}
1495+
/* fall through */
1496+
case BTR_CONT_SEARCH_TREE:
1497+
/* Do nothing */
1498+
ut_ad(srv_read_only_mode
1499+
|| mtr->memo_contains_flagged(&index->lock,
1500+
MTR_MEMO_X_LOCK
1501+
| MTR_MEMO_SX_LOCK));
1502+
upper_rw_latch = RW_NO_LATCH;
14991503
break;
15001504
default:
15011505
if (!srv_read_only_mode) {
15021506
if (s_latch_by_caller) {
1503-
ut_ad(rw_lock_own(dict_index_get_lock(index),
1504-
RW_LOCK_S));
1507+
ut_ad(mtr->memo_contains_flagged(
1508+
&index->lock, MTR_MEMO_S_LOCK));
15051509
} else if (!modify_external) {
15061510
/* BTR_SEARCH_TREE is intended to be used with
15071511
BTR_ALREADY_S_LATCHED */
@@ -1710,9 +1714,9 @@ btr_cur_search_to_nth_level_func(
17101714

17111715
rw_latch = upper_rw_latch;
17121716

1713-
rw_lock_s_lock(&block->lock);
1717+
block->lock.s_lock();
17141718
left_page_no = btr_page_get_prev(buf_block_get_frame(block));
1715-
rw_lock_s_unlock(&block->lock);
1719+
block->lock.s_unlock();
17161720

17171721
if (left_page_no != FIL_NULL) {
17181722
ut_ad(prev_n_blocks < leftmost_from_level);
@@ -1856,7 +1860,7 @@ btr_cur_search_to_nth_level_func(
18561860
needs to keep tree sx-latch */
18571861
mtr_release_s_latch_at_savepoint(
18581862
mtr, savepoint,
1859-
dict_index_get_lock(index));
1863+
&index->lock);
18601864
}
18611865

18621866
/* release upper blocks */
@@ -2013,14 +2017,14 @@ btr_cur_search_to_nth_level_func(
20132017
lock_mutex_exit();
20142018

20152019
if (rw_latch == RW_NO_LATCH && height != 0) {
2016-
rw_lock_s_lock(&(block->lock));
2020+
block->lock.s_lock();
20172021
}
20182022

20192023
lock_prdt_lock(block, &prdt, index, LOCK_S,
20202024
LOCK_PREDICATE, cursor->thr);
20212025

20222026
if (rw_latch == RW_NO_LATCH && height != 0) {
2023-
rw_lock_s_unlock(&(block->lock));
2027+
block->lock.s_unlock();
20242028
}
20252029
}
20262030

@@ -2094,7 +2098,7 @@ btr_cur_search_to_nth_level_func(
20942098
ut_ad(mtr->memo_contains_flagged(
20952099
&index->lock, MTR_MEMO_X_LOCK
20962100
| MTR_MEMO_SX_LOCK));
2097-
rw_lock_s_lock(&block->lock);
2101+
block->lock.s_lock();
20982102
add_latch = true;
20992103
}
21002104

@@ -2126,7 +2130,7 @@ btr_cur_search_to_nth_level_func(
21262130
}
21272131

21282132
if (add_latch) {
2129-
rw_lock_s_unlock(&block->lock);
2133+
block->lock.s_unlock();
21302134
}
21312135

21322136
ut_ad(!page_rec_is_supremum(node_ptr));
@@ -3042,7 +3046,7 @@ btr_cur_open_at_rnd_pos_func(
30423046
if (!srv_read_only_mode) {
30433047
mtr_release_s_latch_at_savepoint(
30443048
mtr, savepoint,
3045-
dict_index_get_lock(index));
3049+
&index->lock);
30463050
}
30473051

30483052
/* release upper blocks */
@@ -5147,7 +5151,7 @@ btr_cur_pessimistic_update(
51475151
&& page_is_leaf(block->frame)
51485152
&& !dict_index_is_online_ddl(index)) {
51495153

5150-
mtr_memo_release(mtr, dict_index_get_lock(index),
5154+
mtr_memo_release(mtr, &index->lock,
51515155
MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK);
51525156

51535157
/* NOTE: We cannot release root block latch here, because it
@@ -5884,7 +5888,7 @@ btr_cur_pessimistic_delete(
58845888
&& page_is_leaf(page)
58855889
&& !dict_index_is_online_ddl(index)) {
58865890

5887-
mtr_memo_release(mtr, dict_index_get_lock(index),
5891+
mtr_memo_release(mtr, &index->lock,
58885892
MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK);
58895893

58905894
/* NOTE: We cannot release root block latch here, because it
@@ -7120,7 +7124,7 @@ struct btr_blob_log_check_t {
71207124
if (UNIV_UNLIKELY(m_op == BTR_STORE_INSERT_BULK)) {
71217125
offs = page_offset(*m_rec);
71227126
page_no = (*m_block)->page.id().page_no();
7123-
buf_block_buf_fix_inc(*m_block, __FILE__, __LINE__);
7127+
buf_block_buf_fix_inc(*m_block);
71247128
ut_ad(page_no != FIL_NULL);
71257129
} else {
71267130
btr_pcur_store_position(m_pcur, m_mtr);
@@ -7662,9 +7666,6 @@ btr_free_externally_stored_field(
76627666
ut_ad(rec || !block->page.zip.data);
76637667

76647668
for (;;) {
7665-
#ifdef UNIV_DEBUG
7666-
buf_block_t* rec_block;
7667-
#endif /* UNIV_DEBUG */
76687669
buf_block_t* ext_block;
76697670

76707671
mtr_start(&mtr);
@@ -7679,9 +7680,9 @@ btr_free_externally_stored_field(
76797680
const page_id_t page_id(page_get_space_id(p),
76807681
page_get_page_no(p));
76817682

7682-
#ifdef UNIV_DEBUG
7683-
rec_block =
7684-
#endif /* UNIV_DEBUG */
7683+
#if 0
7684+
buf_block_t* rec_block =
7685+
#endif
76857686
buf_page_get(page_id, rec_zip_size, RW_X_LATCH, &mtr);
76867687

76877688
buf_block_dbg_add_level(rec_block, SYNC_NO_ORDER_CHECK);

0 commit comments

Comments
 (0)