List:Commits« Previous MessageNext Message »
From:marko.makela Date:September 21 2012 11:25am
Subject:bzr push into mysql-5.6-wl6494 branch (marko.makela:4305 to 4307) WL#6494
View as plain text  
 4307 Marko Mäkelä	2012-09-21
      WL#6494 error log cleanup:
      create_log_file(): Use ib_logf() for diagnostics.

    modified:
      storage/innobase/srv/srv0start.cc
 4306 Marko Mäkelä	2012-09-21
      WL#6494 clean-up.
      
      fil_node_create(): Return the created file name, or NULL on error.
      Check the error status in all callers.

    modified:
      storage/innobase/fil/fil0fil.cc
      storage/innobase/include/fil0fil.h
      storage/innobase/srv/srv0start.cc
 4305 Marko Mäkelä	2012-09-21
      WL#6494: Make innodb_log_file_size=48M the new default.
      
      mysql-test-run: Explicitly specify the old default innodb_log_file_size=5M.
      This can be overridden by --mysqld=--innodb-log-file-size=48M.

    modified:
      mysql-test/mysql-test-run.pl
      storage/innobase/handler/ha_innodb.cc
=== modified file 'storage/innobase/fil/fil0fil.cc'
--- a/storage/innobase/fil/fil0fil.cc	revid:marko.makela@stripped47-l0jl125105fxb2v6
+++ b/storage/innobase/fil/fil0fil.cc	revid:marko.makela@stripped8cq27
@@ -618,9 +618,10 @@ fil_space_is_flushed(
 }
 
 /*******************************************************************//**
-Appends a new file to the chain of files of a space. File must be closed. */
+Appends a new file to the chain of files of a space. File must be closed.
+@return pointer to the file name, or NULL on error */
 UNIV_INTERN
-void
+char*
 fil_node_create(
 /*============*/
 	const char*	name,	/*!< in: file name (file must be closed) */
@@ -663,7 +664,7 @@ fil_node_create(
 
 		mutex_exit(&fil_system->mutex);
 
-		return;
+		return(NULL);
 	}
 
 	space->size += size;
@@ -678,6 +679,8 @@ fil_node_create(
 	}
 
 	mutex_exit(&fil_system->mutex);
+
+	return(node->name);
 }
 
 /********************************************************************//**
@@ -3383,13 +3386,11 @@ fil_create_new_single_table_tablespace(
 	}
 
 	success = fil_space_create(tablename, space_id, flags, FIL_TABLESPACE);
-	if (!success) {
+	if (!success || !fil_node_create(path, size, space_id, FALSE)) {
 		err = DB_ERROR;
 		goto error_exit_1;
 	}
 
-	fil_node_create(path, size, space_id, FALSE);
-
 #ifndef UNIV_HOTBACKUP
 	{
 		mtr_t		mtr;
@@ -3805,9 +3806,11 @@ skip_validate:
 		/* We do not measure the size of the file, that is why
 		we pass the 0 below */
 
-		fil_node_create(remote.success ? remote.filepath :
-				dict.success ? dict.filepath :
-				def.filepath, 0, id, FALSE);
+		if (!fil_node_create(remote.success ? remote.filepath :
+				     dict.success ? dict.filepath :
+				     def.filepath, 0, id, FALSE)) {
+			err = DB_ERROR;
+		}
 	}
 
 cleanup_and_exit:
@@ -4189,7 +4192,9 @@ will_not_choose:
 	the rounding formula for extents and pages is somewhat complex; we
 	let fil_node_open() do that task. */
 
-	fil_node_create(fsp->filepath, 0, fsp->id, FALSE);
+	if (!fil_node_create(fsp->filepath, 0, fsp->id, FALSE)) {
+		ut_error;
+	}
 
 func_exit:
 	os_file_close(fsp->file);

=== modified file 'storage/innobase/include/fil0fil.h'
--- a/storage/innobase/include/fil0fil.h	revid:marko.makela@stripped25105fxb2v6
+++ b/storage/innobase/include/fil0fil.h	revid:marko.makela@stripped
@@ -199,17 +199,19 @@ fil_space_get_type(
 	ulint	id);	/*!< in: space id */
 #endif /* !UNIV_HOTBACKUP */
 /*******************************************************************//**
-Appends a new file to the chain of files of a space. File must be closed. */
+Appends a new file to the chain of files of a space. File must be closed.
+@return pointer to the file name, or NULL on error */
 UNIV_INTERN
-void
+char*
 fil_node_create(
 /*============*/
 	const char*	name,	/*!< in: file name (file must be closed) */
 	ulint		size,	/*!< in: file size in database blocks, rounded
 				downwards to an integer */
 	ulint		id,	/*!< in: space id where to append */
-	ibool		is_raw);/*!< in: TRUE if a raw device or
+	ibool		is_raw)	/*!< in: TRUE if a raw device or
 				a raw disk partition */
+	__attribute__((nonnull, warn_unused_result));
 #ifdef UNIV_LOG_ARCHIVE
 /****************************************************************//**
 Drops files from the start of a file space, so that its size is cut by

=== modified file 'storage/innobase/srv/srv0start.cc'
--- a/storage/innobase/srv/srv0start.cc	revid:marko.makela@stripped047-l0jl125105fxb2v6
+++ b/storage/innobase/srv/srv0start.cc	revid:marko.makela@strippeddrr8cq27
@@ -521,30 +521,16 @@ create_log_file(
 		innodb_file_log_key, name,
 		OS_FILE_CREATE, OS_FILE_NORMAL, OS_LOG_FILE, &ret);
 
-	ut_print_timestamp(stderr);
-
-	fprintf(stderr,
-		" InnoDB: Log file %s did not exist:"
-		" new to be created\n",
-		name);
-
-	fprintf(stderr, "InnoDB: Setting log file %s size to %lu MB\n",
+	ib_logf(IB_LOG_LEVEL_INFO,
+		"Setting log file %s size to %lu MB",
 		name, (ulong) srv_log_file_size
 		>> (20 - UNIV_PAGE_SIZE_SHIFT));
 
-	fprintf(stderr,
-		"InnoDB: Database physically writes the file"
-		" full: wait...\n");
-
 	ret = os_file_set_size(name, *file,
 			       (os_offset_t) srv_log_file_size
 			       << UNIV_PAGE_SIZE_SHIFT);
 	if (!ret) {
-		fprintf(stderr,
-			"InnoDB: Error in creating %s:"
-			" probably out of disk space\n",
-			name);
-
+		ib_logf(IB_LOG_LEVEL_ERROR, "Error in creating %s", name);
 		return(DB_ERROR);
 	}
 
@@ -894,8 +880,10 @@ skip_size_check:
 
 		ut_a(fil_validate());
 
-		fil_node_create(name, srv_data_file_sizes[i], 0,
-				srv_data_file_is_raw_partition[i] != 0);
+		if (!fil_node_create(name, srv_data_file_sizes[i], 0,
+				     srv_data_file_is_raw_partition[i] != 0)) {
+			return(DB_ERROR);
+		}
 	}
 
 	return(DB_SUCCESS);
@@ -976,7 +964,7 @@ srv_undo_tablespace_open(
 	ulint		space)		/*!< in: tablespace id */
 {
 	os_file_t	fh;
-	dberr_t		err;
+	dberr_t		err	= DB_ERROR;
 	ibool		ret;
 	ulint		flags;
 
@@ -1029,11 +1017,9 @@ srv_undo_tablespace_open(
 		is 64 bit. It is OK to cast the n_pages to ulint because
 		the unit has been scaled to pages and they are always
 		32 bit. */
-		fil_node_create(name, (ulint) n_pages, space, FALSE);
-
-		err = DB_SUCCESS;
-	} else {
-		err = DB_ERROR;
+		if (fil_node_create(name, (ulint) n_pages, space, FALSE)) {
+			err = DB_SUCCESS;
+		}
 	}
 
 	return(err);
@@ -1915,8 +1901,10 @@ create_log_files:
 		sprintf(logfilename + dirnamelen, "ib_logfile%lu",
 			(ulong) j);
 
-		fil_node_create(logfilename, (ulint) srv_log_file_size,
-				SRV_LOG_SPACE_FIRST_ID, FALSE);
+		if (!fil_node_create(logfilename, (ulint) srv_log_file_size,
+				     SRV_LOG_SPACE_FIRST_ID, FALSE)) {
+			return(DB_ERROR);
+		}
 	}
 
 #ifdef UNIV_LOG_ARCHIVE
@@ -2250,9 +2238,12 @@ create_log_files:
 				sprintf(logfilename + dirnamelen,
 					"ib_logfile%lu", (ulong) i);
 
-				fil_node_create(
-					logfilename, (ulint) srv_log_file_size,
-					SRV_LOG_SPACE_FIRST_ID, FALSE);
+				if (!fil_node_create(
+					    logfilename,
+					    (ulint) srv_log_file_size,
+					    SRV_LOG_SPACE_FIRST_ID, FALSE)) {
+					ut_error;
+				}
 			}
 
 			log_group_init(0, srv_n_log_files,

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