tar4ibd does not support innodb row_format=compressed

Bug #665210 reported by Andrew Garner
46
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Fix Released
High
Alexey Kopytov
1.6
Fix Released
High
Alexey Kopytov
2.0
Fix Released
High
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.

Tags: cr i17342

Related branches

Andrew Garner (muzazzi)
summary: - tar4ibd does not support innodba row_format=compressed
+ tar4ibd does not support innodb row_format=compressed
description: updated
Revision history for this message
Vadim Tkachenko (vadim-tk) wrote :

Thank you for patch, we will review it

Changed in percona-xtrabackup:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
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)
Revision history for this message
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
Revision history for this message
Valentine Gostev (longbow) wrote :

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

Revision history for this message
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.

Revision history for this message
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 $?
0

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`)
) ENGINE=InnoDB AUTO_INCREMENT=4652971 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED

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

But the 1.5 tar4ibd does not:
$ rpm -qf /usr/bin/tar4ibd
xtrabackup-1.5-9.rhel5.x86_64
$ 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
512

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
Revision history for this message
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
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED

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 $?
255
root@dev302:~/xtrabackup_trunk#

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

Changed in percona-xtrabackup:
status: Confirmed → Incomplete
Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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?

Revision history for this message
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
Revision history for this message
Valentine Gostev (longbow) wrote :

Working fine with tar4ibd from 1.5 package

Changed in percona-xtrabackup:
milestone: 1.7 → none
status: New → Invalid
Revision history for this message
Andrew Sitnikov (sitnikov-gmail) wrote :

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

Revision history for this message
Lachlan Mulcahy (lachlan-mulcahy) wrote :

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?

Revision history for this message
Vadim Tkachenko (vadim-tk) wrote :

Lachlan,

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.

Revision history for this message
Lachlan Mulcahy (lachlan-mulcahy) wrote :

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

Revision history for this message
Vadim Tkachenko (vadim-tk) wrote :

Lachlan,

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

Revision history for this message
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)
Revision history for this message
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.

Revision history for this message
Vadim Tkachenko (vadim-tk) wrote :

Stewart,

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

Stewart Smith (stewart)
Changed in percona-xtrabackup:
assignee: Vadim Tkachenko (vadim-tk) → nobody
Revision history for this message
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
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

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  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.