summaryrefslogtreecommitdiff
path: root/innobase/mtr/mtr0mtr.c
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2004-05-26 10:45:37 +0300
committerunknown <marko@hundin.mysql.fi>2004-05-26 10:45:37 +0300
commit3b1dd9af7b1ba6645bf8c5594ee456ca62d0f4c0 (patch)
treeb8a816bf30c5f9ebbb34b90c791ba63dc71d3ab2 /innobase/mtr/mtr0mtr.c
parentfd079fdaa15ce2ed1b2d59cc6ff7dcba2bbc4112 (diff)
downloadmariadb-git-3b1dd9af7b1ba6645bf8c5594ee456ca62d0f4c0.tar.gz
InnoDB cleanup: Remove unused code for online backup
innobase/include/log0log.h: Remove references to online backup innobase/include/log0log.ic: Remove references to online backup innobase/include/mtr0mtr.h: Remove references to MLOG_FULL_PAGE innobase/log/log0log.c: Remove references to online backup innobase/log/log0recv.c: Remove references to MLOG_FULL_PAGE innobase/mtr/mtr0mtr.c: Remove references to MLOG_FULL_PAGE Remove references to online backup
Diffstat (limited to 'innobase/mtr/mtr0mtr.c')
-rw-r--r--innobase/mtr/mtr0mtr.c199
1 files changed, 5 insertions, 194 deletions
diff --git a/innobase/mtr/mtr0mtr.c b/innobase/mtr/mtr0mtr.c
index 46473cb3ffe..5a5fab61827 100644
--- a/innobase/mtr/mtr0mtr.c
+++ b/innobase/mtr/mtr0mtr.c
@@ -106,179 +106,6 @@ mtr_memo_pop_all(
}
/****************************************************************
-Writes to the log the contents of a full page. This is called when the
-database is in the online backup state. */
-static
-void
-mtr_log_write_full_page(
-/*====================*/
- page_t* page, /* in: page to write */
- ulint i, /* in: i'th page for mtr */
- ulint n_pages,/* in: total number of pages for mtr */
- mtr_t* mtr) /* in: mtr */
-{
- byte* buf;
- byte* ptr;
- ulint len;
-
- buf = mem_alloc(UNIV_PAGE_SIZE + 50);
-
- ptr = mlog_write_initial_log_record_fast(page, MLOG_FULL_PAGE, buf,
- mtr);
- ut_memcpy(ptr, page, UNIV_PAGE_SIZE);
-
- len = (ptr - buf) + UNIV_PAGE_SIZE;
-
- if (i == n_pages - 1) {
- if (n_pages > 1) {
- *(buf + len) = MLOG_MULTI_REC_END;
- len++;
- } else {
- *buf = (byte)((ulint)*buf | MLOG_SINGLE_REC_FLAG);
- }
- }
-
- ut_ad(len < UNIV_PAGE_SIZE + 50);
-
- log_write_low(buf, len);
-
- mem_free(buf);
-}
-
-/****************************************************************
-Parses a log record which contains the full contents of a page. */
-
-byte*
-mtr_log_parse_full_page(
-/*====================*/
- /* out: end of log record or NULL */
- byte* ptr, /* in: buffer */
- byte* end_ptr,/* in: buffer end */
- page_t* page) /* in: page or NULL */
-{
- if (end_ptr < ptr + UNIV_PAGE_SIZE) {
-
- return(NULL);
- }
-
- if (page) {
- ut_memcpy(page, ptr, UNIV_PAGE_SIZE);
- }
-
- return(ptr + UNIV_PAGE_SIZE);
-}
-
-/****************************************************************
-Writes to the database log the full contents of the pages that this mtr has
-modified. */
-static
-void
-mtr_log_write_backup_full_pages(
-/*============================*/
- mtr_t* mtr, /* in: mini-transaction */
- ulint n_pages)/* in: number of pages modified by mtr */
-{
- mtr_memo_slot_t* slot;
- dyn_array_t* memo;
- buf_block_t* block;
- ulint offset;
- ulint type;
- ulint i;
-
- ut_ad(mtr);
- ut_ad(mtr->magic_n == MTR_MAGIC_N);
- ut_ad(mtr->state == MTR_COMMITTING);
-
- /* Open the database log for log_write_low */
- mtr->start_lsn = log_reserve_and_open(n_pages * (UNIV_PAGE_SIZE + 50));
-
- memo = &(mtr->memo);
-
- offset = dyn_array_get_data_size(memo);
-
- i = 0;
-
- while (offset > 0) {
- offset -= sizeof(mtr_memo_slot_t);
- slot = dyn_array_get_element(memo, offset);
-
- block = slot->object;
- type = slot->type;
-
- if ((block != NULL) && (type == MTR_MEMO_PAGE_X_FIX)) {
-
- mtr_log_write_full_page(block->frame, i, n_pages, mtr);
-
- i++;
- }
- }
-
- ut_ad(i == n_pages);
-}
-
-/****************************************************************
-Checks if mtr is the first to modify any page after online_backup_lsn. */
-static
-ibool
-mtr_first_to_modify_page_after_backup(
-/*==================================*/
- /* out: TRUE if first for a page */
- mtr_t* mtr, /* in: mini-transaction */
- ulint* n_pages) /* out: number of modified pages (all modified
- pages, backup_lsn does not matter here) */
-{
- mtr_memo_slot_t* slot;
- dyn_array_t* memo;
- ulint offset;
- buf_block_t* block;
- ulint type;
- dulint backup_lsn;
- ibool ret = FALSE;
-
- ut_ad(mtr);
- ut_ad(mtr->magic_n == MTR_MAGIC_N);
- ut_ad(mtr->state == MTR_COMMITTING);
-
- backup_lsn = log_get_online_backup_lsn_low();
-
- memo = &(mtr->memo);
-
- offset = dyn_array_get_data_size(memo);
-
- *n_pages = 0;
-
- while (offset > 0) {
- offset -= sizeof(mtr_memo_slot_t);
- slot = dyn_array_get_element(memo, offset);
-
- block = slot->object;
- type = slot->type;
-
- if ((block != NULL) && (type == MTR_MEMO_PAGE_X_FIX)) {
-
- *n_pages = *n_pages + 1;
-
- if (ut_dulint_cmp(buf_frame_get_newest_modification(
- block->frame),
- backup_lsn) <= 0) {
-
- fprintf(stderr,
- "Page %lu newest %lu backup %lu\n",
- block->offset,
- ut_dulint_get_low(
- buf_frame_get_newest_modification(
- block->frame)),
- ut_dulint_get_low(backup_lsn));
-
- ret = TRUE;
- }
- }
- }
-
- return(ret);
-}
-
-/****************************************************************
Writes the contents of a mini-transaction log, if any, to the database log. */
static
void
@@ -291,7 +118,6 @@ mtr_log_reserve_and_write(
ulint data_size;
ibool success;
byte* first_data;
- ulint n_modified_pages;
ut_ad(mtr);
@@ -322,27 +148,12 @@ mtr_log_reserve_and_write(
if (mtr->log_mode == MTR_LOG_ALL) {
- if (log_get_online_backup_state_low()
- && mtr_first_to_modify_page_after_backup(mtr,
- &n_modified_pages)) {
-
- /* The database is in the online backup state: write
- to the log the full contents of all the pages if this
- mtr is the first to modify any page in the buffer pool
- after online_backup_lsn */
-
- log_close();
- log_release();
-
- mtr_log_write_backup_full_pages(mtr, n_modified_pages);
- } else {
- block = mlog;
+ block = mlog;
- while (block != NULL) {
- log_write_low(dyn_block_get_data(block),
- dyn_block_get_used(block));
- block = dyn_array_get_next_block(mlog, block);
- }
+ while (block != NULL) {
+ log_write_low(dyn_block_get_data(block),
+ dyn_block_get_used(block));
+ block = dyn_array_get_next_block(mlog, block);
}
} else {
ut_ad(mtr->log_mode == MTR_LOG_NONE);