Commit 3b1dd9af authored by unknown's avatar unknown
Browse files

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
parent fd079fda
Loading
Loading
Loading
Loading
+0 −35
Original line number Diff line number Diff line
@@ -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
@@ -871,13 +843,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
+1 −35
Original line number Diff line number Diff line
@@ -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);
}
+1 −11
Original line number Diff line number Diff line
@@ -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
@@ -230,16 +230,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
+0 −64
Original line number Diff line number Diff line
@@ -794,10 +794,6 @@ log_init(void)

	/*----------------------------*/

	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);

@@ -2973,66 +2969,6 @@ log_check_margins(void)
	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
+1 −12
Original line number Diff line number Diff line
@@ -790,9 +790,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);

@@ -1093,15 +1090,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
Loading