mirror of
https://github.com/MariaDB/server.git
synced 2025-01-27 17:33:44 +01:00
branches/zip: Merge revisions 4005:4032 from branches/5.1:
------------------------------------------------------------------------ r4032 | marko | 2009-01-23 15:43:51 +0200 (Fri, 23 Jan 2009) | 10 lines branches/5.1: Merge r4031 from branches/5.0: btr_search_drop_page_hash_when_freed(): Check if buf_page_get_gen() returns NULL. The page may have been evicted from the buffer pool between buf_page_peek_if_search_hashed() and buf_page_get_gen(), because the buffer pool mutex will be released between these two calls. (Bug #42279, Issue #160) rb://82 approved by Heikki Tuuri ------------------------------------------------------------------------
This commit is contained in:
parent
9ec6dac72d
commit
435eb2397f
2 changed files with 15 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
2009-01-23 The InnoDB Team
|
||||
|
||||
* btr/btr0sea.c:
|
||||
Fix Bug#42279 Race condition in btr_search_drop_page_hash_when_freed()
|
||||
|
||||
2009-01-23 The InnoDB Team
|
||||
|
||||
* include/buf0buf.h, buf/buf0buf.c:
|
||||
|
|
|
@ -1155,10 +1155,18 @@ btr_search_drop_page_hash_when_freed(
|
|||
block = buf_page_get_gen(space, zip_size, page_no, RW_S_LATCH, NULL,
|
||||
BUF_GET_IF_IN_POOL, __FILE__, __LINE__,
|
||||
&mtr);
|
||||
/* Because the buffer pool mutex was released by
|
||||
buf_page_peek_if_search_hashed(), it is possible that the
|
||||
block was removed from the buffer pool by another thread
|
||||
before buf_page_get_gen() got a chance to acquire the buffer
|
||||
pool mutex again. Thus, we must check for a NULL return. */
|
||||
|
||||
buf_block_dbg_add_level(block, SYNC_TREE_NODE_FROM_HASH);
|
||||
if (UNIV_LIKELY(block != NULL)) {
|
||||
|
||||
btr_search_drop_page_hash_index(block);
|
||||
buf_block_dbg_add_level(block, SYNC_TREE_NODE_FROM_HASH);
|
||||
|
||||
btr_search_drop_page_hash_index(block);
|
||||
}
|
||||
|
||||
mtr_commit(&mtr);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue