Skip to content

Commit c5883de

Browse files
committed
dict_check_sys_tables(): Do not rely on buf_page_optimistic_get()
We are supposed to commit and restart the mini-transaction between records. There is no point to store and restore the persistent cursor position otherwise. If buf_page_optimistic_get() is patched to always fail, the debug build would fail to start up due to trying to re-acquire an already S-latched block. This bug (which should not have visible impact to users, because the code is only executed during startup, while no other threads are accessing B-trees or causing pages to be evicted from the buffer pool) was caught as part of a debugging effort for something else. The debugging approach was: Make buf_page_optimistic_get() always return FALSE, and add ut_a(block->lock.lock_word == X_LOCK_DECR) to both buf_LRU_get_free_only() and buf_LRU_block_free_non_file_page(). This would catch misuse of the buffer pool. If it were not for buf_page_optimistic_get(), no buf_block_t::lock of any BUF_BLOCK_NOT_USED block would ever be acquired.
1 parent f69278b commit c5883de

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

storage/innobase/dict/dict0load.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,6 +1388,7 @@ static ulint dict_check_sys_tables()
13881388

13891389
for (rec = dict_startscan_system(&pcur, &mtr, SYS_TABLES);
13901390
rec != NULL;
1391+
mtr.commit(), mtr.start(),
13911392
rec = dict_getnext_system(&pcur, &mtr)) {
13921393
const byte* field;
13931394
ulint len;

0 commit comments

Comments
 (0)