On 07/15/2014 12:47 PM, Nathan Scott wrote:
Hi Mark,
With Daves quick fixes, looks like tomorrow is still good for 3.9.7
- so I've cherry-picked the Makepkgs fix, & reckon the device mapper
changes (and RHEL5 fix & QA) are good 3.9.8 material - does that all
sound OK? I'll have some dmcache code too by then, so we can have a
release theme. :)
ok sounds good
----- Original Message -----
Also, re: RH BZ https://bugzilla.redhat.com/show_bug.cgi?id=1109539
("hinv.map.lvname instance IDs are not persistent"). I think the
fix is to use the persistent dm name as the instance domain, with
the metric value being the current dm-[0-9]* name (the current
implementation has it the other way around). Since I've now done
this with the new hinv.map.dmname metric, can hinv.map.lvname be
deprecated? Or will we just keep it? Anything depend on it?
Yep, Stan's making use of it in pmatop so the existing indom will need
to be maintained. And also improved, if you could - from your commit
log description, a separate instance domain ID for your new code will
be needed (you probably did that already) but since the old names are
"dm-N" (where N is just an int), the internal instance ID could simply
be made to match "N", for more persistent naming right? This wouldn't
survive a reboot, but it'd at least persist through addition/removal
of new/old DM devices during the lifetime of pmcd. IOW, no pmdaCache*
use needed here - should be a simple extension to the way the indom is
updated now (same pmdaIndom data structure, just pushing that N into
the internal ID via it_set->i_inst ... thoughts?).
Wont work (or I am confused). dm-N gets reused if it is deleted and
then a new volume is created (with or without a reboot). Here's an
example using snapshots:
starting with dm-0, dm-1, dm-2, dm-3 and dm-4
create snap1 (creates dm-5, dm-6 and dm-7)
create snap2 (creates dm-8 and dm-9) ... so far so good
remove snap1 (deletes dm-5)
create snap3 (re-creates dm-5 and renames a few others). Fail.
If snap3 created dm-10 and didn't rename any existing then it'd
be OK but it doesn't. The only really viable solution is to use
the persistent names to populate the instance domain. The dm-*
names should be metric values (i.e. the *current* mapping, which
may change).
Here's the evidence :
[root@ocean ~]# lvs
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert
home rootvg -wi-ao---- 97.66g
root rootvg -wi-ao---- 48.83g
swap rootvg -wi-ao---- 5.88g
backup virtvg -wi-ao---- 850.00g
test virtvg -wi-a----- 100.00g
[root@ocean ~]# ls -l /dev/mapper
total 0
crw-------. 1 root root 10, 236 Jul 14 20:15 control
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 rootvg-home -> ../dm-4
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 rootvg-root -> ../dm-1
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 rootvg-swap -> ../dm-0
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 virtvg-backup -> ../dm-2
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 virtvg-test -> ../dm-3
[root@ocean ~]# lvcreate -L1M -n snap1 -s virtvg/backup
Rounding up size to full physical extent 4.00 MiB
Logical volume "snap1" created
[root@ocean ~]# ls -l /dev/mapper
total 0
crw-------. 1 root root 10, 236 Jul 14 20:15 control
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 rootvg-home -> ../dm-4
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 rootvg-root -> ../dm-1
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 rootvg-swap -> ../dm-0
lrwxrwxrwx. 1 root root 7 Jul 15 13:07 virtvg-backup -> ../dm-2
lrwxrwxrwx. 1 root root 7 Jul 15 13:07 virtvg-backup-real -> ../dm-6
lrwxrwxrwx. 1 root root 7 Jul 15 13:07 virtvg-snap1 -> ../dm-5
lrwxrwxrwx. 1 root root 7 Jul 15 13:07 virtvg-snap1-cow -> ../dm-7
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 virtvg-test -> ../dm-3
[root@ocean ~]# lvcreate -L1M -n snap2 -s virtvg/backup
Rounding up size to full physical extent 4.00 MiB
Logical volume "snap2" created
[root@ocean ~]# ls -l /dev/mapper
total 0
crw-------. 1 root root 10, 236 Jul 14 20:15 control
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 rootvg-home -> ../dm-4
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 rootvg-root -> ../dm-1
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 rootvg-swap -> ../dm-0
lrwxrwxrwx. 1 root root 7 Jul 15 13:07 virtvg-backup -> ../dm-2
lrwxrwxrwx. 1 root root 7 Jul 15 13:07 virtvg-backup-real -> ../dm-6
lrwxrwxrwx. 1 root root 7 Jul 15 13:07 virtvg-snap1 -> ../dm-5
lrwxrwxrwx. 1 root root 7 Jul 15 13:07 virtvg-snap1-cow -> ../dm-7
lrwxrwxrwx. 1 root root 7 Jul 15 13:07 virtvg-snap2 -> ../dm-8
lrwxrwxrwx. 1 root root 7 Jul 15 13:07 virtvg-snap2-cow -> ../dm-9
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 virtvg-test -> ../dm-3
[root@ocean ~]# lvremove /dev/mapper/virtvg-snap1
Do you really want to remove active logical volume snap1? [y/n]: y
Logical volume "snap1" successfully removed
[root@ocean ~]# ls -l /dev/mapper
total 0
crw-------. 1 root root 10, 236 Jul 14 20:15 control
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 rootvg-home -> ../dm-4
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 rootvg-root -> ../dm-1
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 rootvg-swap -> ../dm-0
lrwxrwxrwx. 1 root root 7 Jul 15 13:08 virtvg-backup -> ../dm-2
lrwxrwxrwx. 1 root root 7 Jul 15 13:08 virtvg-backup-real -> ../dm-6
lrwxrwxrwx. 1 root root 7 Jul 15 13:07 virtvg-snap1-cow -> ../dm-7
lrwxrwxrwx. 1 root root 7 Jul 15 13:08 virtvg-snap2 -> ../dm-8
lrwxrwxrwx. 1 root root 7 Jul 15 13:08 virtvg-snap2-cow -> ../dm-9
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 virtvg-test -> ../dm-3
[root@ocean ~]# lvcreate -L1M -n snap3 -s virtvg/backup
Rounding up size to full physical extent 4.00 MiB
Logical volume "snap3" created
[root@ocean ~]# ls -l /dev/mapper
total 0
crw-------. 1 root root 10, 236 Jul 14 20:15 control
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 rootvg-home -> ../dm-4
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 rootvg-root -> ../dm-1
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 rootvg-swap -> ../dm-0
lrwxrwxrwx. 1 root root 7 Jul 15 13:09 virtvg-backup -> ../dm-2
lrwxrwxrwx. 1 root root 7 Jul 15 13:09 virtvg-backup-real -> ../dm-6
lrwxrwxrwx. 1 root root 7 Jul 15 13:07 virtvg-snap1-cow -> ../dm-7
lrwxrwxrwx. 1 root root 7 Jul 15 13:09 virtvg-snap2 -> ../dm-8
lrwxrwxrwx. 1 root root 7 Jul 15 13:09 virtvg-snap2-cow -> ../dm-9
lrwxrwxrwx. 1 root root 7 Jul 15 13:09 virtvg-snap3 -> ../dm-5
lrwxrwxrwx. 1 root root 7 Jul 15 13:09 virtvg-snap3-cow -> ../dm-7
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 virtvg-test -> ../dm-3
|