PDA

View Full Version : lvm snapshot snapshot name incorrect



DanTulovsky
July 25th, 2007, 06:04 PM
version 1.2 source

While doing an lvm snapshot, the script messes up the name of the snapshot and the tmp directory.

BackupSet1:backup:INFO: getting device details using command /usr/share/mysql-zrm/plugins/lvm-snapshot.pl --action get-vm-device-details --directory "/usr/local/mysql/data//world" --sname zrmIQG5px 2>/tmp/jVLTspNpUs
BackupSet1:backup:INFO: Locking tables and creating snapshot
BackupSet1:backup:INFO: "/usr/local/mysql/bin"/mysql --user="root" --socket="/tmp/mysql.sock" -e "flush tables with read lock;system (/usr/share/mysql-zrm/plugins/lvm-snapshot.pl --action create-snapshot --dev /dev/volgroup2/mysql --size 10M --sname zrmiL0OR7 >/tmp/zrmiL0OR7.log 2>&1 ); unlock tables;"

>>> here we create a snapshot called: zrmiL0OR7

BackupSet1:backup:INFO: Output of command: 'Locking tables and creating snapshot' is {
File descriptor 3 left open
Rounding up size to full physical extent 12.00 MB
Logical volume "zrmiL0OR7" created
}

>>> success!

BackupSet1:backup:INFO: Mounting snapshot
BackupSet1:backup:INFO: /usr/share/mysql-zrm/plugins/lvm-snapshot.pl --action mount --dev /dev/volgroup2/zrmk4p2B1 --directory /tmp/zrmiL0OR7 --fstype ext3
mount: special device /dev/volgroup2/zrmk4p2B1 does not exist

>>> but here we try to mount 'zrmk4p2B1'?? On /tmp/zrmiL0OR7? I think they need to be reversed?

mount of /dev/volgroup2/zrmk4p2B1 on /tmp/zrmiL0OR7 failed
BackupSet1:backup:WARNING: Snapshot failed
BackupSet1:backup:WARNING: Could not read file /tmp/jVLTspNpUs
BackupSet1:backup:WARNING: Unable to use snapshot

>>> And it fails... happens every time..

kkg
July 25th, 2007, 11:38 PM
version 1.2 source

While doing an lvm snapshot, the script messes up the name of the snapshot and the tmp directory.

BackupSet1:backup:INFO: getting device details using command /usr/share/mysql-zrm/plugins/lvm-snapshot.pl --action get-vm-device-details --directory "/usr/local/mysql/data//world" --sname zrmIQG5px 2>/tmp/jVLTspNpUs
BackupSet1:backup:INFO: Locking tables and creating snapshot
BackupSet1:backup:INFO: "/usr/local/mysql/bin"/mysql --user="root" --socket="/tmp/mysql.sock" -e "flush tables with read lock;system (/usr/share/mysql-zrm/plugins/lvm-snapshot.pl --action create-snapshot --dev /dev/volgroup2/mysql --size 10M --sname zrmiL0OR7 >/tmp/zrmiL0OR7.log 2>&1 ); unlock tables;"

>>> here we create a snapshot called: zrmiL0OR7

BackupSet1:backup:INFO: Output of command: 'Locking tables and creating snapshot' is {
File descriptor 3 left open
Rounding up size to full physical extent 12.00 MB
Logical volume "zrmiL0OR7" created
}

>>> success!

BackupSet1:backup:INFO: Mounting snapshot
BackupSet1:backup:INFO: /usr/share/mysql-zrm/plugins/lvm-snapshot.pl --action mount --dev /dev/volgroup2/zrmk4p2B1 --directory /tmp/zrmiL0OR7 --fstype ext3
mount: special device /dev/volgroup2/zrmk4p2B1 does not exist

>>> but here we try to mount 'zrmk4p2B1'?? On /tmp/zrmiL0OR7? I think they need to be reversed?

mount of /dev/volgroup2/zrmk4p2B1 on /tmp/zrmiL0OR7 failed
BackupSet1:backup:WARNING: Snapshot failed
BackupSet1:backup:WARNING: Could not read file /tmp/jVLTspNpUs
BackupSet1:backup:WARNING: Unable to use snapshot

>>> And it fails... happens every time..


I am unable to reproduce this. Could you attach the full verbose log? Is all of the data on a single volume or are they distributed across multiple volumes?

The following is corresponding set of statements I get when I run ZRM

Fri Jun 22 03:07:17 2007: BackupSet1:backup:INFO: Locking tables and creating snapshot
Fri Jun 22 03:07:17 2007: BackupSet1:backup:INFO: mysql -e "flush tables with read lock;system (/usr/share/mysql-zrm/plugins/lvm-snapshot.pl --action create-snapshot --dev /dev/system/tp --size 10M --sname zrmdT9zJq >/tmp/zrmdT9zJq.log 2>&1 ); unlock tables;"
Fri Jun 22 03:07:18 2007: BackupSet1:backup:INFO: Output of command: 'Locking tables and creating snapshot' is {
File descriptor 3 left open
Rounding up size to full physical extent 12.00 MB
Logical volume "zrmdT9zJq" created
}
Fri Jun 22 03:07:18 2007: BackupSet1:backup:INFO: Mounting snapshot
Fri Jun 22 03:07:18 2007: BackupSet1:backup:INFO: /usr/share/mysql-zrm/plugins/lvm-snapshot.pl --action mount --dev /dev/system/zrmdT9zJq --directory /tmp/zrmdT9zJq --fstype xfs
Fri Jun 22 03:07:19 2007: BackupSet1:backup:INFO: Copying innodb file /var/log/innodb_logs/ib_logfile*
Fri Jun 22 03:07:19 2007: BackupSet1:backup:INFO: cp -p "/tmp/zrmdT9zJq//innodb_logs/"/ib_logfile* "/var/lib/mysql-zrm/BackupSet1/20070622030709//var/log/innodb_logs"
Fri Jun 22 03:07:20 2007: BackupSet1:backup:INFO: Copying innodb file /var/log/innodb/ibdata1
Fri Jun 22 03:07:20 2007: BackupSet1:backup:INFO: cp -p "/tmp/zrmdT9zJq//innodb"/ibdata1 "/var/lib/mysql-zrm/BackupSet1/20070622030709//var/log/innodb"
Fri Jun 22 03:07:21 2007: BackupSet1:backup:INFO: Copying innodb file /var/log/innodb/abc

--kkg

DanTulovsky
July 26th, 2007, 04:18 PM
All the data is in the same volume. Full log attached. Here's lvs and vgs output as well.

All the data is in the mysql lv.

root@klukva [20:15:00] ../backups/mysql/BackupSet1/20070725211946 $ vgs
VG #PV #LV #SN Attr VSize VFree
volgroup1 1 2 0 wz--n- 12.49G 0
volgroup2 1 2 0 wz--n- 31.87G 1.37G

root@klukva [20:15:04] ../backups/mysql/BackupSet1/20070725211946 $ lvs
LV VG Attr LSize Origin Snap% Move Log Copy%
root volgroup1 -wi-ao 11.95G
swap_1 volgroup1 -wi-ao 556.00M
export volgroup2 -wi-ao 22.00G
mysql volgroup2 -wi-ao 8.50G

schedule:INFO: ZRM for MySQL Community Edition - version 1.2

USAGE:
/usr/bin/mysql-zrm-scheduler

kkg
July 29th, 2007, 11:21 PM
All the data is in the same volume. Full log attached. Here's lvs and vgs output as well.

All the data is in the mysql lv.

root@klukva [20:15:00] ../backups/mysql/BackupSet1/20070725211946 $ vgs
VG #PV #LV #SN Attr VSize VFree
volgroup1 1 2 0 wz--n- 12.49G 0
volgroup2 1 2 0 wz--n- 31.87G 1.37G

root@klukva [20:15:04] ../backups/mysql/BackupSet1/20070725211946 $ lvs
LV VG Attr LSize Origin Snap% Move Log Copy%
root volgroup1 -wi-ao 11.95G
swap_1 volgroup1 -wi-ao 556.00M
export volgroup2 -wi-ao 22.00G
mysql volgroup2 -wi-ao 8.50G

schedule:INFO: ZRM for MySQL Community Edition - version 1.2

USAGE:
/usr/bin/mysql-zrm-scheduler


Yes I was able to finally reproduce the problem. There is a bug in LVM snapshot when all databases are on one single LVM volume.
The code has been fixed in the internal tree. The next release will have this bug fix.

Thanks for the help in finding the bug and providing the verbose log messages.

--kkg

azzegai
August 9th, 2007, 03:28 PM
Is there a patch or work-around I can use in the meantime?

paddy
August 9th, 2007, 04:45 PM
Is there a patch or work-around I can use in the meantime?

A patch will be available next week.

Paddy

azzegai
August 10th, 2007, 01:39 AM
Thanks, will wait for it.

paddy
August 14th, 2007, 04:16 PM
A patch will be available next week.

Paddy

Please use test version of community release 1.2.1 available at http://www.zmanda.com/community-builds.php

If there are any issues, please let us know here.

Paddy

azzegai
August 15th, 2007, 12:07 AM
Excellent, thank you very much Paddy.