mysql-lvm does not handle invalid snapshot names gracefully

Bug #1117683 reported by Andrew Garner
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
holland-backup
Fix Committed
High
Andrew Garner

Bug Description

With a misconfiguration of the sort:

snapshot-name = /tmp/foo

Where snapshot-name is set rather than snapshot-mountpoint, lvcreate will still succeed but lvm2 will set the snapshot name to $(basename ${snapshot_name}). E.g. ${volume_group}/foo in this case. However, mysql-lvm attempts to verify the snapshot was created by looking up ${volume_group}/${snapshot_name} = ${volume_group}/tmp/foo which will never exist as '/' is never allowed in a snapshot name.

Right now, mysql-lvm is failing to catch the exception the volume API is raising when the snapshot cannot be found and this leads to a messy "uncaught exception" error. At the very least this should be caught and an appropriate error output and even better, the bad snapshot name should error out far before we get to this point.

LVM2 documents the valid snapshot names as:

VALID NAMES
       The following characters are valid for VG and LV names: a-z A-Z 0-9 + _ . -

       VG and LV names cannot begin with a hyphen. There are also various reserved names that are used internally by lvm that can not be used as LV or VG names. A VG cannot be called anything that exists in /dev/
       at the time of creation, nor can it be called ’.’ or ’..’. A LV cannot be called ’.’ ’..’ ’snapshot’ or ’pvmove’. The LV name may also not contain the strings ’_mlog’ or ’_mimage’

Andrew Garner (muzazzi)
Changed in holland-backup:
milestone: none → 1.0.12
Andrew Garner (muzazzi)
Changed in holland-backup:
importance: Undecided → High
Revision history for this message
Andrew Garner (muzazzi) wrote :
Andrew Garner (muzazzi)
Changed in holland-backup:
status: New → Fix Committed
assignee: nobody → Andrew Garner (muzazzi)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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