Commit 662318ba authored by marko's avatar marko

branches/zip: buf_flush_buffered_writes(): Disable the checks on compressed

pages.

buf_flush_post_to_doublewrite_buf(): Add a TODO comment about compressed pages.
parent 80915cdf
...@@ -255,7 +255,10 @@ buf_flush_buffered_writes(void) ...@@ -255,7 +255,10 @@ buf_flush_buffered_writes(void)
block = trx_doublewrite->buf_block_arr[i]; block = trx_doublewrite->buf_block_arr[i];
ut_a(block->state == BUF_BLOCK_FILE_PAGE); ut_a(block->state == BUF_BLOCK_FILE_PAGE);
/* TODO: page_zip */ if (UNIV_LIKELY_NULL(block->page_zip.data)) {
/* No simple validate for compressed pages exists. */
continue;
}
if (UNIV_UNLIKELY(memcmp(block->frame + (FIL_PAGE_LSN + 4), if (UNIV_UNLIKELY(memcmp(block->frame + (FIL_PAGE_LSN + 4),
block->frame + (UNIV_PAGE_SIZE block->frame + (UNIV_PAGE_SIZE
...@@ -296,22 +299,22 @@ corrupted_page: ...@@ -296,22 +299,22 @@ corrupted_page:
srv_dblwr_pages_written+= trx_doublewrite->first_free; srv_dblwr_pages_written+= trx_doublewrite->first_free;
srv_dblwr_writes++; srv_dblwr_writes++;
if (trx_doublewrite->first_free > TRX_SYS_DOUBLEWRITE_BLOCK_SIZE) { len = ut_min(TRX_SYS_DOUBLEWRITE_BLOCK_SIZE,
len = TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE; trx_doublewrite->first_free) * UNIV_PAGE_SIZE;
} else {
len = trx_doublewrite->first_free * UNIV_PAGE_SIZE;
}
fil_io(OS_FILE_WRITE,
TRUE, TRX_SYS_SPACE,
trx_doublewrite->block1, 0, len,
(void*)trx_doublewrite->write_buf, NULL);
write_buf = trx_doublewrite->write_buf; write_buf = trx_doublewrite->write_buf;
i = 0;
/* TODO: page_zip */ fil_io(OS_FILE_WRITE, TRUE, TRX_SYS_SPACE,
for (len2 = 0; len2 + UNIV_PAGE_SIZE <= len; len2 += UNIV_PAGE_SIZE) { trx_doublewrite->block1, 0, len,
if (UNIV_UNLIKELY(memcmp(write_buf + len2 + (FIL_PAGE_LSN + 4), (void*) write_buf, NULL);
for (len2 = 0; len2 + UNIV_PAGE_SIZE <= len;
len2 += UNIV_PAGE_SIZE, i++) {
block = trx_doublewrite->buf_block_arr[i];
if (UNIV_LIKELY(!block->page_zip.data)
&& UNIV_UNLIKELY(memcmp(write_buf + len2
+ (FIL_PAGE_LSN + 4),
write_buf + len2 + (UNIV_PAGE_SIZE write_buf + len2 + (UNIV_PAGE_SIZE
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4), 4))) { - FIL_PAGE_END_LSN_OLD_CHKSUM + 4), 4))) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
...@@ -321,36 +324,37 @@ corrupted_page: ...@@ -321,36 +324,37 @@ corrupted_page:
} }
} }
if (trx_doublewrite->first_free > TRX_SYS_DOUBLEWRITE_BLOCK_SIZE) { if (trx_doublewrite->first_free <= TRX_SYS_DOUBLEWRITE_BLOCK_SIZE) {
len = (trx_doublewrite->first_free goto flush;
- TRX_SYS_DOUBLEWRITE_BLOCK_SIZE) * UNIV_PAGE_SIZE; }
fil_io(OS_FILE_WRITE, len = (trx_doublewrite->first_free - TRX_SYS_DOUBLEWRITE_BLOCK_SIZE)
TRUE, TRX_SYS_SPACE, * UNIV_PAGE_SIZE;
trx_doublewrite->block2, 0, len,
(void*)(trx_doublewrite->write_buf
+ TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE),
NULL);
write_buf = trx_doublewrite->write_buf write_buf = trx_doublewrite->write_buf
+ TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE; + TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE;
/* TODO: page_zip */ ut_ad(i == TRX_SYS_DOUBLEWRITE_BLOCK_SIZE);
fil_io(OS_FILE_WRITE, TRUE, TRX_SYS_SPACE,
trx_doublewrite->block2, 0, len,
(void*) write_buf, NULL);
for (len2 = 0; len2 + UNIV_PAGE_SIZE <= len; for (len2 = 0; len2 + UNIV_PAGE_SIZE <= len;
len2 += UNIV_PAGE_SIZE) { len2 += UNIV_PAGE_SIZE, i++) {
if (UNIV_UNLIKELY(memcmp(write_buf + len2 block = trx_doublewrite->buf_block_arr[i];
if (UNIV_LIKELY(!block->page_zip.data)
&& UNIV_UNLIKELY(memcmp(write_buf + len2
+ (FIL_PAGE_LSN + 4), + (FIL_PAGE_LSN + 4),
write_buf + len2 write_buf + len2 + (UNIV_PAGE_SIZE
+ (UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM + 4), 4))) {
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4),
4))) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: ERROR: The page to be written seems corrupt!\n" " InnoDB: ERROR: The page to be written seems corrupt!\n"
"InnoDB: The lsn fields do not match! Noticed in the doublewrite block2.\n"); "InnoDB: The lsn fields do not match! Noticed in the doublewrite block2.\n");
} }
} }
}
flush:
/* Now flush the doublewrite buffer data to disk */ /* Now flush the doublewrite buffer data to disk */
fil_flush(TRX_SYS_SPACE); fil_flush(TRX_SYS_SPACE);
...@@ -361,8 +365,8 @@ corrupted_page: ...@@ -361,8 +365,8 @@ corrupted_page:
for (i = 0; i < trx_doublewrite->first_free; i++) { for (i = 0; i < trx_doublewrite->first_free; i++) {
block = trx_doublewrite->buf_block_arr[i]; block = trx_doublewrite->buf_block_arr[i];
/* TODO: page_zip */ if (UNIV_LIKELY(!block->page_zip.data) && UNIV_UNLIKELY(
if (UNIV_UNLIKELY(memcmp(block->frame + (FIL_PAGE_LSN + 4), memcmp(block->frame + (FIL_PAGE_LSN + 4),
block->frame + (UNIV_PAGE_SIZE block->frame + (UNIV_PAGE_SIZE
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4), 4))) { - FIL_PAGE_END_LSN_OLD_CHKSUM + 4), 4))) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
...@@ -427,7 +431,8 @@ try_again: ...@@ -427,7 +431,8 @@ try_again:
goto try_again; goto try_again;
} }
ut_memcpy(trx_doublewrite->write_buf /* TODO: page_zip */
memcpy(trx_doublewrite->write_buf
+ UNIV_PAGE_SIZE * trx_doublewrite->first_free, + UNIV_PAGE_SIZE * trx_doublewrite->first_free,
block->frame, UNIV_PAGE_SIZE); block->frame, UNIV_PAGE_SIZE);
......
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