Code review comment for lp:~a.skwar/mylvmbackup/zfs

Revision history for this message
Alexander Skwar (a.skwar) wrote :

Hi.

Let me answer your questions by paragraph.

a) Sure, a full backup should be done. But as of right now, there's no way of finding out where the binlog and such are stored. For us, there is no "root" mysql dir. Here, the databases are at /data/mysql/$dbname and datadir=/data/mysql. You cannot do a backup of /data/mysql/.., as that would include non-mysql stuff.

b) It needs to be a % value, because how would you specify the size for all the different logical volumes holding mysql data that you might have? Just assume that you have more than 1 LV (eg. one for every database, or something like that). That's actually the most important change in the branch - it changes the logic so, that installations spanning multiple filesystems would work. Cf. https://blueprints.launchpad.net/mylvmbackup/+spec/mylvmbackup-multiple-fs

c) lines 848-859:

848 # Loop over all the directories and create snapshots
849 foreach my $dir (@dir_list) {
850 # Get the filesystem information (ie. name and type) for the current $dir.
851 my %fsinfo = fs_info($dir);
852 # Do we have a ZFS?
853 if ( $fsinfo{"type"} == "zfs" )
854 {
855 $retval += __create_zfs_snapshot($fsinfo{"name"});
856 } else {
857 $retval += __create_lvm_snapshot(lvm_info($dir));
858 }
859 }

In @dir_list, the list of all the directories holding mysql stuff is stored; eg. /data/mysql, /data/mysql/Wiki. In line 849, I begin to loop over that array.

In line 851, I call fs_info(). This returns the name of the filesystem where the directory is stored on and also the type of the filesystem. Ie. %fsinfo = fs_info("/data/mysql"); Then the following would be true:

  $fsinfo{"type"} => "zfs" (or maybe "ext3", "xfs" or whatever)
  $fsinfo{"name"} => "data/mysql" (or "/dev/mapper/data--bases-mysql--base" or "/dev/dbs/MySQL_Base")

In 855 or 857 (depending on ZFS: yes/no), I create a snapshot of the filesystem. In 857, I call lvm_info, passing along the $dir (eg. "/data/mysql") and lvm_info would return the "LVM information" (ie. name of volume group and name of logical volume). See lines 1222ff.

d) No, with LVM there might also be more than 1 snapshot, maybe. Even with LVM it's very much possible to have many logical volumes. The assumption that there's just one snapshot lv (or source lv) is very much disturbing and also not what might be there on the system of the user.

« Back to merge proposal