Commit 2300edb0 authored by marko's avatar marko

branches/zip: buf_LRU_invalidate_tablespace(): Fix a race condition:

read zip_size while still holding block_mutex.
parent b20b32d1
2009-01-27 The InnoDB Team
* buf/buf0lru.c:
Fix a race condition in buf_LRU_invalidate_tablespace():
The compressed page size (zip_size) was read while the block
descriptor was no longer protected by a mutex. This could lead to
corruption when a table is dropped on a busy system that contains
compressed tables.
2009-01-26 The InnoDB Team 2009-01-26 The InnoDB Team
* include/buf0buf.h, include/buf0buf.ic, buf/buf0buf.c, * include/buf0buf.h, include/buf0buf.ic, buf/buf0buf.c,
......
...@@ -300,7 +300,6 @@ buf_LRU_invalidate_tablespace( ...@@ -300,7 +300,6 @@ buf_LRU_invalidate_tablespace(
ulint id) /* in: space id */ ulint id) /* in: space id */
{ {
buf_page_t* bpage; buf_page_t* bpage;
ulint page_no;
ibool all_freed; ibool all_freed;
/* Before we attempt to drop pages one by one we first /* Before we attempt to drop pages one by one we first
...@@ -351,18 +350,21 @@ scan_again: ...@@ -351,18 +350,21 @@ scan_again:
#endif #endif
if (buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE if (buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE
&& ((buf_block_t*) bpage)->is_hashed) { && ((buf_block_t*) bpage)->is_hashed) {
page_no = buf_page_get_page_no(bpage); ulint page_no;
ulint zip_size;
buf_pool_mutex_exit(); buf_pool_mutex_exit();
zip_size = buf_page_get_zip_size(bpage);
page_no = buf_page_get_page_no(bpage);
mutex_exit(block_mutex); mutex_exit(block_mutex);
/* Note that the following call will acquire /* Note that the following call will acquire
an S-latch on the page */ an S-latch on the page */
btr_search_drop_page_hash_when_freed( btr_search_drop_page_hash_when_freed(
id, id, zip_size, page_no);
buf_page_get_zip_size(bpage),
page_no);
goto scan_again; goto scan_again;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment