Enable (already implemented?) snapshots of mirrors
PATCH 1/1 Enable (already implemented?) snapshots of mirrors
I just wanted to get a feel for where things were at WRT snapshots of mirrors. Pulling out the prevention check (patch provided below), things seem to work just fine. Is there something I am missing?
[root at bp-01 LVM2]# lvs -a
LV VG Attr LSize Origin Snap% Move Log Copy% Convert LogVol00 VolGroup00 -wi-ao 139.09g LogVol01 VolGroup00 -wi-ao 9.81g lv vg mwi-a- 500.00m lv_mlog 100.00 [lv_mimage_0] vg iwi-ao 500.00m [lv_mimage_1] vg iwi-ao 500.00m [lv_mlog] vg lwi-ao 4.00m
[root at bp-01 LVM2]# lvcreate -s vg/lv_mimage_0 -L 500M -n snap
Snapshots of mirror images is not supported
[root at bp-01 LVM2]# lvcreate -s vg/lv_mlog -L 500M -n snap
Snapshots of mirror logs is not supported
[root at bp-01 LVM2]# lvcreate -s vg/lv -L 500M -n snap
Logical volume "snap" created
[root at bp-01 LVM2]# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
LogVol00 VolGroup00 -wi-ao 139.09g
LogVol01 VolGroup00 -wi-ao 9.81g
lv vg mwi-a- 500.00m lv_mlog 0.00 snap vg swi-a- 500.00m lv 0.00
[root at bp-01 LVM2]# mkfs.ext3 /dev/vg/lv
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
128016 inodes, 512000 blocks
25600 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67633152
63 block groups
8192 blocks per group, 8192 fragments per group
2032 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: lvs done
This filesystem will be automatically checked every 22 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. [root at bp-01 LVM2]# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
LogVol00 VolGroup00 -wi-ao 139.09g
LogVol01 VolGroup00 -wi-ao 9.81g
lv vg mwi-a- 500.00m lv_mlog 0.00 snap vg swi-a- 500.00m lv 4.89
brassow
lib/metadata/lv_manip.c +6 -5
@@ -2990,11 +2990,12 @@ int lv_create_single(struct volume_group "supported yet");return 0 ; } -if (org->status &MIRROR_IMAGE || - org->status &MIRROR_LOG || - org->status &MIRRORED ) { -log_error ("Snapshots and mirrors may not yet " -"be mixed." ); +if ((org->status &MIRROR_IMAGE ) || + (org->status &MIRROR_LOG )) { +log_error ("Snapshots of mirror %ss " +"are not supported" , + (org->status &MIRROR_LOG ) ? +"log" :"image" );return 0 ; }
PATCH 1/1 Enable (already implemented?) snapshots of mirrors
Quoted 3 lines · Jon Brassow
I just wanted to get a feel for where things were at WRT snapshots of mirrors. Pulling out the prevention check (patch provided below), things seem to work just fine. Is there something I am missing?
Well the check was inserted because the code was untested.
All the newly-possible combinations of commands need to be tested before it can be removed, and other 'unsupported' messages can be placed where things don't work correctly.
(Basically you check through all the options of all the commands one-by-one and test every aspect which might behave differently in respect of snapshots of mirrors. This includes checking the dmeventd plugins as well as 'partial' VGs, and ensuring there are no ways of manipulating the 'in-use' mirror that conflict with the fact it is an origin, and ensuring display tools remain comprehensible.)
Alasdair
PATCH 1/1 Enable (already implemented?) snapshots of mirrors
Quoted 12 lines · Alasdair G Kergon
Quoted 3 lines · Jon Brassow
I just wanted to get a feel for where things were at WRT snapshots of mirrors. Pulling out the prevention check (patch provided below), things seem to work just fine. Is there something I am missing?
Well the check was inserted because the code was untested.
All the newly-possible combinations of commands need to be tested before
it can be removed, and other 'unsupported' messages can be placed where things don't work correctly.
Quoted 7 lines
(Basically you check through all the options of all the commands one-by-one and test every aspect which might behave differently in respect of snapshots of mirrors. This includes checking the dmeventd
plugins as well as 'partial' VGs, and ensuring there are no ways of manipulating the 'in-use' mirror that conflict with the fact it is an origin, and ensuring display tools remain comprehensible.)
Ok, I'll get things started. You can tell me if I miss anything.(?)
lvcreate:
+ snapshot of mirror
lvresize:
+ grow the mirror origin (but only if inactive)
+ grow the snapshot exception store
+ Warning message given when trying to shrink origin
+ able to shrink exception store (warning is given and asks to proceed)
lvchange:
+ '-an <origin>' deactivates origin and all snapshots
+ '-ay <origin>' activates origin and all snapshots
lvconvert:
+ Error message notifying you cannot convert an LV under a snapshot (this could be removed?)
dmeventd:
- since you can't convert an lv under a snapshot, you cannot repair a mirror when a device fails
So far, it seems like the 'dmeventd' issue must be fixed before a possible check-in.
brassow
PATCH 1/1 Enable (already implemented?) snapshots of mirrors
Quoted 6 lines · Jon Brassow
Quoted 3 lines · Alasdair G Kergon
(Basically you check through all the options of all the commands one-by-one and test every aspect which might behave differently in respect of snapshots of mirrors
Ok, I'll get things started. You can tell me if I miss anything.(?)
Well when I do this, I list all the commands (alphabetically) in the tools dir, and then run each in turn with -h to remind me of the complete functionality of the command, and test anything I think needs testing. (Most commands get eliminated very quickly of course, then you're normally just left with a small number of scenarios to set up and test.)
Alasdair