=== modified file 'storage/xtradb/handler/ha_innodb.cc'
--- storage/xtradb/handler/ha_innodb.cc 2009-09-09 21:06:57 +0000
+++ storage/xtradb/handler/ha_innodb.cc 2009-10-14 03:12:52 +0000
@@ -2405,6 +2405,9 @@
        /* Get the current high water mark format. */
        innobase_file_format_check = (char*) trx_sys_file_format_max_get();
 
+       /* Get the current log file size. */
+       innobase_log_file_size = srv_log_file_size;
+
        DBUG_RETURN(FALSE);
 error:
        DBUG_RETURN(TRUE);

=== modified file 'storage/xtradb/srv/srv0start.c'
--- storage/xtradb/srv/srv0start.c      2009-09-16 17:43:01 +0000
+++ storage/xtradb/srv/srv0start.c      2009-10-14 03:17:20 +0000
@@ -547,6 +547,21 @@
 }
 
 /*************************************************************************
+Calculates the number of database pages which are represented by the
+file size in bytes. */
+static
+ulint
+srv_calc_pages(
+/*============*/
+                               /* out: file size in database pages */
+       ulint   size,           /* in: low 32 bits of file size in bytes */
+       ulint   size_high)      /* in: high 32 bits of file size in bytes */
+{
+       return((size >> UNIV_PAGE_SIZE_SHIFT)
+               | (size_high << (32 - UNIV_PAGE_SIZE_SHIFT));
+}
+
+/*************************************************************************
 Creates or opens the log files and closes them. */
 static
 ulint
@@ -611,8 +626,9 @@
                ret = os_file_get_size(files[i], &size, &size_high);
                ut_a(ret);
 
-               if (size != srv_calc_low32(srv_log_file_size)
-                   || size_high != srv_calc_high32(srv_log_file_size)) {
+               if ((size != srv_calc_low32(srv_log_file_size)
+                   || size_high != srv_calc_high32(srv_log_file_size))
+                   && log_file_has_been_opened) {
 
                        fprintf(stderr,
                                "InnoDB: Error: log file %s is"
@@ -625,6 +641,7 @@
 
                        return(DB_ERROR);
                }
+               srv_log_file_size = srv_calc_pages(size, size_high);
        } else {
                *log_file_created = TRUE;

-- 
Feature req: innodb_log_file_size smarter on startup
https://bugs.launchpad.net/bugs/303124
You received this bug notification because you are a member of OurDelta-
developers, which is the registrant for OurDelta.

Status in OurDelta - Builds for MySQL,MariaDB: In Progress
Status in Patches for MySQL by Percona: Confirmed

Bug description:
Feature request:
On InnoDB startup, check whether the iblog files exist, and what size they are.
Feed that size back into the innodb_log_file_size, regardless of what it was.
If it was different, you can write a warning to errorlog, but no error/abort.

This little tweak would allow us to increase the default log file size, without 
breaking existing installations.

_______________________________________________
Mailing list: https://launchpad.net/~ourdelta-developers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~ourdelta-developers
More help   : https://help.launchpad.net/ListHelp

Reply via email to