mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-29 06:50:38 +03:00
test: Test addition to show incorrect allocator behavior
If a RAID LV has images that are spread across more than one PV and you allocate a new image that requires more than one PV, parallel_areas is only honored for one segment. This commit adds a test for this condition.
This commit is contained in:
parent
e80884cd08
commit
1f1675b059
@ -202,4 +202,26 @@ for i in {1..3}; do
|
||||
lvremove -ff $vg
|
||||
done
|
||||
|
||||
# Setup 2-way RAID1 LV to spread across 4 devices.
|
||||
# For each image:
|
||||
# - metadata LV + 1 image extent (2 total extents) on one PV
|
||||
# - 2 image extents on the other PV
|
||||
# Then attempt allocation of another image from 2 extents on
|
||||
# a 5th PV and the remainder of the rest of already used PVs.
|
||||
#
|
||||
# This should fail because there is insufficient space on the
|
||||
# non-parallel PV (i.e. there is not enough space for the image
|
||||
# if it doesn't share a PV with another image).
|
||||
lvcreate --type raid1 -m 1 -l 3 -n $lv1 $vg \
|
||||
"$dev1:0-1" "$dev2:0-1" "$dev3:0-1" "$dev4:0-1"
|
||||
aux wait_for_sync $vg $lv1
|
||||
# Should not be enough non-overlapping space.
|
||||
not lvconvert -m +1 $vg/$lv1 \
|
||||
"$dev5:0-1" "$dev1" "$dev2" "$dev3" "$dev4"
|
||||
# Should work due to '--alloc anywhere'
|
||||
lvconvert -m +1 --alloc anywhere $vg/$lv1 \
|
||||
"$dev5:0-1" "$dev1" "$dev2" "$dev3" "$dev4"
|
||||
lvremove -ff $vg
|
||||
|
||||
|
||||
vgremove -ff $vg
|
||||
|
Loading…
x
Reference in New Issue
Block a user