Comment 42 for bug 1969247

Revision history for this message
Michael Wood (mwood) wrote :

@lucaskanashiro

> However, the default of innodb_page_size is 16kb
> (https://dev.mysql.com/doc/refman/8.0/en/server-status-variables.html#statvar_Innodb_page_size),
> and 1712128/16 = 107008. Did you change the innodb_page_size global
> value by any chance? If you can share your configuration it might be
> helpful.

It's 16kB, not 16B :)

1712128/16384 = 104.5

I have a similar problem. I do not have the InnoDB page size specified in my MySQL config:

2022-08-02T04:25:16.296624Z 1 [ERROR] [MY-012962] [InnoDB] The redo log file ./#innodb_redo/#ib_redo6 size 2908160 is not a multiple of innodb_page_size

2908160/16384 = 177.5

The following Stack Overflow answer has a redo size of 23289856.
23289856/16384 = 1421.5

https://stackoverflow.com/a/73200473/495319

It is suspicious to me that all three of these examples are off by exactly 8k.

@xnox:

> Instead, fallocate(2) space preallocation only checks that sufficient
> space is currently available in the pool or the user's project quota
> allocation, and then creates a sparse file of the requested size.

But it doesn't create a sparse file.

If I create a normal, non-sparse file and a sparse file and then create a third file using fallocate I get the following:

$ dd if=/dev/urandom of=not-sparse bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 1.51608 s, 69.2 MB/s
$ dd if=/dev/urandom of=sparse bs=1M seek=100 count=0
0+0 records in
0+0 records out
0 bytes copied, 0.000245428 s, 0.0 kB/s
$ touch fallocated-file; fallocate -z -l 100M fallocated-file
$ ls -lsh not-sparse sparse fallocated-file
1.0K -rw-rw-r-- 1 michael michael 0 2022-08-02 09:30 fallocated-file
101M -rw-rw-r-- 1 michael michael 100M 2022-08-02 08:54 not-sparse
1.0K -rw-rw-r-- 1 michael michael 100M 2022-08-02 08:54 sparse

As you can see, the "not-sparse" file is 100MB, and it's taking up about 100MB on disk (not sure why it's 101MB, but it's clearly not sparse). The "sparse" file is also 100MB, but it is only taking up 1KB on disk.

On the other hand, the "fallocated-file" is zero size.