mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
buf0buf.c Fixed a race condition in buf0lru and btr0sea which could corrupt the LRU list
buf0lru.c Fixed a race condition in buf0lru and btr0sea which could corrupt the LRU list
This commit is contained in:
@ -1 +1,2 @@
|
|||||||
jani@hynda.mysql.fi
|
jani@hynda.mysql.fi
|
||||||
|
heikki@donna.mysql.fi
|
||||||
|
@ -863,6 +863,19 @@ buf_page_get_known_nowait(
|
|||||||
|
|
||||||
mutex_enter(&(buf_pool->mutex));
|
mutex_enter(&(buf_pool->mutex));
|
||||||
|
|
||||||
|
if (block->state == BUF_BLOCK_REMOVE_HASH) {
|
||||||
|
/* Another thread is just freeing the block from the LRU list
|
||||||
|
of the buffer pool: do not try to access this page; this
|
||||||
|
attempt to access the page can only come through the hash
|
||||||
|
index because when the buffer block state is ..._REMOVE_HASH,
|
||||||
|
we have already removed it from the page address hash table
|
||||||
|
of the buffer pool. */
|
||||||
|
|
||||||
|
mutex_exit(&(buf_pool->mutex));
|
||||||
|
|
||||||
|
return(FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef UNIV_SYNC_DEBUG
|
#ifdef UNIV_SYNC_DEBUG
|
||||||
buf_block_buf_fix_inc_debug(block, file, line);
|
buf_block_buf_fix_inc_debug(block, file, line);
|
||||||
#else
|
#else
|
||||||
|
@ -138,6 +138,8 @@ buf_LRU_search_and_free_block(
|
|||||||
|
|
||||||
mutex_enter(&(buf_pool->mutex));
|
mutex_enter(&(buf_pool->mutex));
|
||||||
|
|
||||||
|
ut_a(block->buf_fix_count == 0);
|
||||||
|
|
||||||
buf_LRU_block_free_hashed_page(block);
|
buf_LRU_block_free_hashed_page(block);
|
||||||
|
|
||||||
freed = TRUE;
|
freed = TRUE;
|
||||||
@ -435,7 +437,7 @@ buf_LRU_add_block_to_end_low(
|
|||||||
defined: init it */
|
defined: init it */
|
||||||
|
|
||||||
buf_LRU_old_init();
|
buf_LRU_old_init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
|
Reference in New Issue
Block a user