[Commits] 33589b2: MDEV-7762 InnoDB: Failing assertion: block->page.buf_fix_count > 0 in buf0buf.ic line 730

Jan Lindström jan.lindstrom at mariadb.com
Thu Dec 3 13:20:39 EET 2015


revision-id: 33589b25efe3283b748e43a54c42db2ed176c3e5 (mariadb-5.5.46-10-g33589b2)
parent(s): 13ad179c96ee8c8c4043806b8575c851e3676f0d
committer: Jan Lindström
timestamp: 2015-12-03 13:18:10 +0200
message:

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.

---
 .../r/innodb_information_schema_tables.result      |  2 +
 .../innodb/t/innodb_information_schema_tables.opt  | 29 ++++++++++
 .../innodb/t/innodb_information_schema_tables.test | 64 ++++++++++++++++++++++
 storage/xtradb/handler/i_s.cc                      | 15 +++--
 4 files changed, 104 insertions(+), 6 deletions(-)

diff --git a/mysql-test/suite/innodb/r/innodb_information_schema_tables.result b/mysql-test/suite/innodb/r/innodb_information_schema_tables.result
new file mode 100644
index 0000000..ea713ea
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_information_schema_tables.result
@@ -0,0 +1,2 @@
+CREATE TABLE t1 ENGINE=InnoDB AS SELECT * FROM mysql.help_topic;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb_information_schema_tables.opt b/mysql-test/suite/innodb/t/innodb_information_schema_tables.opt
new file mode 100644
index 0000000..9f30d81
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_information_schema_tables.opt
@@ -0,0 +1,29 @@
+--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
diff --git a/mysql-test/suite/innodb/t/innodb_information_schema_tables.test b/mysql-test/suite/innodb/t/innodb_information_schema_tables.test
new file mode 100644
index 0000000..15b3bf4
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_information_schema_tables.test
@@ -0,0 +1,64 @@
+-- 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;
diff --git a/storage/xtradb/handler/i_s.cc b/storage/xtradb/handler/i_s.cc
index bba0dad..c868fbb 100644
--- a/storage/xtradb/handler/i_s.cc
+++ b/storage/xtradb/handler/i_s.cc
@@ -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);
 	}


More information about the commits mailing list