tar4ibd does not support innodb row_format=compressed

Bug #665210 reported by Andrew Garner on 2010-10-22
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Fix Released
Alexey Kopytov
Fix Released
Alexey Kopytov
Fix Released
Alexey Kopytov

Bug Description

Although xtrabackup directly supports compressed innodb tables, streaming support will fail with tar4ibd. This has been reported on the mailing list, but I didn't see an open bug report.

# tar4ibd -c test/data.ibd > /dev/null
The file 'test/data.ibd' may not be InnoDB datafile or may be corrupted.
tar_append_tree("test/data.ibd", "test/data.ibd"): Input/output error

I've linked a branch that extends the current "trunk" tar4ibd-libtar patch to support this feature.

Related branches

Andrew Garner (muzazzi) on 2010-10-22
summary: - tar4ibd does not support innodba row_format=compressed
+ tar4ibd does not support innodb row_format=compressed
description: updated
Vadim Tkachenko (vadim-tk) wrote :

Thank you for patch, we will review it

Changed in percona-xtrabackup:
status: New → Confirmed
importance: Undecided → High
Titi Ala'ilima (tigretigre) wrote :

Is there any update on when this might get rolled into a release? I have to decide whether to go with a custom-patched version or wait for a patched release.

Changed in percona-xtrabackup:
assignee: nobody → Valentine Gostev (core-longbow)
Valentine Gostev (longbow) wrote :

The suggested branch fails to build against innodb plugin.

tar4ibd built against xtradb from this branch does not fix the issue. For suggested fix I will set the status invalid and will file a separate bug for adding tar4ibd's support for compressed innodb tables.

Changed in percona-xtrabackup:
status: Confirmed → Invalid
Valentine Gostev (longbow) wrote :

Please let us know in which way you have built the fix from your branch?

Andrew Garner (muzazzi) wrote :

I just used the build scripts originally and I did not run into an issue. I'm merging with trunk and I will rebuild to verify.

Andrew Garner (muzazzi) wrote :

I see the build error against the innodb plugin with the original branch as it stands. This branch is quite old (originally submitted over 3 months ago) and this was simply a bug in xtrabackup's patch for the innodb plugin at the time. This branch only modifies the tar4ibd patch in order to support compressed tables so doesn't touch the patch against the plugin whatsoever.

If I do a simple merge with trunk this will work:

$ bzr merge ../percona-xtrabackup/
$ wget 'http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.53.tar.gz'
$ ./utils/build.sh plugin
$ echo $?

And the built tar4ibd reads a compressed table:
$ mysql -Bse "SHOW CREATE TABLE test.ztest\G"
*************************** 1. row ***************************
       Table: ztest
Create Table: CREATE TABLE `ztest` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `data` char(32) DEFAULT NULL,
  PRIMARY KEY (`id`)

$ sudo ./mysql-5.1.53/libtar-1.2.11/libtar/tar4ibd -c /var/lib/mysql/test/ztest.ibd | wc -c

But the 1.5 tar4ibd does not:
$ rpm -qf /usr/bin/tar4ibd
$ sudo /usr/bin/tar4ibd -c /var/lib/mysql/test/ztest.ibd | wc -c
The file '/var/lib/mysql/test/ztest.ibd' may not be InnoDB datafile or may be corrupted.
tar_append_tree("/var/lib/mysql/test/ztest.ibd", "/var/lib/mysql/test/ztest.ibd"): Input/output error

I pushed my merged branch up. I don't think this report is invalid at this point but simply testing was done against a pretty old branch of xtrabackup.

Changed in percona-xtrabackup:
status: Invalid → Incomplete
Changed in percona-xtrabackup:
status: Incomplete → Confirmed
Valentine Gostev (longbow) wrote :

Tried your steps both on ubuntu 10.04 and centos 5.5 (both x86_64):

Merged your branch with trunk, built against 5.1.53 (echo $? == 0), but tar4ibd still returns 255 on exit when trying with compressed tables.

root@dev302:~/xtrabackup_trunk# mysql -Bse "SHOW CREATE TABLE test.t3\G"
*************************** 1. row ***************************
       Table: t3
Create Table: CREATE TABLE `t3` (
  `a` varchar(20) DEFAULT NULL

root@dev302:~/xtrabackup_trunk# ./mysql-5.1.53/libtar-1.2.11/libtar/tar4ibd -c /var/lib/mysql/test/t3.ibd > out.tar
The file '/var/lib/mysql/test/t3.ibd' may not be InnoDB datafile or may be corrupted.
tar_append_tree("/var/lib/mysql/test/t3.ibd", "/var/lib/mysql/test/t3.ibd"): Input/output error
root@dev302:~/xtrabackup_trunk# echo $?

Could you please send me the details on environent you have tried a successful build?

Changed in percona-xtrabackup:
status: Confirmed → Incomplete
Andrew Garner (muzazzi) wrote :

This is caused by a missing zlib dependency. Right now the patch just falls back to treating a compressed block as corrupt when there's no zlib support compiled in. I'll make this a hard requirement in the libtar configure scripts.

Andrew Garner (muzazzi) wrote :

I added a check for zlib in the tar4ibd patch to make this more clear. I did a fresh checkout on ubuntu 9.10, rhel4 and rhel5 and built via the utils/build.sh script without issue and was able to run the resulting tar4ibd against various .ibd sources including compressed tables successfully and successfully failed against corrupt tables.

Titi Ala'ilima (tigretigre) wrote :

How does the pending removal of tar4ibd affect the resolution of this ticket? Are these (or related) fixes incorporated in the main binary now?

Vadim Tkachenko (vadim-tk) wrote :

Valentine, I set to New, as we need test case for this bug.

Changed in percona-xtrabackup:
status: Incomplete → New
milestone: none → 1.7
Valentine Gostev (longbow) wrote :

Working fine with tar4ibd from 1.5 package

Changed in percona-xtrabackup:
milestone: 1.7 → none
status: New → Invalid

xtrabackup 1.5 Not works for bug 625878. Pls remove duplicate status from this bug.

So, to be clear - the current state is that Andrew Gamer's submitted patch has been tested against 1.5 and works, however, it has not yet been incorporated into any release?

Vadim Tkachenko (vadim-tk) wrote :


No, we did nothing regarding this issue - it just works for us from binaries what we have.
I suspect it may be related if you have zlib installed on system or not.
We are going to check that.

OK, so no reason to have fear about using InnoDB compressed and xtrabackup?

Vadim Tkachenko (vadim-tk) wrote :


I do not think there is technical problem, it is mostly library linking issue.
We will sort it out.

Valentine Gostev (longbow) wrote :

Issue confirmed, branch with test case linked to this bug report

Changed in percona-xtrabackup:
status: Invalid → Triaged
assignee: Valentine Gostev (core-longbow) → Vadim Tkachenko (vadim-tk)
Stewart Smith (stewart) wrote :

Valentine, so we do in fact have a bug with compressed tables and xtrabackup?

Vadim, why exactly was merge rejected? Also, is it on your radar to fix up the patch? If not, I'll reassign.

Vadim Tkachenko (vadim-tk) wrote :


I think bug may exist in some cases, but it is mostly linking with lzib problem.
Please re-assign from me.

Stewart Smith (stewart) on 2011-05-20
Changed in percona-xtrabackup:
assignee: Vadim Tkachenko (vadim-tk) → nobody
Alexey Kopytov (akopytov) wrote :

tar4ibd still does not support compressed tables. Verified when creating a test case for bug #810269. I'm going to merge the proposed fix along with the fix for bug #810269.

Changed in percona-xtrabackup:
status: Triaged → In Progress
assignee: nobody → Alexey Kopytov (akopytov)
tags: added: cr i17342

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXB-288

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers