Commit 541fcfcd authored by marko's avatar marko

branches/zip: More fixes to problems found in speedc test runs.

Before the speedc test was interrupted, 121,765 B-tree pages were written.

buf_flush_init_for_writing(): Do not compress other than B-tree pages
outside the system tablespace.  Report non-B-tree pages.

page_zip_decompress(): Clear the unused heap space on the uncompressed page,
so that the whole buffer for the uncompressed page will be initialized and
page_zip_validate() will always succeed.
parent de60fbdf
...@@ -479,17 +479,30 @@ buf_flush_init_for_writing( ...@@ -479,17 +479,30 @@ buf_flush_init_for_writing(
srv_use_checksums ? srv_use_checksums ?
buf_calc_page_old_checksum(page) : BUF_NO_CHECKSUM_MAGIC); buf_calc_page_old_checksum(page) : BUF_NO_CHECKSUM_MAGIC);
#if 1 /* testing */ #if 1 /* testing */
if (page_is_comp(page)) { if (space /* skip the system tablespace */
byte zip_data[16384]; && (page_no & (UNIV_PAGE_SIZE - 1)) /* skip extent descriptors */
page_zip_des_t* page_zip = &buf_block_align(page)->page_zip; && page_is_comp(page) /* skip row_format=redundant pages */) {
page_zip->data = zip_data; if (memcmp(page + PAGE_NEW_INFIMUM, "infimum", 8)) {
page_zip->size = sizeof zip_data; fprintf(stderr, "page %lu:%lu: cannot compress\n",
page_zip->m_start = page_zip->m_end = 0; (ulong) space, (ulong) page_no);
ut_a(page_zip_compress(page_zip, page)); } else {
fprintf(stderr, "zip size==%lu+%lu\n", byte zip_data[16384];
(ulong) page_zip->m_start, page_zip_des_t* page_zip =
(ulong) 2 * page_dir_get_n_heap(page_zip->data)); &buf_block_align(page)->page_zip;
page_zip->data = NULL; page_zip->data = zip_data;
page_zip->size = sizeof zip_data;
page_zip->m_start = page_zip->m_end = 0;
ut_a(page_zip_compress(page_zip, page));
fprintf(stderr, "page %lu:%lu: zip size==%lu+%lu\n",
(ulong) space, (ulong) page_no,
(ulong) page_zip->m_start,
(ulong) 2
* page_dir_get_n_heap(page_zip->data));
page_zip->data = NULL;
}
} }
#endif /* testing */ #endif /* testing */
} }
......
...@@ -702,6 +702,11 @@ zlib_error: ...@@ -702,6 +702,11 @@ zlib_error:
return(FALSE); return(FALSE);
} }
/* Clear the unused heap space on the uncompressed page. */
dst = page_header_get_ptr(page, PAGE_HEAP_TOP);
memset(dst, 0, page_dir_get_nth_slot(page,
page_dir_get_n_slots(page) - 1) - dst);
/* The dense directory excludes the infimum and supremum records. */ /* The dense directory excludes the infimum and supremum records. */
n_dense = page_dir_get_n_heap(page) - 2; n_dense = page_dir_get_n_heap(page) - 2;
...@@ -749,10 +754,8 @@ page_zip_validate( ...@@ -749,10 +754,8 @@ page_zip_validate(
page_t* temp_page = buf_frame_alloc(); page_t* temp_page = buf_frame_alloc();
ibool valid; ibool valid;
#if 0 /* disabled during testing hack in buf0flu.c */
ut_ad(buf_block_get_page_zip(buf_block_align((byte*)page)) ut_ad(buf_block_get_page_zip(buf_block_align((byte*)page))
== page_zip); == page_zip);
#endif
valid = page_zip_decompress(&temp_page_zip, temp_page, NULL) valid = page_zip_decompress(&temp_page_zip, temp_page, NULL)
&& !memcmp(page, temp_page, && !memcmp(page, temp_page,
......
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