mirror of
https://github.com/MariaDB/server.git
synced 2025-01-27 17:33:44 +01:00
branches/zip: buf_page_get_gen(): Fix a race condition when reading
buf_fix_count. This could explain Issue #156. Tested by Michael.
This commit is contained in:
parent
e3abdf8239
commit
cc50421173
2 changed files with 11 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
2009-06-29 The InnoDB Team
|
||||
|
||||
* buf/buf0buf.c:
|
||||
Fix a race condition when reading buf_fix_count.
|
||||
Currently, it is not being protected by the buffer pool mutex,
|
||||
but by the block mutex.
|
||||
|
||||
2009-06-29 The InnoDB Team
|
||||
|
||||
* handler/handler0alter.cc:
|
||||
|
|
|
@ -2085,12 +2085,15 @@ loop2:
|
|||
case BUF_BLOCK_ZIP_PAGE:
|
||||
case BUF_BLOCK_ZIP_DIRTY:
|
||||
bpage = &block->page;
|
||||
/* Protect bpage->buf_fix_count. */
|
||||
mutex_enter(&buf_pool_zip_mutex);
|
||||
|
||||
if (bpage->buf_fix_count
|
||||
|| buf_page_get_io_fix(bpage) != BUF_IO_NONE) {
|
||||
/* This condition often occurs when the buffer
|
||||
is not buffer-fixed, but I/O-fixed by
|
||||
buf_page_init_for_read(). */
|
||||
mutex_exit(&buf_pool_zip_mutex);
|
||||
wait_until_unfixed:
|
||||
/* The block is buffer-fixed or I/O-fixed.
|
||||
Try again later. */
|
||||
|
@ -2102,6 +2105,7 @@ wait_until_unfixed:
|
|||
|
||||
/* Allocate an uncompressed page. */
|
||||
buf_pool_mutex_exit();
|
||||
mutex_exit(&buf_pool_zip_mutex);
|
||||
|
||||
block = buf_LRU_get_free_block(0);
|
||||
ut_a(block);
|
||||
|
|
Loading…
Add table
Reference in a new issue