mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Revert "tests: Remove unsupported mirrored mirrorlog"
Incorrect cherry pick from another branch.
This reverts commit 07fc4866f0
.
This commit is contained in:
parent
88153c7c0a
commit
93c7bca08f
@ -122,11 +122,15 @@ test_lvconvert() {
|
|||||||
aux prepare_vg 5 5
|
aux prepare_vg 5 5
|
||||||
get_devs
|
get_devs
|
||||||
|
|
||||||
|
MIRRORED="mirrored"
|
||||||
|
# FIXME: Cluster is not supporting exlusive activation of mirrored log
|
||||||
|
test -e LOCAL_CLVMD && MIRRORED=
|
||||||
|
|
||||||
test_many() {
|
test_many() {
|
||||||
i=$1
|
i=$1
|
||||||
for j in $(seq 0 3); do
|
for j in $(seq 0 3); do
|
||||||
for k in core disk; do
|
for k in core disk $MIRRORED; do
|
||||||
for l in core disk; do
|
for l in core disk $MIRRORED; do
|
||||||
if test "$i" -eq "$j" && test "$k" = "$l"; then continue; fi
|
if test "$i" -eq "$j" && test "$k" = "$l"; then continue; fi
|
||||||
: ----------------------------------------------------
|
: ----------------------------------------------------
|
||||||
: "Testing mirror conversion -m$i/$k -> -m$j/$l"
|
: "Testing mirror conversion -m$i/$k -> -m$j/$l"
|
||||||
|
@ -243,6 +243,18 @@ not lvconvert --type mirror -m1 --corelog --stripes 2 $vg/$lv1
|
|||||||
lvremove -ff $vg
|
lvremove -ff $vg
|
||||||
|
|
||||||
|
|
||||||
|
# Linear to mirror with mirrored log using --alloc anywhere
|
||||||
|
lvcreate -aey -l2 -n $lv1 $vg "$dev1"
|
||||||
|
if test -e LOCAL_CLVMD; then
|
||||||
|
# This is not supposed to work in cluster
|
||||||
|
not lvconvert --type mirror -m +1 --mirrorlog mirrored --alloc anywhere $vg/$lv1 "$dev1" "$dev2"
|
||||||
|
else
|
||||||
|
lvconvert --type mirror -m +1 --mirrorlog mirrored --alloc anywhere $vg/$lv1 "$dev1" "$dev2"
|
||||||
|
check mirror $vg $lv1
|
||||||
|
fi
|
||||||
|
lvremove -ff $vg
|
||||||
|
|
||||||
|
|
||||||
if test -e LOCAL_CLVMD; then
|
if test -e LOCAL_CLVMD; then
|
||||||
: # FIXME - cases which needs to be fixed to work in cluster
|
: # FIXME - cases which needs to be fixed to work in cluster
|
||||||
else
|
else
|
||||||
|
@ -71,3 +71,33 @@ lvconvert -y --repair $vg/mirror2
|
|||||||
check mirror $vg mirror2
|
check mirror $vg mirror2
|
||||||
vgs $vg
|
vgs $vg
|
||||||
vgremove -ff $vg
|
vgremove -ff $vg
|
||||||
|
|
||||||
|
if aux kernel_at_least 3 0 0; then
|
||||||
|
# 2-way, mirrored log
|
||||||
|
# Double log failure, full replace
|
||||||
|
vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3" "$dev4" "$dev5" "$dev6"
|
||||||
|
lvcreate -aey --mirrorlog mirrored --type mirror -m 1 --ignoremonitoring --nosync -L 1 -n 2way $vg \
|
||||||
|
"$dev1" "$dev2" "$dev3":0 "$dev4":0
|
||||||
|
aux disable_dev "$dev3" "$dev4"
|
||||||
|
lvconvert -y --repair $vg/2way 2>&1 | tee 2way.out
|
||||||
|
lvs -a -o +devices $vg | not grep unknown
|
||||||
|
not grep "WARNING: Failed" 2way.out
|
||||||
|
vgreduce --removemissing $vg
|
||||||
|
check mirror $vg 2way
|
||||||
|
aux enable_dev "$dev3" "$dev4"
|
||||||
|
vgremove -ff $vg
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 3-way, mirrored log
|
||||||
|
# Single log failure, replace
|
||||||
|
vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3" "$dev4" "$dev5" "$dev6"
|
||||||
|
lvcreate -aey --mirrorlog mirrored --type mirror -m 2 --ignoremonitoring --nosync -L 1 -n 3way $vg \
|
||||||
|
"$dev1" "$dev2" "$dev3" "$dev4":0 "$dev5":0
|
||||||
|
aux disable_dev "$dev4"
|
||||||
|
lvconvert -y --repair $vg/3way 2>&1 | tee 3way.out
|
||||||
|
lvs -a -o +devices $vg | not grep unknown
|
||||||
|
not grep "WARNING: Failed" 3way.out
|
||||||
|
vgreduce --removemissing $vg
|
||||||
|
check mirror $vg 3way
|
||||||
|
aux enable_dev "$dev4"
|
||||||
|
vgremove -ff $vg
|
||||||
|
@ -69,6 +69,17 @@ _check_mlog
|
|||||||
vgreduce --removemissing $vg
|
vgreduce --removemissing $vg
|
||||||
aux enable_dev "$dev4"
|
aux enable_dev "$dev4"
|
||||||
|
|
||||||
|
# 3-way, mirrored log => 3-way, core log
|
||||||
|
recreate_vg_
|
||||||
|
lvcreate -aey --type mirror -m 2 --mirrorlog mirrored --ignoremonitoring -L 1 -n 3way $vg \
|
||||||
|
"$dev1" "$dev2" "$dev3" "$dev4":0 "$dev5":0
|
||||||
|
aux disable_dev "$dev4" "$dev5"
|
||||||
|
echo n | lvconvert --repair $vg/3way
|
||||||
|
check mirror $vg 3way core
|
||||||
|
_check_mlog
|
||||||
|
vgreduce --removemissing $vg
|
||||||
|
aux enable_dev "$dev4" "$dev5"
|
||||||
|
|
||||||
# 2-way, disk log => 2-way, core log
|
# 2-way, disk log => 2-way, core log
|
||||||
recreate_vg_
|
recreate_vg_
|
||||||
lvcreate -aey --type mirror -m 1 --ignoremonitoring -L 1 -n 2way $vg "$dev1" "$dev2" "$dev3":0
|
lvcreate -aey --type mirror -m 1 --ignoremonitoring -L 1 -n 2way $vg "$dev1" "$dev2" "$dev3":0
|
||||||
|
@ -27,4 +27,10 @@ lvconvert --mirrorlog core $vg/mirror
|
|||||||
not lvconvert -m 1 --mirrorlog disk $vg/mirror "$dev3" 2>&1 | tee errs
|
not lvconvert -m 1 --mirrorlog disk $vg/mirror "$dev3" 2>&1 | tee errs
|
||||||
grep "two steps" errs
|
grep "two steps" errs
|
||||||
|
|
||||||
|
if test ! -e LOCAL_CLVMD ; then
|
||||||
|
# FIXME mirrored unsupported in cluster
|
||||||
|
not lvconvert -m 1 --mirrorlog mirrored $vg/mirror "$dev3" "$dev4" 2>&1 | tee errs
|
||||||
|
grep "two steps" errs
|
||||||
|
fi
|
||||||
|
|
||||||
vgremove -ff $vg
|
vgremove -ff $vg
|
||||||
|
@ -38,4 +38,26 @@ lvcreate -n$lv2 -l4 -s $vg/$lv1
|
|||||||
lvcreate -n$lv3 -l4 --permission r -s $vg/$lv1
|
lvcreate -n$lv3 -l4 --permission r -s $vg/$lv1
|
||||||
cleanup_lvs
|
cleanup_lvs
|
||||||
|
|
||||||
|
# Skip the rest for cluster
|
||||||
|
if test -e LOCAL_CLVMD; then
|
||||||
|
|
||||||
|
# ---
|
||||||
|
# Create mirror on two devices with mirrored log using --alloc anywhere - should always fail in cluster
|
||||||
|
not lvcreate --type mirror -m 1 -l4 -n $lv1 --mirrorlog mirrored $vg --alloc anywhere "$dev1" "$dev2"
|
||||||
|
cleanup_lvs
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
# ---
|
||||||
|
# Create mirror on two devices with mirrored log using --alloc anywhere
|
||||||
|
lvcreate --type mirror -m 1 -l4 -n $lv1 --mirrorlog mirrored $vg --alloc anywhere "$dev1" "$dev2"
|
||||||
|
cleanup_lvs
|
||||||
|
|
||||||
|
# --
|
||||||
|
# Create mirror on one dev with mirrored log using --alloc anywhere, should fail
|
||||||
|
not lvcreate --type mirror -m 1 -l4 -n $lv1 --mirrorlog mirrored $vg --alloc anywhere "$dev1"
|
||||||
|
cleanup_lvs
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
vgremove -ff $vg
|
vgremove -ff $vg
|
||||||
|
@ -38,6 +38,15 @@ not lvconvert -m2 $vg/lv
|
|||||||
# Log conversion (disk -> core)
|
# Log conversion (disk -> core)
|
||||||
lvconvert --mirrorlog core $vg/lv
|
lvconvert --mirrorlog core $vg/lv
|
||||||
|
|
||||||
|
# Log conversion (core -> mirrored)
|
||||||
|
# FIXME on cluster
|
||||||
|
SHOULD=""
|
||||||
|
test -e LOCAL_CLVMD && SHOULD=should
|
||||||
|
$SHOULD lvconvert --mirrorlog mirrored $vg/lv
|
||||||
|
|
||||||
|
# Log conversion (mirrored -> core)
|
||||||
|
lvconvert --mirrorlog core $vg/lv
|
||||||
|
|
||||||
# Log conversion (core -> disk)
|
# Log conversion (core -> disk)
|
||||||
lvconvert --mirrorlog disk $vg/lv
|
lvconvert --mirrorlog disk $vg/lv
|
||||||
|
|
||||||
|
@ -122,6 +122,58 @@ COMM "vgsplit correctly splits mirror (log+leg on same dev) into $i VG ($j args)
|
|||||||
lvremove -f $vg2/$lv1
|
lvremove -f $vg2/$lv1
|
||||||
vgremove -f $vg1 $vg2
|
vgremove -f $vg1 $vg2
|
||||||
|
|
||||||
|
# Can't use mirrored log without cmirrord
|
||||||
|
# TODO: Should work for inactive device, needs some fixes....
|
||||||
|
if test ! -e LOCAL_CLVMD ; then
|
||||||
|
COMM "vgsplit correctly splits mirror LV with mirrored log into $i VG ($j args)"
|
||||||
|
create_vg_ $vg1 "$dev1" "$dev2" "$dev3" "$dev4"
|
||||||
|
test $i = existing && create_vg_ $vg2 "$dev5"
|
||||||
|
|
||||||
|
lvcreate -an -Zn -l 64 --mirrorlog mirrored --type mirror -m1 -n $lv1 $vg1 \
|
||||||
|
"$dev1" "$dev2" "$dev3" "$dev4"
|
||||||
|
|
||||||
|
if [ $j = PV ]; then
|
||||||
|
# FIXME: Not an exhaustive check of possible bad combinations
|
||||||
|
not vgsplit $vg1 $vg2 "$dev1" "$dev2"
|
||||||
|
not vgsplit $vg1 $vg2 "$dev3" "$dev4"
|
||||||
|
not vgsplit $vg1 $vg2 "$dev1" "$dev3"
|
||||||
|
not vgsplit $vg1 $vg2 "$dev2" "$dev4"
|
||||||
|
vgsplit $vg1 $vg2 "$dev1" "$dev2" "$dev3" "$dev4"
|
||||||
|
else
|
||||||
|
vgsplit -n $lv1 $vg1 $vg2
|
||||||
|
fi
|
||||||
|
if [ $i = existing ]; then
|
||||||
|
check pvlv_counts $vg2 5 1 0
|
||||||
|
else
|
||||||
|
check pvlv_counts $vg2 4 1 0
|
||||||
|
fi
|
||||||
|
lvremove -f $vg2/$lv1
|
||||||
|
vgremove -f $vg2
|
||||||
|
|
||||||
|
# RHBZ 875903
|
||||||
|
COMM "vgsplit correctly splits mirror LV with mirrored log on same devs into $i VG ($j args)"
|
||||||
|
create_vg_ $vg1 "$dev1" "$dev2" "$dev3" "$dev4"
|
||||||
|
test $i = existing && create_vg_ $vg2 "$dev5"
|
||||||
|
|
||||||
|
lvcreate -an -Zn -l 64 --mirrorlog mirrored --type mirror -m1 -n $lv1 $vg1 \
|
||||||
|
"$dev1" "$dev2"
|
||||||
|
|
||||||
|
if [ $j = PV ]; then
|
||||||
|
not vgsplit $vg1 $vg2 "$dev1"
|
||||||
|
not vgsplit $vg1 $vg2 "$dev2"
|
||||||
|
vgsplit $vg1 $vg2 "$dev1" "$dev2"
|
||||||
|
else
|
||||||
|
vgsplit -n $lv1 $vg1 $vg2
|
||||||
|
fi
|
||||||
|
if [ $i = existing ]; then
|
||||||
|
check pvlv_counts $vg2 3 1 0
|
||||||
|
else
|
||||||
|
check pvlv_counts $vg2 2 1 0
|
||||||
|
fi
|
||||||
|
lvremove -f $vg2/$lv1
|
||||||
|
vgremove -f $vg1 $vg2
|
||||||
|
fi
|
||||||
|
|
||||||
COMM "vgsplit correctly splits origin and snapshot LV into $i VG ($j args)"
|
COMM "vgsplit correctly splits origin and snapshot LV into $i VG ($j args)"
|
||||||
create_vg_ $vg1 "$dev1" "$dev2"
|
create_vg_ $vg1 "$dev1" "$dev2"
|
||||||
test $i = existing && create_vg_ $vg2 "$dev3" "$dev4"
|
test $i = existing && create_vg_ $vg2 "$dev3" "$dev4"
|
||||||
|
Loading…
Reference in New Issue
Block a user