~longbow/kewpie/xb_manager

Viewing all changes in revision 130.

  • Committer: Valentine Gostev
  • Date: 2012-06-11 20:26:48 UTC
  • Revision ID: core.longbow@gmail.com-20120611202648-y3jz8qylb60oh4h5
Introducing alpha version of xtrabackup management library for kewpie.

Service functions added:
clean_dir - for wiping out datadir contents before copy-back
alloc_dir - function to find an appropriate name for file or dir
execute_cmd - copied from old xtrabackup methods. Uses Popen

Methods added:
backup_full(server) - method performs a full backup of a given server,
returns a backup object
prepare(backup,rollback=True/False) - prepares a given backup. rollback
flag defines wether we rollback uncommited trxs or not
returns retcode and output from execute_cmd()
restore(backup,server) - restores backup to a given server.
Server stops, then clean_dir() is called to wipe out datadir contents,
then copy-back is perform and server starts against restored data.
returns retcode and output from execute_cmd() or a custom retcode and
output of backup was in wrong state (not usable for restore)

Backup state:
Backup is an object, featuring status attr (backup.status) which is a
literal string. Allowed statuses (will be extended later):
'full-backup'
'prepared'
'prepared-redo-only'
'prepare-failed'
Status indicates the current state of backup. For example restore method
will be executed only when status is 'prepared' or 'prepared-redo-only'
and will fail in all other cases

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: