summaryrefslogtreecommitdiff
path: root/test/shell/lvchange-raid.sh
diff options
context:
space:
mode:
authorJonathan Brassow <jbrassow@redhat.com>2013-09-11 15:58:44 -0500
committerJonathan Brassow <jbrassow@redhat.com>2013-09-11 15:58:44 -0500
commit82228acfc95fa4dbe9acca2d3bfc5a89087fd5e4 (patch)
tree6d42f1f477ea593f04731d4a3c849bfc9499c282 /test/shell/lvchange-raid.sh
parent1f4bc637b4b71ed7a66ea4e7836c51b529bef92a (diff)
downloadlvm2-82228acfc95fa4dbe9acca2d3bfc5a89087fd5e4.tar.gz
Mirror/Thin: Disallow thinpools on mirror logical volumes
The same corner cases that exist for snapshots on mirrors exist for any logical volume layered on top of mirror. (One example is when a mirror image fails and a non-repair LVM command is the first to detect it via label reading. In this case, the LVM command will hang and prevent the necessary LVM repair command from running.) When a better alternative exists, it makes no sense to allow a new target to stack on mirrors as a new feature. Since, RAID is now capable of running EX in a cluster and thin is not active-active aware, it makes sense to pair these two rather than mirror+thinpool. As further background, here are some additional comments that I made when addressing a bug related to mirror+thinpool: (https://bugzilla.redhat.com/show_bug.cgi?id=919604#c9) I am going to disallow thin* on top of mirror logical volumes. Users will have to use the "raid1" segment type if they want this. This bug has come down to a choice between: 1) Disallowing thin-LVs from being used as PVs. 2) Disallowing thinpools on top of mirrors. The problem is that the code in dev_manager.c:device_is_usable() is unable to tell whether there is a mirror device lower in the stack from the device being checked. Pretty much anything layered on top of a mirror will suffer from this problem. (Snapshots are a good example of this; and option #1 above has been chosen to deal with them. This can also be seen in dev_manager.c:device_is_usable().) When a mirror failure occurs, the kernel blocks all I/O to it. If there is an LVM command that comes along to do the repair (or a different operation that requires label reading), it would normally avoid the mirror when it sees that it is blocked. However, if there is a snapshot or a thin-LV that is on a mirror, the above code will not detect the mirror underneath and will issue label reading I/O. This causes the command to hang. Choosing #1 would mean that thin-LVs could never be used as PVs - even if they are stacked on something other than mirrors. Choosing #2 means that thinpools can never be placed on mirrors. This is probably better than we think, since it is preferred that people use the "raid1" segment type in the first place. However, RAID* cannot currently be used in a cluster volume group - even in EX-only mode. Thus, a complete solution for option #2 must include the ability to activate RAID logical volumes (and perform RAID operations) in a cluster volume group. I've already begun working on this.
Diffstat (limited to 'test/shell/lvchange-raid.sh')
-rw-r--r--test/shell/lvchange-raid.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/shell/lvchange-raid.sh b/test/shell/lvchange-raid.sh
index babe7262d..f1b8d7270 100644
--- a/test/shell/lvchange-raid.sh
+++ b/test/shell/lvchange-raid.sh
@@ -285,6 +285,12 @@ run_checks() {
run_recovery_rate_check $1 $2
elif [ 'thinpool_data' == $3 ]; then
aux target_at_least dm-thin-pool 1 8 0 || return 0
+
+ # RAID works EX in cluster
+ # thinpool works EX in cluster
+ # but they don't work together in a cluster yet
+ # (nor does thinpool+mirror work in a cluster yet)
+ test -e LOCAL_CLVMD && return 0
printf "#\n#\n# run_checks: RAID as thinpool data\n#\n#\n"
# Hey, specifying devices for thin allocation doesn't work
@@ -300,6 +306,7 @@ run_checks() {
run_recovery_rate_check $1 $2
elif [ 'thinpool_meta' == $3 ]; then
aux target_at_least dm-thin-pool 1 8 0 || return 0
+ test -e LOCAL_CLVMD && return 0
printf "#\n#\n# run_checks: RAID as thinpool metadata\n#\n#\n"
lvrename $1/$2 ${2}_meta