cleanup continues even on tar failure

Bug #264089 reported by Matthew
2
Affects Status Importance Assigned to Milestone
mylvmbackup
Fix Released
Wishlist
Lenz Grimmer

Bug Description

I haven't actually encountered this yet, but just by reading over the code I can see it may happen. The function do_backup_tar() doesn't exit/die on failure. It simply says 'unable to tar' returns back to the main() which then continues to cleanup().

So the possibility exists that a tar/rsync may fail and then cleaup() fires off, deleting everything including the snapshot.

I realized this when looking for a hook that will run after 'successful' backup. I have a script I'd like to run that purges all of the binlog's (we don't need them anymore since we just took a full backup) but only purge them on successful tar'ing of the snapshot.

Related branches

Revision history for this message
Lenz Grimmer (lenzgr) wrote :

Hi Matthew, you are right. Currently it would log the failure and proceed with cleaning up the snapshot (as keeping the snapshot around may have a performance impact). What is your suggestion? Should it abort and leave it up to the admin to sort out the problem instead?

Revision history for this message
Matthew (mboehm) wrote :

It certainly be able to notify the admin to take action. (see the blueprint I added https://blueprints.launchpad.net/mylvmbackup/+spec/mylvmbackup-notification-hooks)

Now that I think about it, removing the snapshot isn't that big of a deal. You still have all the files intact and the DB is still running; you just had a failed backup, that's all.

I would simply add in the ability to call a hook on success and failure of a backup. That way at least "someone" knows about it.

Revision history for this message
Lenz Grimmer (lenzgr) wrote :

The option to add hooks sounds reasonable. Working on it.

Changed in mylvmbackup:
assignee: nobody → lenzgr
status: New → In Progress
importance: Undecided → Wishlist
Revision history for this message
Lenz Grimmer (lenzgr) wrote :

A fix for that (adding two new hooks "backupsuccess" and "backupfailure" has now been commited to the trunk. Please test!

Changed in mylvmbackup:
status: In Progress → Fix Committed
Revision history for this message
Lenz Grimmer (lenzgr) wrote :

Added two new hooks for backupsuccess and backupfailure to release 0.10

Changed in mylvmbackup:
status: Fix Committed → Fix Released
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.