Bug #41490 After enlargement of InnoDB page size, the error message become inaccurate.
Submitted: 16 Dec 2008 7:39 Modified: 20 Jun 2010 1:01
Reporter: Meiji KIMURA Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.0.x OS:Any
Assigned to: Satya B CPU Architecture:Any

[16 Dec 2008 7:39] Meiji KIMURA
Description:
As MySQL document said, we can enlarge a page size of InnoDB.

"The default database page size in InnoDB is 16KB. By recompiling the code, you can set it to values ranging from 8KB to 64KB. You must update the values of UNIV_PAGE_SIZE and UNIV_PAGE_SIZE_SHIFT in the univ.i source file."
http://dev.mysql.com/doc/refman/5.1/en/innodb-restrictions.html

When I want to set 64KB for an InnoDB page size, modify code and recompile.

#define UNIV_PAGE_SIZE (8 * 8192)
#define UNIV_PAGE_SIZE_SHIFT 16

But I try to re-start MySQL with default settings, it fails like this,
081215 22:33:48  mysqld started
InnoDB: Error: tablespace size must be at least 10 MB
081215 22:33:48 Can't init databases
081215 22:33:48 Aborting

I looked into this problem, and I found a cause of this.

Ordinary InnoDB setting is like this,
innodb_data_file_path = ibdata1:10M:autoextend

But I enlarged a page size of InnoDB, 10M is too short to activate MySQL.
We have to enlarge size for innodb_data_file_path, innodb_log_file_size, innodb_buffer_pool_size according to a page size of InnoDB.

[An example of my.cnf for extended InnoDB]
innodb_data_file_path = ibdata1:100M:autoextend
innodb_log_file_size = 50M
innodb_buffer_pool_size = 200M

But why 10M is described in an error message?

I also looked into source codes about an error message. 10M is written as a hard code, so the error message cannot display proper size for extended InnoDB page size.

in srv0start.c

if (sum_of_new_sizes < 640) {
	  fprintf(stderr,
	  "InnoDB: Error: tablespace size must be at least 10 MB\n");
	  return(DB_ERROR);
}

The program shold modify this part depends on InnoDB page size.

How to repeat:
(1) Enlarge a size of InnoDB page to 64KB.
(2) Compile source code to make a MySQL Binary.
(3) Restart MySQL with default settings.

Suggested fix:
InnoDB shold report to accurate size for error.
The program shold modify the error message depends on InnoDB page size.

in srv0start.c
if (sum_of_new_sizes < 640) {
	  fprintf(stderr,
	  "InnoDB: Error: tablespace size must be at least 10 MB\n");
	  return(DB_ERROR);
}
[18 Dec 2008 7:45] Marko Mäkelä
The 10-megabyte minimum tablespace size is a somewhat arbitrary limit. I would simply replace the 640 with 10485760/UNIV_PAGE_SIZE. It would be 640 when UNIV_PAGE_SIZE is 16384 bytes.

Note that the implementation of ROW_FORMAT=COMPRESSED in the InnoDB plugin assumes that UNIV_PAGE_SIZE is at most 16 kilobytes.  In the dense page directory in the compressed page trailer, pointers to records are 14-bit.  We may change that later.

Several years ago, when I was developing ROW_FORMAT=COMPACT, I also experimented with different page sizes. I remember seeing this assertion failure in page_rec_check() when defining UNIV_PAGE_SIZE to 65536:

rec <= page_header_get_ptr(page, PAGE_HEAP_TOP)

This would likely be in MySQL 4.1 or 5.0. I didn't investigate this more closely. So, be careful when using a larger UNIV_PAGE_SIZE.

If you change UNIV_PAGE_SIZE, you won't be able to exchange any data or log files with plain InnoDB.  It would be challenging to make UNIV_PAGE_SIZE a configuration parameter, let alone to make it a table property.  A configureable UNIV_PAGE_SIZE could make InnoDB noticeably slower.
[8 Jan 2009 13:17] Marko Mäkelä
A patch that replaces the 640 with 10485760 / UNIV_PAGE_SIZE was committed to the InnoDB 6.0 repository.
[4 Nov 2009 9:26] Bugs System
Pushed into 5.1.41 (revid:joro@sun.com-20091104092152-qz96bzlf2o1japwc) (version source revid:kristofer.pettersson@sun.com-20091103162305-08l4gkeuif2ozsoj) (merge vers: 5.1.41) (pib:13)
[11 Nov 2009 6:53] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091110093407-rw5g8dys2baqkt67) (version source revid:alik@sun.com-20091109080109-7dxapd5y5pxlu08w) (merge vers: 6.0.14-alpha) (pib:13)
[11 Nov 2009 7:01] Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091109115615-nuohp02h8mdrz8m2) (version source revid:svoj@sun.com-20091105122958-jyqjx9xus8v4e0yd) (merge vers: 5.5.0-beta) (pib:13)
[13 Nov 2009 2:26] Paul DuBois
Noted in 5.1.41, 5.5.0, 6.0.14 changelog.

With a nonstandard InnoDB page size, some error messages became
inaccurate.
[24 Nov 2009 19:38] Paul DuBois
Addition to changelog entry:

Changing the page size is not a supported operation and there is no
guarantee that InnoDB will function normally with a page size other
than 16KB. Problems compiling or running InnoDB may occur. In
particular, ROW_FORMAT=COMPRESSED in the InnoDB Plugin assumes that
the page size is at most 16KB and uses 14-bit pointers. 
    
A version of InnoDB built for one page size cannot use data files or
log files from a version built for a different page size.
[18 Dec 2009 10:27] Bugs System
Pushed into 5.1.41-ndb-7.1.0 (revid:jonas@mysql.com-20091218102229-64tk47xonu3dv6r6) (version source revid:jonas@mysql.com-20091218095730-26gwjidfsdw45dto) (merge vers: 5.1.41-ndb-7.1.0) (pib:15)
[18 Dec 2009 10:43] Bugs System
Pushed into 5.1.41-ndb-6.2.19 (revid:jonas@mysql.com-20091218100224-vtzr0fahhsuhjsmt) (version source revid:jonas@mysql.com-20091217101452-qwzyaig50w74xmye) (merge vers: 5.1.41-ndb-6.2.19) (pib:15)
[18 Dec 2009 10:59] Bugs System
Pushed into 5.1.41-ndb-6.3.31 (revid:jonas@mysql.com-20091218100616-75d9tek96o6ob6k0) (version source revid:jonas@mysql.com-20091217154335-290no45qdins5bwo) (merge vers: 5.1.41-ndb-6.3.31) (pib:15)
[18 Dec 2009 11:13] Bugs System
Pushed into 5.1.41-ndb-7.0.11 (revid:jonas@mysql.com-20091218101303-ga32mrnr15jsa606) (version source revid:jonas@mysql.com-20091218064304-ezreonykd9f4kelk) (merge vers: 5.1.41-ndb-7.0.11) (pib:15)
[5 May 2010 15:06] Bugs System
Pushed into 5.1.47 (revid:joro@sun.com-20100505145753-ivlt4hclbrjy8eye) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[6 May 2010 16:53] Paul DuBois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug.
Re-closing.
[28 May 2010 5:46] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100524190136-egaq7e8zgkwb9aqi) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (pib:16)
[28 May 2010 6:16] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100524190941-nuudpx60if25wsvx) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[28 May 2010 6:44] Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100524185725-c8k5q7v60i5nix3t) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[29 May 2010 23:07] Paul DuBois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug.
Re-closing.
[15 Jun 2010 8:22] Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100615080459-smuswd9ooeywcxuc) (version source revid:mmakela@bk-internal.mysql.com-20100415070122-1nxji8ym4mao13ao) (merge vers: 5.1.47) (pib:16)
[15 Jun 2010 8:40] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100615080558-cw01bzdqr1bdmmec) (version source revid:mmakela@bk-internal.mysql.com-20100415070122-1nxji8ym4mao13ao) (pib:16)
[17 Jun 2010 11:47] Bugs System
Pushed into 5.1.47-ndb-7.0.16 (revid:martin.skold@mysql.com-20100617114014-bva0dy24yyd67697) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 12:24] Bugs System
Pushed into 5.1.47-ndb-6.2.19 (revid:martin.skold@mysql.com-20100617115448-idrbic6gbki37h1c) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 13:12] Bugs System
Pushed into 5.1.47-ndb-6.3.35 (revid:martin.skold@mysql.com-20100617114611-61aqbb52j752y116) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)