Commit 33589b25 authored by Jan Lindström's avatar Jan Lindström

MDEV-7762 InnoDB: Failing assertion: block->page.buf_fix_count > 0 in buf0buf.ic line 730

Analysis: debug only assertion I_S function (IS is XtraDB feature) is calling
buf_block_get_frame on any page it reads, which debug-asserts that the page is
buffer-fixed, which is not the case in I_S query.

Fixed by holding the buffer page mutex while the fields are read directly.
parent 13ad179c
CREATE TABLE t1 ENGINE=InnoDB AS SELECT * FROM mysql.help_topic;
DROP TABLE t1;
--loose-innodb_trx
--loose-innodb_locks
--loose-innodb_lock_waits
--loose-innodb_cmp
--loose-innodb_cmp_reset
--loose-innodb_cmp_per_index
--loose-innodb_cmp_per_index_reset
--loose-innodb_cmpmem
--loose-innodb_cmpmem_reset
--loose-innodb_buffer_page
--loose-innodb_buffer_page_lru
--loose-innodb_buffer_stats
--loose-innodb_sys_tables
--loose-innodb_sys_tablestats
--loose-innodb_sys_indexes
--loose-innodb_sys_columns
--loose-innodb_sys_fields
--loose-innodb_sys_foreign
--loose-innodb_sys_foreign_cols
--loose-innodb_changed_pages
--loose-innodb_rseg
--loose-innodb_undo_logs
--loose-innodb_sys_stats
--loose-innodb_table_stats
--loose-innodb_index_stats
--loose-innodb_admin_command
--loose-innodb_buffer_pool_pages
--loose-innodb_buffer_pool_pages_index
--loose-innodb_buffer_pool_pages_blob
-- source include/have_innodb.inc
-- source include/not_embedded.inc
#
# MDEV-7762 InnoDB: Failing assertion: block->page.buf_fix_count > 0 in buf0buf.ic line 730
#
# Make sure that all supported information_schema tables are readable
# (actual result sets are not important).
#
CREATE TABLE t1 ENGINE=InnoDB AS SELECT * FROM mysql.help_topic;
--disable_query_log
--disable_result_log
BEGIN;
SELECT * FROM t1 FOR UPDATE;
SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX;
SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS;
SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS;
SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP;
SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP_RESET;
SELECT * FROM INFORMATION_SCHEMA.INNODB_CMPMEM;
SELECT * FROM INFORMATION_SCHEMA.INNODB_CMPMEM_RESET;
SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE;
SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE_LRU;
--error 0,1109
SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_STATS;
--error 0,1109
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES;
--error 0,1109
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS;
--error 0,1109
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES;
--error 0,1109
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS;
--error 0,1109
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS;
--error 0,1109
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
--error 0,1109
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
--error 0,1109
SELECT * FROM INFORMATION_SCHEMA.INNODB_RSEG;
--error 0,1109
SELECT * FROM INFORMATION_SCHEMA.INNODB_UNDO_LOGS;
--error 0,1109
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_STATS;
--error 0,1109
SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLE_STATS;
--error 0,1109
SELECT * FROM INFORMATION_SCHEMA.INNODB_INDEX_STATS;
--error 0,1109
SELECT * FROM INFORMATION_SCHEMA.INNODB_ADMIN_COMMAND;
--error 0,1109
SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES;
--error 0,1109
SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_INDEX;
--error 0,1109
SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_BLOB;
--error 0,1109
SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES;
COMMIT;
--enable_query_log
--enable_result_log
DROP TABLE t1;
......@@ -6664,9 +6664,10 @@ i_s_innodb_buffer_pool_pages_blob_fill(
buf_pool = buf_pool_from_array(i);
buf_pool_mutex_enter(buf_pool);
for (n_block = 0; n_block < buf_pool->curr_size; n_block++) {
buf_block_t* block = buf_page_from_array(buf_pool, n_block);
mutex_t* block_mutex = buf_page_get_mutex_enter((buf_page_t*)block);
page_zip_des_t* block_page_zip = buf_block_get_page_zip(block);
const buf_frame_t* frame = block->frame;
......@@ -6676,16 +6677,16 @@ i_s_innodb_buffer_pool_pages_blob_fill(
part_len = 0; /* hmm, can't figure it out */
next_page_no = mach_read_from_4(
buf_block_get_frame(block)
+ FIL_PAGE_NEXT);
frame
+ FIL_PAGE_NEXT);
} else {
part_len = mach_read_from_4(
buf_block_get_frame(block)
frame
+ FIL_PAGE_DATA
+ 0 /*BTR_BLOB_HDR_PART_LEN*/);
next_page_no = mach_read_from_4(
buf_block_get_frame(block)
frame
+ FIL_PAGE_DATA
+ 4 /*BTR_BLOB_HDR_NEXT_PAGE_NO*/);
}
......@@ -6712,7 +6713,9 @@ i_s_innodb_buffer_pool_pages_blob_fill(
}
}
}
mutex_exit(block_mutex);
}
buf_pool_mutex_exit(buf_pool);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment