.ibd files growing when running --apply-log

Asked by Ian Altgilbers

When I try to use innobackupex to restore a backup, my data files grow by a large factor. This growth happens when I use innobackupex --apply-log. I took a look at the xtrabackup source and found that in:
there is a call to :

In that function, there is this snippet starting at line 4000:
 for (i = 0; i < srv_n_data_files; i++) {
  srv_data_file_sizes[i] = srv_data_file_sizes[i]
     * ((1024 * 1024) / UNIV_PAGE_SIZE);

This looks to be setting file sizes to the current number of blocks * 64 (assuming UNIV_PAGE_SIZE = 16384). I've seen tables that were ~16MB grow to over 500MB when restored.

Am I doing something wrong? Or is this a bug?

Question information

English Edit question
Percona XtraBackup moved to https://jira.percona.com/projects/PXB Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Alexey Kopytov (akopytov) said :

No, that doesn't look as a known problem. Are there any unusual messages on --apply-log? Is there any reliable way to reproduce the problem?

Revision history for this message
Ian Altgilbers (ian-altgilbers) said :

I can reproduce the problem readily. I'm using a RHEL5 vm with these MySQL packages:

mysql55.i386 5.5.28-2.ius.el5 installed
mysql55-devel.i386 5.5.28-2.ius.el5 installed
mysql55-libs.i386 5.5.28-2.ius.el5 installed
mysql55-server.i386 5.5.28-2.ius.el5 installed
mysqlclient15.i386 5.0.92-3.ius.el5 installed

1. Shutdown mysqld and verify my.cnf is using innodb_file_per_table
2. Clear out mysql data directory (/var/lib/mysql)
3. Start up mysqld to get initial empty DB
4. Create dummy database with one table.
5. "innobackupex /tmp" to create a backup
6. verify file size of .ibd file for empty table in backup (~100Kb on my system)
7. "innobackupex --apply-log /tmp/<backed-up-directory>"
8. verify file size of .ibd file is now minimum of 1MB

I see nothing unusual in the output of --apply-log... Here is a terminal session showing what I see:


Revision history for this message
Alexey Kopytov (akopytov) said :

Thanks. I misunderstood the original description and thought that datafiles grew to large sizes. But now that you have mentioned 1MB, I recalled bug #950334.

Which indeed results in much larger disk space in case of huge numbers of tables.

I'm raising the priority of that bug and we'll try to fix it in the next XB release (2.0.6), depending on our load.

Can you help with this problem?

Provide an answer of your own, or ask Ian Altgilbers for more information if necessary.

To post a message you must log in.