1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

26 Commits

Author SHA1 Message Date
Zdenek Kabelac
fe3ef6867f tests: require newer raid version
Tests needs reshape support - so require newer target version
as quick fix.

TODO: inspect indiviual supportable conversion with older versions.
2021-03-20 00:05:01 +01:00
David Teigland
6169c0a51b tests: fix error detection in lvconvert-raid-takeover.sh 2019-05-23 10:29:52 -05:00
Zdenek Kabelac
5f87ba68d4 tests: use select with dmsetup
Use 'dmsetup -S' to greatly simplify such loops.
2018-11-29 23:10:09 +01:00
Heinz Mauelshagen
e2e30a64ab lvconvert: fix interim segtype regression on raid6 conversions
When converting from striped/raid0/raid0_meta
to raid6 with > 2 stripes, allow possible
direct conversion (to raid6_n_6).

In case of 2 stripes, first convert to raid5_n to restripe
to at least 3 data stripes (the raid6 minimum in lvm2) in
a second conversion before finally converting to raid6_n_6.

As before, raid6_n_6 then can be converted
to any other raid6 layout.

Enhance lvconvert-raid-takeover.sh to test the
2 stripes conversions to raid6.

Resolves: rhbz1624038
2018-09-07 13:48:19 +02:00
David Teigland
595196bc29 tests: enable lvmlockd for passing tests 2018-05-30 09:25:45 -05:00
Zdenek Kabelac
870c7bc76c tests: bound variables 2017-07-13 21:11:16 +02:00
Zdenek Kabelac
4ed3f1bee3 tests: improve loop 2017-07-10 14:23:53 +02:00
Zdenek Kabelac
e55bae2b2c tests: use bash 2017-07-10 14:23:53 +02:00
Heinz Mauelshagen
0f65d7ec3a lvconvert: prompt on raid1 image changes
Don't change resilience of raid1 LVs without --yes.

Adjust respective tests.
2017-04-06 18:47:41 +02:00
Zdenek Kabelac
17b56a4aed tests: early detect leaking error dev
lvconvert should not leak 'error' device.

(This patch is not fix the problem, just makes it more easily visible
instead of more confusing 'clvmd' trace).
2017-03-20 14:18:50 +01:00
Heinz Mauelshagen
b0336e8b3c lvconvert: ensure upconversion restrictions
Ensure minimum number of 3 data stripes on conversions to raid6.

Add test for it.

Resolves: rhbz1432675
2017-03-16 22:10:32 +01:00
Heinz Mauelshagen
48778bc503 lvconvert: add new reporting fields for reshaping
During an ongoing reshape, the MD kernel runtime reads stripes relative
to data_offset and starts storing the reshaped stripes (with new raid
layout and/or new stripesize  and/or new number of stripes) relative
to new_data_offset.  This is to avoid writing over any data in place
which is non-atomic by nature and thus be recoverable without data loss
in the transition.  MD uses the term out-of-place reshaping for it.

There's 2 other areas we don't have report capability for:
- number of data stripes vs. total stripes
  (e.g. raid6 with 7 stripes toal has 5 data stripes)
- number of (rotating) parity/syndrome chunks
  (e.g. raid6 with 7 stripes toal has 2 parity chunks; one
   per stripe for P-Syndrome and another one for Q-Syndrome)

Thus, add the following reportable keys:

- reshape_len      (in current units)
- reshape_len_le   (in logical extents)
- data_offset      (in sectors)
- new_data_offset  (     "    )
- data_stripes
- parity_chunks

Enhance lvchange-raid.sh, lvconvert-raid-reshape-linear_to_striped.sh,
lvconvert-raid-reshape-striped_to_linear.sh, lvconvert-raid-reshape.sh
and lvconvert-raid-takeover.sh to make use of new keys.

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978
2017-03-01 18:50:35 +01:00
Heinz Mauelshagen
34caf83172 lvconvert: add infrastructure for RaidLV reshaping support
In order to support striped raid5/6/10 LV reshaping (change
of LV type, stripesize or number of legs), this patch
introduces the changes to call the reshaping infratructure
from lv_raid_convert().

Changes:
- add reshaping calls from lv_raid_convert()
- add command definitons for reshaping to tools/command-lines.in
- fix raid_rimage_extents()
- add 2 new test scripts lvconvert-raid-reshape-linear_to_striped.sh
  and lvconvert-raid-reshape-striped_to_linear.sh to test
  the linear <-> striped multi-step conversions
- add lvconvert-raid-reshape.sh reshaping tests
- enhance lvconvert-raid-takeover.sh with new raid10 tests

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978
2017-02-24 05:20:58 +01:00
Zdenek Kabelac
c3b1f1a07a tests: fix dev path
Use proper device path for test devices.
Use mkfs.ext4 and drop  'echo y|' to it.
Use smaller device size to consume less memory and CPU time.
2017-02-13 10:06:19 +01:00
Heinz Mauelshagen
28ea66d46d lvconvert: add region size checks
Add:
- region size checks to raid_manip.c types array and supporting functions
- tests to lvconvert-raid-takeover.sh to check bogus
  "lvconvert --type  --regionsize N " requests

Related: rhbz1366296
2017-02-10 23:37:08 +01:00
Heinz Mauelshagen
baba3f8e2a lvconvert: add conversion from/to raid10
Add:
- conversion support from striped/raid0/raid0_meta to/from raid10;
  raid10 goes by the near format (same as used in creation of
  raid10 LVs), which groups data copies together with their original
  blocks (e.g. 3-way striped, 2 data copies resulting in 112233 in the
  first stripe followed by 445566 in the second etc.) and is limited
  to even numbers of legs for now
- related tests to lvconvert-raid-takeover.sh
- typo

Related: rhbz1366296
2017-02-10 19:13:02 +01:00
Heinz Mauelshagen
46a772fbc4 lvconvert: add support to change RAID region size (fixup)
Commit cfb6ef654d introduced
support to change RAID region size.

Add:
- missing conditions to support any types to function with
  it in lv_raid_convert();  temporary workaround used until
  cli validation patches get merged
- tests requesting "-R " to lvconvert-raid-takeover.sh
  involving a cleanup of the script

Related: rhbz1392947
2017-02-07 16:52:04 +01:00
Heinz Mauelshagen
a4bbaa3b89 lvconvert: add segtypes raid6_{ls,rs,la,ra}_6 and conversions to/from it
Add:
- support for segment types raid6_{ls,rs,la,ra}_6
  (striped raid with dedicated last Q-Syndrome SubLVs)
- conversion support from raid5_{ls,rs,la,ra} to/from raid6_{ls,rs,la,ra}_6
- setting convenient segtypes on conversions from/to raid4/5/6
- related tests to lvconvert-raid-takeover.sh factoring
  out _lvcreate,_lvconvert funxtions

Related: rhbz1366296
2017-02-05 00:56:27 +01:00
Heinz Mauelshagen
3673ce48e0 lvconvert: add segtype raid6_n_6 and conversions to/from it
Add:
- support for segment type raid6_n_6 (striped raid with dedicated last parity/Q-Syndrome SubLVs)
- conversion support from striped/raid0/raid0_meta/raid4 to/from raid6_n_6
- related tests to lvconvert-raid-takeover.sh

Related: rhbz1366296
2017-02-04 01:42:21 +01:00
Heinz Mauelshagen
60ddd05f16 lvconvert: add segtype raid5_n and conversions to/from it
Add:
- support for segment type raid5_n (striped raid with dedicated last parity SubLVs)
- conversion support from striped/raid0/raid0_meta/raid4 to/from raid5_n
- related tests to lvconvert-raid-takeover.sh

Related: rhbz1366296
2017-02-03 20:40:26 +01:00
Heinz Mauelshagen
61ae07966d lvconvert-raid-takeover.sh: fix test 2016-10-27 16:38:15 +02:00
Heinz Mauelshagen
ff05ed7afd lvchange/vgchange/lvconvert: prevent raid4 creation/activation/conversion on non-supporting raid targets
Check for dm-raid target version with non-standard raid4 mapping expecting the dedicated
parity device in the last rather than the first slot and prohibit to create, activate or
convert to such LVs from striped/raid0* or vice-versa in order to avoid data corruption.

Add related tests to lvconvert-raid-takeover.sh

Resolves: rhbz1388962
2016-10-27 11:42:07 +02:00
Heinz Mauelshagen
de78e8eae7 lvconvert: position dedicated parity device in raid4 conversions porperly
On conversions between striped/raid0* and raid4, the kernel expects
the dedicated raid4 parity SubLVs in the first segment area rather than
in the last it's been allocated to, thus the data mapping ain't proper.

Enhance lvconvert (lib/metadata/raid_manip.c) to shift the dedicated
parity SubLVs on conversions from striped/raid0* to raid4 and vice-versa.

In case of raid0_meta -> raid4 where the MD raid0 personality already has
stored RAID array device positions in the superblocks, the MetaLVs have to
be cleared so that the kernel doesn't fail validating the array positions
after lvm has shifted them up by one.

Add more tests to lvconvert-raid-takeover.sh including one to check for
mapping flaws by converting a created raid4 with filesystem -> striped
and fsck it.

Whilst on it:
- add missing direct striped -> raid4 conversion to the takeover array
  to avoid an intermim conversion from striped -> raid0*
- clean up the takeover array
- allow lvconvert to actually call lv_raid_convert() on all takeover requests
  in order to check parameters and display messages provided by takeover
  functions rather than just "...not supported" from within lvconvert
- fix a typo

Resolves: rhbz1386148
2016-10-21 19:00:31 +02:00
Zdenek Kabelac
44f1f45e16 tests: use exclusive activation
Slightly better for clvmd - thought test is still crashing
as table is broken.
2016-09-12 16:51:53 +02:00
Zdenek Kabelac
a13440d7ca tests: lower allocated memory
Use  smaller mirror to have faster sync.
TODO: switch to delayed devs...
2016-09-07 16:43:42 +02:00
Heinz Mauelshagen
3d3f62e10a test: add lvconvert-raid-takeover.sh
Commit 76ef2d15d8 introduced
raid0 <-> raid4 takeover and full mirror <-> raid1 support.

Add tests for these conversions.

Tests exposed a kernel semantics change freezing resynchronization
on conversions from raid0[_meta] -> raid4 or adding raid1 legs
because kernel kept the RAID mapped device in 'frozen' state unless
an 'idle' message was sent or the table was reloaded (kernel patch pending).
2016-08-09 14:17:26 +02:00