summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-06-04 16:31:29 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-06-04 16:31:29 +0300
commitc5883debd6ef440a037011c11873b396923e93c5 (patch)
treed801585463f8355445ca7b7a2ee11703adc7779f
parentf69278bcd0a1ffba767918b040f6e8465c37397b (diff)
downloadmariadb-git-c5883debd6ef440a037011c11873b396923e93c5.tar.gz
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.
-rw-r--r--storage/innobase/dict/dict0load.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc
index 96309329ad4..63ccf6bbb96 100644
--- a/storage/innobase/dict/dict0load.cc
+++ b/storage/innobase/dict/dict0load.cc
@@ -1388,6 +1388,7 @@ static ulint dict_check_sys_tables()
for (rec = dict_startscan_system(&pcur, &mtr, SYS_TABLES);
rec != NULL;
+ mtr.commit(), mtr.start(),
rec = dict_getnext_system(&pcur, &mtr)) {
const byte* field;
ulint len;