Bug #95252 innodb-data-file-path is mod by 4096MB
Submitted: 6 May 2019 5:42 Modified: 29 Jul 2019 9:08
Reporter: jia liu Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:8.0.15,8.0.16, 8.0.11 OS:Any
Assigned to: CPU Architecture:Any
Tags: ibdata;innodb-data-file-path;innodb_data_file_path

[6 May 2019 5:42] jia liu
Description:
when initialize a new instance with --innodb-data-file-path=ibdata1:4096M:autoextend, the ibdata file is 3MB,which is "impossable" size, it should 5MB at least. 
if the size set to 4224MB the ibdata file is 128MB, if the size set to 10240MB the ibdata file is 2GB.
So, I suspect that it is mod by 4GB, or it is an 32 bit integer problem.

The current workaround is set size less than 4096MB.
And it seems 5.7 and lower will not have this problem.

How to repeat:
The OS tested is "CentOS Linux release 7.5.1804 (Core)", but I don't think it matters.

I'm using with binary mysql-8.0.15/16-linux-glibc2.12-x86_64.tar.xz,  which is unzipped to /usr/local/,and linked like this:

lrwxrwxrwx   1 root root        46 May  6 12:05 mysql -> /usr/local/mysql-8.0.15-linux-glibc2.12-x86_64
drwxr-xr-x  10 root root      4096 May  6 13:23 mysql-8.0.15-linux-glibc2.12-x86_64
drwxr-xr-x  11 root root      4096 May  6 11:37 mysql-8.0.16-linux-glibc2.12-x86_64

the PATH is setted like this
export PATH=/usr/local/mysql/bin:$PATH

/etc/my.cnf  is empty

run this command:
rm -rf /usr/local/mysql/data/* ; mysqld  --initialize --innodb-data-file-path=ibdata1:4096M:autoextend ;ll /usr/local/mysql/data/ibdata1 -h

we can see the ibdata is 3MB
-rw-r----- 1 root root 3.0M May  6 13:30 /usr/local/mysql/data/ibdata1

then try this command:
rm -rf /usr/local/mysql/data/* ; mysqld  --initialize --innodb-data-file-path=ibdata1:4224M:autoextend ;ll /usr/local/mysql/data/ibdata1 -h

we can see the ibdata is 128MB
-rw-r----- 1 root root 128M May  6 13:33 /usr/local/mysql/data/ibdata1

finally, this command:
rm -rf /usr/local/mysql/data/* ; mysqld  --initialize --innodb-data-file-path=ibdata1:10240M:autoextend ;ll /usr/local/mysql/data/ibdata1 -h

we can see the ibdata is 2GB
-rw-r----- 1 root root 2.0G May  6 13:35 /usr/local/mysql/data/ibdata1
[6 May 2019 10:54] MySQL Verification Team
Hello!

Thank you for the report.

regards,
Umesh
[29 Jul 2019 9:08] Erlend Dahl
Fixed in 8.0.17 under the heading of

Bug#27538464 MORE THAN 2G SYSTEM TABLESPACE (IBDATA) IS NOT CREATED WHEN INITIALIZING