diff options
author | unknown <monty@mysql.com> | 2004-05-27 00:30:28 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-05-27 00:30:28 +0300 |
commit | 7c5cd4125dfe7b6891aeffc567387573695714c3 (patch) | |
tree | 5ed4e118d371f2a1d84eaaef85c5869d24977363 /innobase | |
parent | 5fe72df8fd23a5b5f6938a9e559e916594b78449 (diff) | |
parent | cc24ac7079827af1290a87ca0d5ce817329a9f6b (diff) | |
download | mariadb-git-7c5cd4125dfe7b6891aeffc567387573695714c3.tar.gz |
merge with 4.0 to get windows fixes
VC++Files/client/mysqlclient.dsp:
Auto merged
VC++Files/innobase/innobase.dsp:
Auto merged
include/mysql.h:
Auto merged
include/mysql_com.h:
Auto merged
innobase/include/log0log.h:
Auto merged
innobase/include/log0log.ic:
Auto merged
innobase/include/mtr0mtr.h:
Auto merged
innobase/log/log0log.c:
Auto merged
innobase/log/log0recv.c:
Auto merged
innobase/que/que0que.c:
Auto merged
libmysql/libmysql.c:
Auto merged
libmysql_r/Makefile.am:
Auto merged
sql/log_event.cc:
Auto merged
sql/mysqld.cc:
Auto merged
tools/mysqlmanager.c:
Auto merged
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/include/log0log.h | 35 | ||||
-rw-r--r-- | innobase/include/log0log.ic | 36 | ||||
-rw-r--r-- | innobase/include/mtr0mtr.h | 12 | ||||
-rw-r--r-- | innobase/log/log0log.c | 64 | ||||
-rw-r--r-- | innobase/log/log0recv.c | 13 | ||||
-rw-r--r-- | innobase/mtr/mtr0mtr.c | 199 | ||||
-rw-r--r-- | innobase/que/que0que.c | 2 |
7 files changed, 8 insertions, 353 deletions
diff --git a/innobase/include/log0log.h b/innobase/include/log0log.h index 4badd2cd7b3..25adc3b24b7 100644 --- a/innobase/include/log0log.h +++ b/innobase/include/log0log.h @@ -114,20 +114,6 @@ dulint log_get_lsn(void); /*=============*/ /* out: current lsn */ -/**************************************************************************** -Gets the online backup lsn. */ -UNIV_INLINE -dulint -log_get_online_backup_lsn_low(void); -/*===============================*/ -/**************************************************************************** -Gets the online backup state. */ -UNIV_INLINE -ibool -log_get_online_backup_state_low(void); -/*=================================*/ - /* out: online backup state, the caller must - own the log_sys mutex */ /********************************************************** Initializes the log. */ @@ -326,20 +312,6 @@ log_archived_file_name_gen( char* buf, /* in: buffer where to write */ ulint id, /* in: group id */ ulint file_no);/* in: file number */ -/********************************************************** -Switches the database to the online backup state. */ - -ulint -log_switch_backup_state_on(void); -/*============================*/ - /* out: DB_SUCCESS or DB_ERROR */ -/********************************************************** -Switches the online backup state off. */ - -ulint -log_switch_backup_state_off(void); -/*=============================*/ - /* out: DB_SUCCESS or DB_ERROR */ /************************************************************************ Checks that there is enough free space in the log to start a new query step. Flushes the log buffer or makes a new checkpoint if necessary. NOTE: this @@ -878,13 +850,6 @@ struct log_struct{ os_event_t archiving_on; /* if archiving has been stopped, a thread can wait for this event to become signaled */ - /* Fields involved in online backups */ - ibool online_backup_state; - /* TRUE if the database is in the - online backup state */ - dulint online_backup_lsn; - /* lsn when the state was changed to - the online backup state */ }; #define LOG_ARCH_ON 71 diff --git a/innobase/include/log0log.ic b/innobase/include/log0log.ic index e273b6a292b..3a4a3c6a5e6 100644 --- a/innobase/include/log0log.ic +++ b/innobase/include/log0log.ic @@ -318,8 +318,7 @@ log_reserve_and_write_fast( data_len = len + log->buf_free % OS_FILE_LOG_BLOCK_SIZE; - if (log->online_backup_state - || (data_len >= OS_FILE_LOG_BLOCK_SIZE - LOG_BLOCK_TRL_SIZE)) { + if (data_len >= OS_FILE_LOG_BLOCK_SIZE - LOG_BLOCK_TRL_SIZE) { /* The string does not fit within the current log block or the log block would become full */ @@ -403,36 +402,3 @@ log_free_check(void) log_check_margins(); } } - -/**************************************************************************** -Gets the online backup lsn. */ -UNIV_INLINE -dulint -log_get_online_backup_lsn_low(void) -/*===============================*/ - /* out: online_backup_lsn, the caller must - own the log_sys mutex */ -{ -#ifdef UNIV_SYNC_DEBUG - ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ - ut_ad(log_sys->online_backup_state); - - return(log_sys->online_backup_lsn); -} - -/**************************************************************************** -Gets the online backup state. */ -UNIV_INLINE -ibool -log_get_online_backup_state_low(void) -/*=================================*/ - /* out: online backup state, the caller must - own the log_sys mutex */ -{ -#ifdef UNIV_SYNC_DEBUG - ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ - - return(log_sys->online_backup_state); -} diff --git a/innobase/include/mtr0mtr.h b/innobase/include/mtr0mtr.h index f6dfe23bc41..55fa3d80a42 100644 --- a/innobase/include/mtr0mtr.h +++ b/innobase/include/mtr0mtr.h @@ -82,7 +82,7 @@ flag value must give the length also! */ predefined minimum record */ #define MLOG_IBUF_BITMAP_INIT ((byte)27) /* initialize an ibuf bitmap page */ -#define MLOG_FULL_PAGE ((byte)28) /* full contents of a page */ +/*#define MLOG_FULL_PAGE ((byte)28) full contents of a page */ #define MLOG_INIT_FILE_PAGE ((byte)29) /* this means that a file page is taken into use and the prior contents of the page should be @@ -236,16 +236,6 @@ mtr_memo_release( mtr_t* mtr, /* in: mtr */ void* object, /* in: object */ ulint type); /* in: object type: MTR_MEMO_S_LOCK, ... */ -/**************************************************************** -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 */ /************************************************************** Checks if memo contains the given item. */ UNIV_INLINE diff --git a/innobase/log/log0log.c b/innobase/log/log0log.c index 292fed4b4ec..769889a21d7 100644 --- a/innobase/log/log0log.c +++ b/innobase/log/log0log.c @@ -790,11 +790,7 @@ log_init(void) log_sys->archiving_on = os_event_create(NULL); /*----------------------------*/ - - log_sys->online_backup_state = FALSE; - /*----------------------------*/ - log_block_init(log_sys->buf, log_sys->lsn); log_block_set_first_rec_group(log_sys->buf, LOG_BLOCK_HDR_SIZE); @@ -3003,66 +2999,6 @@ loop: mutex_exit(&(log_sys->mutex)); } -/********************************************************** -Switches the database to the online backup state. */ - -ulint -log_switch_backup_state_on(void) -/*============================*/ - /* out: DB_SUCCESS or DB_ERROR */ -{ - dulint backup_lsn; - - mutex_enter(&(log_sys->mutex)); - - if (log_sys->online_backup_state) { - - /* The database is already in that state */ - - mutex_exit(&(log_sys->mutex)); - - return(DB_ERROR); - } - - log_sys->online_backup_state = TRUE; - - backup_lsn = log_sys->lsn; - - log_sys->online_backup_lsn = backup_lsn; - - mutex_exit(&(log_sys->mutex)); - - /* log_checkpoint_and_mark_file_spaces(); */ - - return(DB_SUCCESS); -} - -/********************************************************** -Switches the online backup state off. */ - -ulint -log_switch_backup_state_off(void) -/*=============================*/ - /* out: DB_SUCCESS or DB_ERROR */ -{ - mutex_enter(&(log_sys->mutex)); - - if (!log_sys->online_backup_state) { - - /* The database is already in that state */ - - mutex_exit(&(log_sys->mutex)); - - return(DB_ERROR); - } - - log_sys->online_backup_state = FALSE; - - mutex_exit(&(log_sys->mutex)); - - return(DB_SUCCESS); -} - /******************************************************************** Makes a checkpoint at the latest lsn and writes it to first page of each data file in the database, so that we know that the file spaces contain diff --git a/innobase/log/log0recv.c b/innobase/log/log0recv.c index 65fb3466ad5..ff92335188d 100644 --- a/innobase/log/log0recv.c +++ b/innobase/log/log0recv.c @@ -808,9 +808,6 @@ recv_parse_or_apply_log_rec_body( } else if (type == MLOG_IBUF_BITMAP_INIT) { new_ptr = ibuf_parse_bitmap_init(ptr, end_ptr, page, mtr); - } else if (type == MLOG_FULL_PAGE) { - new_ptr = mtr_log_parse_full_page(ptr, end_ptr, page); - } else if (type == MLOG_INIT_FILE_PAGE) { new_ptr = fsp_parse_init_file_page(ptr, end_ptr, page); @@ -1127,15 +1124,7 @@ recv_recover_page( buf = ((byte*)(recv->data)) + sizeof(recv_data_t); } - if (recv->type == MLOG_INIT_FILE_PAGE - || recv->type == MLOG_FULL_PAGE) { - /* A new file page may have been taken into use, - or we have stored the full contents of the page: - in this case it may be that the original log record - type was MLOG_INIT_FILE_PAGE, and we replaced it - with MLOG_FULL_PAGE, thus we have to apply - any record of type MLOG_FULL_PAGE */ - + if (recv->type == MLOG_INIT_FILE_PAGE) { page_lsn = page_newest_lsn; mach_write_to_8(page + UNIV_PAGE_SIZE diff --git a/innobase/mtr/mtr0mtr.c b/innobase/mtr/mtr0mtr.c index fa1481dcb5f..deb4dabde4b 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", - (ulong) block->offset, - (ulong) ut_dulint_get_low( - buf_frame_get_newest_modification( - block->frame)), - (ulong) 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); diff --git a/innobase/que/que0que.c b/innobase/que/que0que.c index 08bf7ce3e59..363376a72da 100644 --- a/innobase/que/que0que.c +++ b/innobase/que/que0que.c @@ -190,8 +190,6 @@ que_thr_end_wait( ut_ad(mutex_own(&kernel_mutex)); #endif /* UNIV_SYNC_DEBUG */ ut_ad(thr); - ut_ad(next_thr); - ut_ad(*next_thr == NULL); ut_ad((thr->state == QUE_THR_LOCK_WAIT) || (thr->state == QUE_THR_PROCEDURE_WAIT) || (thr->state == QUE_THR_SIG_REPLY_WAIT)); |