List:Commits« Previous MessageNext Message »
From:marko.makela Date:September 20 2012 10:09am
Subject:bzr push into mysql-5.6-wl6494 branch (marko.makela:4296 to 4301) WL#6494
View as plain text  
 4301 Marko Mäkelä	2012-09-20
      WL#6494 preparation (non-functional change)
      
      log_group_close_all(): Refactored from log_shutdown().

    modified:
      storage/innobase/include/log0log.h
      storage/innobase/log/log0log.cc
 4300 Marko Mäkelä	2012-09-20
      WL#6494 preparation (non-functional change)
      
      Remove parsing of multiple InnoDB redo log groups.

    modified:
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/include/srv0srv.h
      storage/innobase/srv/srv0srv.cc
      storage/innobase/srv/srv0start.cc
 4299 Marko Mäkelä	2012-09-20
      WL#6494 preparation (non-functional change)
      
      recv_truncate_group(): Clear memory with memset().

    modified:
      storage/innobase/log/log0recv.cc
 4298 Marko Mäkelä	2012-09-20
      WL#6494 preparation: Use ib_logf for some recovery error messages.

    modified:
      storage/innobase/log/log0recv.cc
 4297 Marko Mäkelä	2012-09-20
      Branch mysql-5.6-wl6494 from mysql-5.6.

    modified:
      .bzr-mysql/default.conf
 4296 Marko Mäkelä	2012-09-20 [merge]
      Merge mysql-5.5 to mysql-5.6.

    modified:
      mysql-test/suite/sys_vars/r/innodb_change_buffering_debug_basic.result
      mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test
=== modified file '.bzr-mysql/default.conf'
--- a/.bzr-mysql/default.conf	revid:marko.makela@strippedh5p
+++ b/.bzr-mysql/default.conf	revid:marko.makela@oracle.com-20120920100757-oufyfbx276gqcbqd
@@ -1,4 +1,4 @@
 [MYSQL]
 post_commit_to = "commits@stripped"
 post_push_to = "commits@stripped"
-tree_name = "mysql-5.6"
+tree_name = "mysql-5.6-wl6494"

=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc	revid:marko.makela@stripped120920060507-opzeh2h4e2c2gh5p
+++ b/storage/innobase/handler/ha_innodb.cc	revid:marko.makela@stripped0757-oufyfbx276gqcbqd
@@ -151,7 +151,6 @@ are determined in innobase_init below: *
 
 static char*	innobase_data_home_dir			= NULL;
 static char*	innobase_data_file_path			= NULL;
-static char*	innobase_log_group_home_dir		= NULL;
 static char*	innobase_file_format_name		= NULL;
 static char*	innobase_change_buffering		= NULL;
 static char*	innobase_enable_monitor_counter		= NULL;
@@ -2923,8 +2922,8 @@ mem_free_and_error:
 
 	/* The default dir for log files is the datadir of MySQL */
 
-	if (!innobase_log_group_home_dir) {
-		innobase_log_group_home_dir = default_path;
+	if (!srv_log_group_home_dir) {
+		srv_log_group_home_dir = default_path;
 	}
 
 #ifdef UNIV_LOG_ARCHIVE
@@ -2937,12 +2936,12 @@ mem_free_and_error:
 	srv_arch_dir = innobase_log_arch_dir;
 #endif /* UNIG_LOG_ARCHIVE */
 
-	ret = (bool)
-		srv_parse_log_group_home_dirs(innobase_log_group_home_dir);
+	srv_normalize_path_for_win(srv_log_group_home_dir);
 
-	if (ret == FALSE || innobase_mirrored_log_groups != 1) {
-	  sql_print_error("syntax error in innodb_log_group_home_dir, or a "
-			  "wrong number of mirrored log groups");
+	if (strchr(srv_log_group_home_dir, ';')
+	    || innobase_mirrored_log_groups != 1) {
+		sql_print_error("syntax error in innodb_log_group_home_dir, "
+				"or a wrong number of mirrored log groups");
 
 		goto mem_free_and_error;
 	}
@@ -3073,7 +3072,6 @@ innobase_change_buffering_inited_ok:
 
 	srv_file_flush_method_str = innobase_file_flush_method;
 
-	srv_n_log_groups = (ulint) innobase_mirrored_log_groups;
 	srv_n_log_files = (ulint) innobase_log_files_in_group;
 	srv_log_file_size = (ib_uint64_t) innobase_log_file_size;
 
@@ -15397,7 +15395,7 @@ static MYSQL_SYSVAR_BOOL(log_archive, in
   "Set to 1 if you want to have logs archived.", NULL, NULL, FALSE);
 #endif /* UNIV_LOG_ARCHIVE */
 
-static MYSQL_SYSVAR_STR(log_group_home_dir, innobase_log_group_home_dir,
+static MYSQL_SYSVAR_STR(log_group_home_dir, srv_log_group_home_dir,
   PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
   "Path to InnoDB log files.", NULL, NULL, NULL);
 

=== modified file 'storage/innobase/include/log0log.h'
--- a/storage/innobase/include/log0log.h	revid:marko.makela@stripped
+++ b/storage/innobase/include/log0log.h	revid:marko.makela@oracle.com-20120920100757-oufyfbx276gqcbqd
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
 Copyright (c) 2009, Google Inc.
 
 Portions of this file contain modifications contributed and copyrighted by
@@ -542,13 +542,19 @@ UNIV_INTERN
 void
 log_refresh_stats(void);
 /*===================*/
-/**********************************************************
+/********************************************************//**
+Closes all log groups. */
+UNIV_INTERN
+void
+log_group_close_all(void);
+/*=====================*/
+/********************************************************//**
 Shutdown the log system but do not release all the memory. */
 UNIV_INTERN
 void
 log_shutdown(void);
 /*==============*/
-/**********************************************************
+/********************************************************//**
 Free the log system data structures. */
 UNIV_INTERN
 void

=== modified file 'storage/innobase/include/srv0srv.h'
--- a/storage/innobase/include/srv0srv.h	revid:marko.makela@stripped
+++ b/storage/innobase/include/srv0srv.h	revid:marko.makela@oracle.com-20120920100757-oufyfbx276gqcbqd
@@ -237,13 +237,12 @@ extern ulint*	srv_data_file_is_raw_parti
 
 extern ibool	srv_auto_extend_last_data_file;
 extern ulint	srv_last_file_size_max;
-extern char**	srv_log_group_home_dirs;
+extern char*	srv_log_group_home_dir;
 #ifndef UNIV_HOTBACKUP
 extern ulong	srv_auto_extend_increment;
 
 extern ibool	srv_created_new_raw;
 
-extern ulint	srv_n_log_groups;
 extern ulint	srv_n_log_files;
 extern ib_uint64_t	srv_log_file_size;
 extern ulint	srv_log_buffer_size;

=== modified file 'storage/innobase/log/log0log.cc'
--- a/storage/innobase/log/log0log.cc	revid:marko.makela@strippedm-20120920060507-opzeh2h4e2c2gh5p
+++ b/storage/innobase/log/log0log.cc	revid:marko.makela@stripped57-oufyfbx276gqcbqd
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2009, Google Inc.
 
 Portions of this file contain modifications contributed and copyrighted by
@@ -3505,7 +3505,7 @@ log_refresh_stats(void)
 	log_sys->last_printout_time = time(NULL);
 }
 
-/**********************************************************************
+/********************************************************//**
 Closes a log group. */
 static
 void
@@ -3535,12 +3535,12 @@ log_group_close(
 	mem_free(group);
 }
 
-/**********************************************************
-Shutdown the log system but do not release all the memory. */
+/********************************************************//**
+Closes all log groups. */
 UNIV_INTERN
 void
-log_shutdown(void)
-/*==============*/
+log_group_close_all(void)
+/*=====================*/
 {
 	log_group_t*	group;
 
@@ -3554,6 +3554,16 @@ log_shutdown(void)
 
 		log_group_close(prev_group);
 	}
+}
+
+/********************************************************//**
+Shutdown the log system but do not release all the memory. */
+UNIV_INTERN
+void
+log_shutdown(void)
+/*==============*/
+{
+	log_group_close_all();
 
 	mem_free(log_sys->buf_ptr);
 	log_sys->buf_ptr = NULL;
@@ -3581,7 +3591,7 @@ log_shutdown(void)
 	recv_sys_close();
 }
 
-/**********************************************************
+/********************************************************//**
 Free the log system data structures. */
 UNIV_INTERN
 void

=== modified file 'storage/innobase/log/log0recv.cc'
--- a/storage/innobase/log/log0recv.cc	revid:marko.makela@strippedh4e2c2gh5p
+++ b/storage/innobase/log/log0recv.cc	revid:marko.makela@stripped
@@ -426,7 +426,6 @@ recv_truncate_group(
 	lsn_t		finish_lsn1;
 	lsn_t		finish_lsn2;
 	lsn_t		finish_lsn;
-	ulint		i;
 
 	if (archived_lsn == LSN_MAX) {
 		/* Checkpoint was taken in the NOARCHIVELOG mode */
@@ -454,11 +453,7 @@ recv_truncate_group(
 
 	ut_a(RECV_SCAN_SIZE <= log_sys->buf_size);
 
-	/* Write the log buffer full of zeros */
-	for (i = 0; i < RECV_SCAN_SIZE; i++) {
-
-		*(log_sys->buf + i) = '\0';
-	}
+	memset(log_sys->buf, 0, RECV_SCAN_SIZE);
 
 	start_lsn = ut_uint64_align_down(recovered_lsn,
 					 OS_FILE_LOG_BLOCK_SIZE);
@@ -498,11 +493,7 @@ recv_truncate_group(
 			return;
 		}
 
-		/* Write the log buffer full of zeros */
-		for (i = 0; i < RECV_SCAN_SIZE; i++) {
-
-			*(log_sys->buf + i) = '\0';
-		}
+		memset(log_sys->buf, 0, RECV_SCAN_SIZE);
 
 		start_lsn = end_lsn;
 	}
@@ -3144,11 +3135,16 @@ recv_recovery_from_checkpoint_start_func
 			}
 
 			if (!recv_needed_recovery) {
-				fprintf(stderr,
-					"InnoDB: The log sequence number"
-					" in ibdata files does not match\n"
-					"InnoDB: the log sequence number"
-					" in the ib_logfiles!\n");
+				ib_logf(IB_LOG_LEVEL_WARN,
+					"InnoDB: The log sequence numbers "
+					LSN_PF " and " LSN_PF
+					" in ibdata files do not match"
+					" the log sequence number "
+					LSN_PF
+					" in the ib_logfiles!",
+					min_flushed_lsn,
+					max_flushed_lsn,
+					checkpoint_lsn);
 				recv_init_crash_recovery();
 			}
 		}
@@ -3160,29 +3156,14 @@ recv_recovery_from_checkpoint_start_func
 	}
 
 	/* We currently have only one log group */
-	if (group_scanned_lsn < checkpoint_lsn) {
-		ut_print_timestamp(stderr);
-		fprintf(stderr,
-			"  InnoDB: ERROR: We were only able to scan the log"
-			" up to\n"
-			"InnoDB: " LSN_PF ", but a checkpoint was at "
-			LSN_PF ".\n"
-			"InnoDB: It is possible that"
-			" the database is now corrupt!\n",
-			group_scanned_lsn,
-			checkpoint_lsn);
-	}
-
-	if (group_scanned_lsn < recv_max_page_lsn) {
-		ut_print_timestamp(stderr);
-		fprintf(stderr,
-			"  InnoDB: ERROR: We were only able to scan the log"
-			" up to " LSN_PF "\n"
-			"InnoDB: but a database page a had an lsn " LSN_PF "."
-			" It is possible that the\n"
-			"InnoDB: database is now corrupt!\n",
-			group_scanned_lsn,
-			recv_max_page_lsn);
+	if (group_scanned_lsn < checkpoint_lsn
+	    || group_scanned_lsn < recv_max_page_lsn) {
+		ib_logf(IB_LOG_LEVEL_ERROR,
+			"We scanned the log up to "
+			LSN_PF ". A checkpoint was at " LSN_PF
+			" and the maximum LSN on a database page was " LSN_PF
+			". It is possible that the database is now corrupt!",
+			group_scanned_lsn, checkpoint_lsn, recv_max_page_lsn);
 	}
 
 	if (recv_sys->recovered_lsn < checkpoint_lsn) {

=== modified file 'storage/innobase/srv/srv0srv.cc'
--- a/storage/innobase/srv/srv0srv.cc	revid:marko.makela@oracle.com-20120920060507-opzeh2h4e2c2gh5p
+++ b/storage/innobase/srv/srv0srv.cc	revid:marko.makela@stripped0100757-oufyfbx276gqcbqd
@@ -176,9 +176,8 @@ the user from forgetting the 'newraw' ke
 
 UNIV_INTERN ibool	srv_created_new_raw	= FALSE;
 
-UNIV_INTERN char**	srv_log_group_home_dirs = NULL;
+UNIV_INTERN char*	srv_log_group_home_dir	= NULL;
 
-UNIV_INTERN ulint	srv_n_log_groups	= ULINT_MAX;
 UNIV_INTERN ulint	srv_n_log_files		= ULINT_MAX;
 /* size in database pages */
 UNIV_INTERN ib_uint64_t	srv_log_file_size	= IB_UINT64_MAX;

=== modified file 'storage/innobase/srv/srv0start.cc'
--- a/storage/innobase/srv/srv0start.cc	revid:marko.makela@strippedopzeh2h4e2c2gh5p
+++ b/storage/innobase/srv/srv0start.cc	revid:marko.makela@strippedcbqd
@@ -431,79 +431,6 @@ srv_parse_data_file_paths_and_sizes(
 }
 
 /*********************************************************************//**
-Reads log group home directories from a character string given in
-the .cnf file.
-@return	TRUE if ok, FALSE on parse error */
-UNIV_INTERN
-ibool
-srv_parse_log_group_home_dirs(
-/*==========================*/
-	char*	str)	/*!< in/out: character string */
-{
-	char*	input_str;
-	char*	path;
-	ulint	i	= 0;
-
-	srv_log_group_home_dirs = NULL;
-
-	input_str = str;
-
-	/* First calculate the number of directories and check syntax:
-	path;path;... */
-
-	while (*str != '\0') {
-		path = str;
-
-		while (*str != ';' && *str != '\0') {
-			str++;
-		}
-
-		i++;
-
-		if (*str == ';') {
-			str++;
-		} else if (*str != '\0') {
-
-			return(FALSE);
-		}
-	}
-
-	if (i != 1) {
-		/* If innodb_log_group_home_dir was defined it must
-		contain exactly one path definition under current MySQL */
-
-		return(FALSE);
-	}
-
-	srv_log_group_home_dirs = static_cast<char**>(
-		malloc(i * sizeof *srv_log_group_home_dirs));
-
-	/* Then store the actual values to our array */
-
-	str = input_str;
-	i = 0;
-
-	while (*str != '\0') {
-		path = str;
-
-		while (*str != ';' && *str != '\0') {
-			str++;
-		}
-
-		if (*str == ';') {
-			*str = '\0';
-			str++;
-		}
-
-		srv_log_group_home_dirs[i] = path;
-
-		i++;
-	}
-
-	return(TRUE);
-}
-
-/*********************************************************************//**
 Frees the memory allocated by srv_parse_data_file_paths_and_sizes()
 and srv_parse_log_group_home_dirs(). */
 UNIV_INTERN
@@ -517,8 +444,6 @@ srv_free_paths_and_sizes(void)
 	srv_data_file_sizes = NULL;
 	free(srv_data_file_is_raw_partition);
 	srv_data_file_is_raw_partition = NULL;
-	free(srv_log_group_home_dirs);
-	srv_log_group_home_dirs = NULL;
 }
 
 #ifndef UNIV_HOTBACKUP
@@ -606,11 +531,11 @@ open_or_create_log_file(
 
 	*log_file_created = FALSE;
 
-	srv_normalize_path_for_win(srv_log_group_home_dirs[k]);
+	srv_normalize_path_for_win(srv_log_group_home_dir);
 
-	dirnamelen = strlen(srv_log_group_home_dirs[k]);
+	dirnamelen = strlen(srv_log_group_home_dir);
 	ut_a(dirnamelen < (sizeof name) - 10 - sizeof "ib_logfile");
-	memcpy(name, srv_log_group_home_dirs[k], dirnamelen);
+	memcpy(name, srv_log_group_home_dir, dirnamelen);
 
 	/* Add a path separator if needed. */
 	if (dirnamelen && name[dirnamelen - 1] != SRV_PATH_SEPARATOR) {
@@ -2763,7 +2688,7 @@ innobase_shutdown_for_mysql(void)
 /********************************************************************
 Signal all per-table background threads to shutdown, and wait for them to do
 so. */
-
+UNIV_INTERN
 void
 srv_shutdown_table_bg_threads(void)
 /*===============================*/

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.6-wl6494 branch (marko.makela:4296 to 4301) WL#6494marko.makela21 Sep