List:Commits« Previous MessageNext Message »
From:marko.makela Date:April 6 2011 11:07am
Subject:bzr commit into mysql-trunk-innodb branch (marko.makela:3567)
View as plain text  
#At file:///home/marko/innobase/dev/mysql2a/5.6-innodb/ based on revid:marko.makela@stripped0b3ao6kf83ah

 3567 Marko Mäkelä	2011-04-06
      Remove unused LOG_CHECKPOINT_FSP_FREE_LIMIT and useless checkpointing
      that was added in MySQL 3.23.50.
      
      According to Heikki Tuuri, the field LOG_CHECKPOINT_FSP_FREE_LIMIT may
      have been used in order to shorten backup files before Zlib
      compression (ibbackup --compress) was implemented in InnoDB Hot Backup
      (now known as MySQL Enterprise Backup).
      
      recv_read_checkpoint_info_for_backup(): Rename from
      recv_read_cp_info_for_backup() and remove the unused output parameter
      fsp_limit.
      
      log_fsp_current_free_limit_set_and_checkpoint(): Remove.
      
      log_fsp_current_free_limit: Remove.
      
      LOG_CHECKPOINT_FSP_FREE_LIMIT, LOG_CHECKPOINT_FSP_MAGIC_N,
      LOG_CHECKPOINT_FSP_MAGIC_N_VAL: Remove.
      
      fsp_header_get_free_limit(): Remove.
      
      fsp_fill_free_list(): No longer make a redo log checkpoint.
      Previously, we did that when extending the system tablespace (space 0).
      
      rb:643 approved by Jimmy Yang

    modified:
      storage/innobase/fsp/fsp0fsp.c
      storage/innobase/include/fsp0fsp.h
      storage/innobase/include/log0log.h
      storage/innobase/log/log0log.c
      storage/innobase/log/log0recv.c
      storage/innobase/srv/srv0start.c
=== modified file 'storage/innobase/fsp/fsp0fsp.c'
--- a/storage/innobase/fsp/fsp0fsp.c	revid:marko.makela@stripped
+++ b/storage/innobase/fsp/fsp0fsp.c	revid:marko.makela@stripped0110406110744-cfuob3lfdp8bu6mo
@@ -1097,38 +1097,6 @@ fsp_header_inc_size(
 }
 
 /**********************************************************************//**
-Gets the current free limit of the system tablespace.  The free limit
-means the place of the first page which has never been put to the
-free list for allocation.  The space above that address is initialized
-to zero.  Sets also the global variable log_fsp_current_free_limit.
-@return	free limit in megabytes */
-UNIV_INTERN
-ulint
-fsp_header_get_free_limit(void)
-/*===========================*/
-{
-	fsp_header_t*	header;
-	ulint		limit;
-	mtr_t		mtr;
-
-	mtr_start(&mtr);
-
-	mtr_x_lock(fil_space_get_latch(0, NULL), &mtr);
-
-	header = fsp_get_space_header(0, 0, &mtr);
-
-	limit = mtr_read_ulint(header + FSP_FREE_LIMIT, MLOG_4BYTES, &mtr);
-
-	limit /= ((1024 * 1024) / UNIV_PAGE_SIZE);
-
-	log_fsp_current_free_limit_set_and_checkpoint(limit);
-
-	mtr_commit(&mtr);
-
-	return(limit);
-}
-
-/**********************************************************************//**
 Gets the size of the system tablespace from the tablespace header.  If
 we do not have an auto-extending data file, this should be equal to
 the size of the data files.  If there is an auto-extending data file,
@@ -1395,15 +1363,6 @@ fsp_fill_free_list(
 		mlog_write_ulint(header + FSP_FREE_LIMIT, i + FSP_EXTENT_SIZE,
 				 MLOG_4BYTES, mtr);
 
-		/* Update the free limit info in the log system and make
-		a checkpoint */
-		if (space == 0) {
-			ut_a(!zip_size);
-			log_fsp_current_free_limit_set_and_checkpoint(
-				(i + FSP_EXTENT_SIZE)
-				/ ((1024 * 1024) / UNIV_PAGE_SIZE));
-		}
-
 		if (UNIV_UNLIKELY(init_xdes)) {
 
 			buf_block_t*	block;

=== modified file 'storage/innobase/include/fsp0fsp.h'
--- a/storage/innobase/include/fsp0fsp.h	revid:marko.makela@stripped406073710-uo4c0b3ao6kf83ah
+++ b/storage/innobase/include/fsp0fsp.h	revid:marko.makela@strippedfuob3lfdp8bu6mo
@@ -41,16 +41,6 @@ void
 fsp_init(void);
 /*==========*/
 /**********************************************************************//**
-Gets the current free limit of the system tablespace.  The free limit
-means the place of the first page which has never been put to the
-free list for allocation.  The space above that address is initialized
-to zero.  Sets also the global variable log_fsp_current_free_limit.
-@return	free limit in megabytes */
-UNIV_INTERN
-ulint
-fsp_header_get_free_limit(void);
-/*===========================*/
-/**********************************************************************//**
 Gets the size of the system tablespace from the tablespace header.  If
 we do not have an auto-extending data file, this should be equal to
 the size of the data files.  If there is an auto-extending data file,

=== modified file 'storage/innobase/include/log0log.h'
--- a/storage/innobase/include/log0log.h	revid:marko.makela@stripped0110406073710-uo4c0b3ao6kf83ah
+++ b/storage/innobase/include/log0log.h	revid:marko.makela@stripped44-cfuob3lfdp8bu6mo
@@ -69,17 +69,6 @@ extern	ibool	log_debug_writes;
 /** Maximum number of log groups in log_group_struct::checkpoint_buf */
 #define LOG_MAX_N_GROUPS	32
 
-#ifndef UNIV_HOTBACKUP
-/****************************************************************//**
-Sets the global variable log_fsp_current_free_limit. Also makes a checkpoint,
-so that we know that the limit has been written to a log checkpoint field
-on disk. */
-UNIV_INTERN
-void
-log_fsp_current_free_limit_set_and_checkpoint(
-/*==========================================*/
-	ulint	limit);	/*!< in: limit to set */
-#endif /* !UNIV_HOTBACKUP */
 /*******************************************************************//**
 Calculates where in log files we find a specified lsn.
 @return	log file number */
@@ -638,23 +627,38 @@ extern log_t*	log_sys;
 							+ LOG_MAX_N_GROUPS * 8)
 #define LOG_CHECKPOINT_CHECKSUM_1	LOG_CHECKPOINT_ARRAY_END
 #define LOG_CHECKPOINT_CHECKSUM_2	(4 + LOG_CHECKPOINT_ARRAY_END)
+#if 0
 #define LOG_CHECKPOINT_FSP_FREE_LIMIT	(8 + LOG_CHECKPOINT_ARRAY_END)
-					/* current fsp free limit in
+					/*!< Not used (0);
+					This used to contain the
+					current fsp free limit in
 					tablespace 0, in units of one
-					megabyte; this information is only used
-					by ibbackup to decide if it can
-					truncate unused ends of
-					non-auto-extending data files in space
-					0 */
+					megabyte.
+
+					This information might have been used
+					since ibbackup version 0.35 but
+					before 1.41 to decide if unused ends of
+					non-auto-extending data files
+					in space 0 can be truncated.
+
+					This information was made obsolete
+					by ibbackup --compress. */
 #define LOG_CHECKPOINT_FSP_MAGIC_N	(12 + LOG_CHECKPOINT_ARRAY_END)
-					/* this magic number tells if the
+					/*!< Not used (0);
+					This magic number tells if the
 					checkpoint contains the above field:
 					the field was added to
-					InnoDB-3.23.50 */
+					InnoDB-3.23.50 and
+					removed from MySQL 5.6 */
+#define LOG_CHECKPOINT_FSP_MAGIC_N_VAL	1441231243
+					/*!< if LOG_CHECKPOINT_FSP_MAGIC_N
+					contains this value, then
+					LOG_CHECKPOINT_FSP_FREE_LIMIT
+					is valid */
+#endif
 #define LOG_CHECKPOINT_OFFSET_HIGH32	(16 + LOG_CHECKPOINT_ARRAY_END)
 #define LOG_CHECKPOINT_SIZE		(20 + LOG_CHECKPOINT_ARRAY_END)
 
-#define LOG_CHECKPOINT_FSP_MAGIC_N_VAL	1441231243
 
 /* Offsets of a log file header */
 #define LOG_GROUP_ID		0	/* log group number */

=== modified file 'storage/innobase/log/log0log.c'
--- a/storage/innobase/log/log0log.c	revid:marko.makela@stripped
+++ b/storage/innobase/log/log0log.c	revid:marko.makela@stripped-20110406110744-cfuob3lfdp8bu6mo
@@ -76,10 +76,6 @@ reduce the size of the log.
 
 */
 
-/* Current free limit of space 0; protected by the log sys mutex; 0 means
-uninitialized */
-UNIV_INTERN ulint	log_fsp_current_free_limit		= 0;
-
 /* Global log system variable */
 UNIV_INTERN log_t*	log_sys	= NULL;
 
@@ -165,33 +161,6 @@ log_io_complete_archive(void);
 #endif /* UNIV_LOG_ARCHIVE */
 
 /****************************************************************//**
-Sets the global variable log_fsp_current_free_limit. Also makes a checkpoint,
-so that we know that the limit has been written to a log checkpoint field
-on disk. */
-UNIV_INTERN
-void
-log_fsp_current_free_limit_set_and_checkpoint(
-/*==========================================*/
-	ulint	limit)	/*!< in: limit to set */
-{
-	ibool	success;
-
-	mutex_enter(&(log_sys->mutex));
-
-	log_fsp_current_free_limit = limit;
-
-	mutex_exit(&(log_sys->mutex));
-
-	/* Try to make a synchronous checkpoint */
-
-	success = FALSE;
-
-	while (!success) {
-		success = log_checkpoint(TRUE, TRUE);
-	}
-}
-
-/****************************************************************//**
 Returns the oldest modified block lsn in the pool, or log_sys->lsn if none
 exists.
 @return	LSN of oldest modification */
@@ -1840,15 +1809,6 @@ log_group_checkpoint(
 			      LOG_CHECKPOINT_CHECKSUM_2 - LOG_CHECKPOINT_LSN);
 	mach_write_to_4(buf + LOG_CHECKPOINT_CHECKSUM_2, fold);
 
-	/* Starting from InnoDB-3.23.50, we also write info on allocated
-	size in the tablespace */
-
-	mach_write_to_4(buf + LOG_CHECKPOINT_FSP_FREE_LIMIT,
-			log_fsp_current_free_limit);
-
-	mach_write_to_4(buf + LOG_CHECKPOINT_FSP_MAGIC_N,
-			LOG_CHECKPOINT_FSP_MAGIC_N_VAL);
-
 	/* We alternate the physical place of the checkpoint info in the first
 	log file */
 

=== modified file 'storage/innobase/log/log0recv.c'
--- a/storage/innobase/log/log0recv.c	revid:marko.makela@stripped
+++ b/storage/innobase/log/log0recv.c	revid:marko.makela@oracle.com-20110406110744-cfuob3lfdp8bu6mo
@@ -762,15 +762,12 @@ Reads the checkpoint info needed in hot
 @return	TRUE if success */
 UNIV_INTERN
 ibool
-recv_read_cp_info_for_backup(
-/*=========================*/
+recv_read_checkpoint_info_for_backup(
+/*=================================*/
 	const byte*	hdr,	/*!< in: buffer containing the log group
 				header */
 	lsn_t*		lsn,	/*!< out: checkpoint lsn */
 	lsn_t*		offset,	/*!< out: checkpoint offset in the log group */
-	ulint*		fsp_limit,/*!< out: fsp limit of space 0,
-				1000000000 if the database is running
-				with < version 3.23.50 of InnoDB */
 	ib_uint64_t*	cp_no,	/*!< out: checkpoint number */
 	ib_uint64_t*	first_header_lsn)
 				/*!< out: lsn of of the start of the
@@ -807,23 +804,6 @@ recv_read_cp_info_for_backup(
 	*offset |= mach_read_from_4(
 		cp_buf + LOG_CHECKPOINT_OFFSET_HIGH32) << 32;
 
-	/* If the user is running a pre-3.23.50 version of InnoDB, its
-	checkpoint data does not contain the fsp limit info */
-	if (mach_read_from_4(cp_buf + LOG_CHECKPOINT_FSP_MAGIC_N)
-	    == LOG_CHECKPOINT_FSP_MAGIC_N_VAL) {
-
-		*fsp_limit = mach_read_from_4(
-			cp_buf + LOG_CHECKPOINT_FSP_FREE_LIMIT);
-
-		if (*fsp_limit == 0) {
-			*fsp_limit = 1000000000;
-		}
-	} else {
-		*fsp_limit = 1000000000;
-	}
-
-	/*	fprintf(stderr, "fsp limit %lu MB\n", *fsp_limit); */
-
 	*cp_no = mach_read_from_8(cp_buf + LOG_CHECKPOINT_NO);
 
 	*first_header_lsn = mach_read_from_8(hdr + LOG_FILE_START_LSN);

=== modified file 'storage/innobase/srv/srv0start.c'
--- a/storage/innobase/srv/srv0start.c	revid:marko.makela@stripped110406073710-uo4c0b3ao6kf83ah
+++ b/storage/innobase/srv/srv0start.c	revid:marko.makela@strippedcfuob3lfdp8bu6mo
@@ -1678,10 +1678,6 @@ innobase_start_or_create_for_mysql(void)
 
 		srv_startup_is_before_trx_rollback_phase = FALSE;
 
-		/* Initialize the fsp free limit global variable in the log
-		system */
-		fsp_header_get_free_limit();
-
 		recv_recovery_from_archive_finish();
 #endif /* UNIV_LOG_ARCHIVE */
 	} else {
@@ -1739,10 +1735,6 @@ innobase_start_or_create_for_mysql(void)
 
 		trx_purge_sys_create(srv_n_purge_threads, ib_bh);
 
-		/* Initialize the fsp free limit global variable in the log
-		system */
-		fsp_header_get_free_limit();
-
 		/* recv_recovery_from_checkpoint_finish needs trx lists which
 		are initialized in trx_sys_init_at_db_start(). */
 

Attachment: [text/bzr-bundle] bzr/marko.makela@oracle.com-20110406110744-cfuob3lfdp8bu6mo.bundle
Thread
bzr commit into mysql-trunk-innodb branch (marko.makela:3567) marko.makela6 Apr