mirror of
https://github.com/MariaDB/server.git
synced 2025-12-22 23:02:58 +03:00
Bug #58549 Race condition in buf_LRU_drop_page_hash_for_tablespace()
and compressed tables buf_LRU_drop_page_hash_for_tablespace(): after releasing and reacquiring the buffer pool mutex, do not dereference any block descriptor pointer that is not known to be a pointer to an uncompressed page frame (type buf_block_t; state == BUF_BLOCK_FILE_PAGE). Also, defer the acquisition of the block_mutex until it is needed. buf_page_get_gen(): Add mode == BUF_GET_IF_IN_POOL_PEEK for buffer-fixing a block without making it young in the LRU list. buf_page_get_gen(), buf_page_init(), buf_LRU_block_remove_hashed_page(): Set bpage->state = BUF_BLOCK_ZIP_FREE before buf_buddy_free(bpage), so that similar race conditions might be detected a little easier. btr_search_drop_page_hash_when_freed(): Use BUF_GET_IF_IN_POOL_PEEK when dropping the hash indexes. rb://528 approved by Jimmy Yang
This commit is contained in:
@@ -41,6 +41,8 @@ Created 11/5/1995 Heikki Tuuri
|
||||
/* @{ */
|
||||
#define BUF_GET 10 /*!< get always */
|
||||
#define BUF_GET_IF_IN_POOL 11 /*!< get if in pool */
|
||||
#define BUF_PEEK_IF_IN_POOL 12 /*!< get if in pool, do not make
|
||||
the block young in the LRU list */
|
||||
#define BUF_GET_NO_LATCH 14 /*!< get and bufferfix, but
|
||||
set no latch; we have
|
||||
separated this case, because
|
||||
@@ -284,7 +286,7 @@ buf_page_get_gen(
|
||||
ulint rw_latch,/*!< in: RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH */
|
||||
buf_block_t* guess, /*!< in: guessed block or NULL */
|
||||
ulint mode, /*!< in: BUF_GET, BUF_GET_IF_IN_POOL,
|
||||
BUF_GET_NO_LATCH */
|
||||
BUF_PEEK_IF_IN_POOL, BUF_GET_NO_LATCH */
|
||||
const char* file, /*!< in: file name */
|
||||
ulint line, /*!< in: line where called */
|
||||
mtr_t* mtr); /*!< in: mini-transaction */
|
||||
|
||||
Reference in New Issue
Block a user