Commit f56b6cf4 authored by marko's avatar marko

branches/zip: Fix bugs.

buf_LRU_free_block(): Do not allocate the control block when
a compressed-only page is being freed.

buf_validate(): Note that buf_pool->zip_clean may contain blocks
with io_fix == BUF_IO_READ.
parent 5fc003b6
...@@ -2753,7 +2753,20 @@ buf_validate(void) ...@@ -2753,7 +2753,20 @@ buf_validate(void)
for (b = UT_LIST_GET_FIRST(buf_pool->zip_clean); b; for (b = UT_LIST_GET_FIRST(buf_pool->zip_clean); b;
b = UT_LIST_GET_NEXT(list, b)) { b = UT_LIST_GET_NEXT(list, b)) {
ut_a(buf_page_get_state(b) == BUF_BLOCK_ZIP_PAGE); ut_a(buf_page_get_state(b) == BUF_BLOCK_ZIP_PAGE);
ut_a(buf_page_get_io_fix(b) == BUF_IO_NONE); switch (buf_page_get_io_fix(b)) {
case BUF_IO_NONE:
/* All clean blocks should be I/O-unfixed. */
break;
case BUF_IO_READ:
/* In buf_LRU_free_block(), we temporarily set
b->io_fix = BUF_IO_READ for a newly allocated
control block in order to lock out
buf_page_init_for_read(). */
break;
default:
ut_error;
break;
}
ut_a(!b->oldest_modification); ut_a(!b->oldest_modification);
ut_a(buf_page_hash_get(b->space, b->offset) == b); ut_a(buf_page_hash_get(b->space, b->offset) == b);
......
...@@ -919,7 +919,7 @@ buf_LRU_free_block( ...@@ -919,7 +919,7 @@ buf_LRU_free_block(
} }
goto alloc; goto alloc;
} else { } else if (buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE) {
/* Allocate the control block for the compressed page. /* Allocate the control block for the compressed page.
If it cannot be allocated (without freeing a block If it cannot be allocated (without freeing a block
from the LRU list), refuse to free bpage. */ from the LRU list), refuse to free bpage. */
......
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