Commit dd529ee4 authored by marko's avatar marko

branches/zip: When reading pages for merging buffered inserts, request that

the pages be decompressed.

buf_read_page_low(), buf_page_init_for_read(): Add parameter "unzip".
parent 2e739224
...@@ -2349,6 +2349,7 @@ buf_page_init_for_read( ...@@ -2349,6 +2349,7 @@ buf_page_init_for_read(
ulint mode, /* in: BUF_READ_IBUF_PAGES_ONLY, ... */ ulint mode, /* in: BUF_READ_IBUF_PAGES_ONLY, ... */
ulint space, /* in: space id */ ulint space, /* in: space id */
ulint zip_size,/* in: compressed page size, or 0 */ ulint zip_size,/* in: compressed page size, or 0 */
ibool unzip, /* in: TRUE=request uncompressed page */
ib_longlong tablespace_version,/* in: prevents reading from a wrong ib_longlong tablespace_version,/* in: prevents reading from a wrong
version of the tablespace in case we have done version of the tablespace in case we have done
DISCARD + IMPORT */ DISCARD + IMPORT */
...@@ -2382,7 +2383,8 @@ buf_page_init_for_read( ...@@ -2382,7 +2383,8 @@ buf_page_init_for_read(
ut_ad(mode == BUF_READ_ANY_PAGE); ut_ad(mode == BUF_READ_ANY_PAGE);
} }
if (zip_size && UNIV_LIKELY(!recv_recovery_is_on())) { if (zip_size && UNIV_LIKELY(!unzip)
&& UNIV_LIKELY(!recv_recovery_is_on())) {
block = NULL; block = NULL;
} else { } else {
block = buf_LRU_get_free_block(0); block = buf_LRU_get_free_block(0);
...@@ -2525,6 +2527,7 @@ buf_page_init_for_read( ...@@ -2525,6 +2527,7 @@ buf_page_init_for_read(
mtr_commit(&mtr); mtr_commit(&mtr);
} }
ut_ad(buf_page_in_file(bpage));
return(bpage); return(bpage);
} }
......
...@@ -66,6 +66,7 @@ buf_read_page_low( ...@@ -66,6 +66,7 @@ buf_read_page_low(
at read-ahead functions) */ at read-ahead functions) */
ulint space, /* in: space id */ ulint space, /* in: space id */
ulint zip_size,/* in: compressed page size, or 0 */ ulint zip_size,/* in: compressed page size, or 0 */
ibool unzip, /* in: TRUE=request uncompressed page */
ib_longlong tablespace_version, /* in: if the space memory object has ib_longlong tablespace_version, /* in: if the space memory object has
this timestamp different from what we are giving here, this timestamp different from what we are giving here,
treat the tablespace as dropped; this is a timestamp we treat the tablespace as dropped; this is a timestamp we
...@@ -113,7 +114,7 @@ buf_read_page_low( ...@@ -113,7 +114,7 @@ buf_read_page_low(
or is being dropped; if we succeed in initing the page in the buffer or is being dropped; if we succeed in initing the page in the buffer
pool for read, then DISCARD cannot proceed until the read has pool for read, then DISCARD cannot proceed until the read has
completed */ completed */
bpage = buf_page_init_for_read(err, mode, space, zip_size, bpage = buf_page_init_for_read(err, mode, space, zip_size, unzip,
tablespace_version, offset); tablespace_version, offset);
if (bpage == NULL) { if (bpage == NULL) {
...@@ -273,7 +274,8 @@ buf_read_ahead_random( ...@@ -273,7 +274,8 @@ buf_read_ahead_random(
count += buf_read_page_low( count += buf_read_page_low(
&err, FALSE, &err, FALSE,
ibuf_mode | OS_AIO_SIMULATED_WAKE_LATER, ibuf_mode | OS_AIO_SIMULATED_WAKE_LATER,
space, zip_size, tablespace_version, i); space, zip_size, FALSE,
tablespace_version, i);
if (err == DB_TABLESPACE_DELETED) { if (err == DB_TABLESPACE_DELETED) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
...@@ -335,7 +337,8 @@ buf_read_page( ...@@ -335,7 +337,8 @@ buf_read_page(
switches: hence TRUE */ switches: hence TRUE */
count2 = buf_read_page_low(&err, TRUE, BUF_READ_ANY_PAGE, space, count2 = buf_read_page_low(&err, TRUE, BUF_READ_ANY_PAGE, space,
zip_size, tablespace_version, offset); zip_size, FALSE,
tablespace_version, offset);
srv_buf_pool_reads+= count2; srv_buf_pool_reads+= count2;
if (err == DB_TABLESPACE_DELETED) { if (err == DB_TABLESPACE_DELETED) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
...@@ -579,7 +582,7 @@ buf_read_ahead_linear( ...@@ -579,7 +582,7 @@ buf_read_ahead_linear(
count += buf_read_page_low( count += buf_read_page_low(
&err, FALSE, &err, FALSE,
ibuf_mode | OS_AIO_SIMULATED_WAKE_LATER, ibuf_mode | OS_AIO_SIMULATED_WAKE_LATER,
space, zip_size, tablespace_version, i); space, zip_size, FALSE, tablespace_version, i);
if (err == DB_TABLESPACE_DELETED) { if (err == DB_TABLESPACE_DELETED) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
...@@ -664,7 +667,7 @@ buf_read_ibuf_merge_pages( ...@@ -664,7 +667,7 @@ buf_read_ibuf_merge_pages(
buf_read_page_low(&err, sync && (i + 1 == n_stored), buf_read_page_low(&err, sync && (i + 1 == n_stored),
BUF_READ_ANY_PAGE, space_ids[i], BUF_READ_ANY_PAGE, space_ids[i],
zip_size, space_versions[i], zip_size, TRUE, space_versions[i],
page_nos[i]); page_nos[i]);
if (UNIV_UNLIKELY(err == DB_TABLESPACE_DELETED)) { if (UNIV_UNLIKELY(err == DB_TABLESPACE_DELETED)) {
...@@ -753,12 +756,12 @@ buf_read_recv_pages( ...@@ -753,12 +756,12 @@ buf_read_recv_pages(
if ((i + 1 == n_stored) && sync) { if ((i + 1 == n_stored) && sync) {
buf_read_page_low(&err, TRUE, BUF_READ_ANY_PAGE, space, buf_read_page_low(&err, TRUE, BUF_READ_ANY_PAGE, space,
zip_size, tablespace_version, zip_size, TRUE, tablespace_version,
page_nos[i]); page_nos[i]);
} else { } else {
buf_read_page_low(&err, FALSE, BUF_READ_ANY_PAGE buf_read_page_low(&err, FALSE, BUF_READ_ANY_PAGE
| OS_AIO_SIMULATED_WAKE_LATER, | OS_AIO_SIMULATED_WAKE_LATER,
space, zip_size, space, zip_size, TRUE,
tablespace_version, page_nos[i]); tablespace_version, page_nos[i]);
} }
} }
......
...@@ -877,6 +877,7 @@ buf_page_init_for_read( ...@@ -877,6 +877,7 @@ buf_page_init_for_read(
ulint mode, /* in: BUF_READ_IBUF_PAGES_ONLY, ... */ ulint mode, /* in: BUF_READ_IBUF_PAGES_ONLY, ... */
ulint space, /* in: space id */ ulint space, /* in: space id */
ulint zip_size,/* in: compressed page size, or 0 */ ulint zip_size,/* in: compressed page size, or 0 */
ibool unzip, /* in: TRUE=request uncompressed page */
ib_longlong tablespace_version,/* in: prevents reading from a wrong ib_longlong tablespace_version,/* in: prevents reading from a wrong
version of the tablespace in case we have done version of the tablespace in case we have done
DISCARD + IMPORT */ DISCARD + IMPORT */
......
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