1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 11:55:55 +03:00
Commit Graph

13042 Commits

Author SHA1 Message Date
Heinz Mauelshagen
48e14390c1 test: fix lvcreate-large-raid.sh
RAID6 LVs may not be created with --nosync or data corruption
may occur in case of device failures.  The underlying MD raid6
personality used to drive the RaidLV performs read-modify-write
updates on stripes and thus relies on properly written parity
(P and Q Syndromes) during initial synchronization.

Once on it, enhance test to create/extend more and
larger RaidLVs and check sync/nosync status.
2016-08-09 17:45:37 +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
Alasdair G Kergon
e5a5fd3669 lvconvert: Fix repair and replace routing. 2016-08-08 23:13:34 +01:00
Bryn M. Reeves
dad02900f1 man: explain deletion of 1st group member in dmstats.8.in
Although the use of the first region_id in a group to store the
DMS_GROUP=... aux_data tag is an internal implementation detail,
it has a user visible consequence in that deleting this region will
cause the group to disappear: add an explanation of this to the
'group' command and 'Regions, areas, and groups' section.
2016-08-08 19:29:12 +01:00
Bryn M. Reeves
4bcbcdb1a2 man: minor fixes to dmstats.8.in
Remove obsolete reference to '--target'.
2016-08-08 19:07:56 +01:00
Alasdair G Kergon
175e0905d5 test: Drop --mirrorlog when not a mirror. 2016-08-08 18:43:54 +01:00
David Teigland
fc93085c7a lvconvert: separate type raid to mirror
By the current division of unique operations,
converting type raid to type mirror is distinct
from converting type raid to raid.
2016-08-08 10:37:24 -05:00
Heinz Mauelshagen
6f90c954b7 WHATS_NEW: reject --nosync option for RAID6 LVs in lvcreate 2016-08-08 16:00:49 +02:00
Alasdair G Kergon
c55134aa48 lvconvert: Limit --corelog and --mirrorlog to mirrors.
It's an error to specify a log when the final result is not of type
mirror.
2016-08-08 14:39:55 +01:00
Heinz Mauelshagen
7d6cf12554 lvcreate: reject '--nosync' option for RAID6 LVs
The MD raid6 personality being used to drive lvm raid6 LVs does
read-modify-write updates to any stripes and thus relies on correct
P and Q Syndromes being written during initial synchronization or
it may fail reconstructing proper user data in case of SubLVs failing.

We may not allow the '--nosync' option on
creation of raid6 LVs for that reason.

Update/fix 'man lvcreate' in that regard.

add lvcreate-raid-nosync.sh test script.

- Resolves rhbz1358532
2016-08-08 13:52:35 +02:00
Peter Rajnoha
57fa5d4329 lvmcmdline: do not refresh whole cmd context if profile dropped after processing LVM cmd
We don't need to refresh whole cmd context if we drop profile after
processing LVM command - just like we don't refresh cmd context when
we're applying the profile. It's because profiles contain only safe
subset of settings which do not require complete cmd context refresh.

This patch calls process_profilable_config instead of
refresh_toolcontext if there was profile applied for the LVM
command only, not --config which requires toolcontext refresh.
The process_profilable_config just sets proper values based on
values of profilable settings, but it does not do complete
reinitialization of various parts (e.g. filters, logging etc.).
2016-08-08 11:57:13 +02:00
Alasdair G Kergon
76ef2d15d8 lvconvert: Support raid0<->raid4 and mirror<->raid1.
Only simple takeover cases so far.
2016-08-07 00:56:08 +01:00
Alasdair G Kergon
de7f1deb80 raid: Report supported lvconvert conversions if invalid. 2016-08-07 00:30:26 +01:00
Alasdair G Kergon
6f236c3353 raid: Add workaround to prepare for raid4 conversions. 2016-08-07 00:07:06 +01:00
Alasdair G Kergon
ba0c26a078 raid: Pass list of LVs to remove into more fns. 2016-08-06 23:46:45 +01:00
Alasdair G Kergon
30884208d4 raid: Move two functions. 2016-08-06 23:29:27 +01:00
Heinz Mauelshagen
802bd34562 WHATS_NEW: fixup order 2016-08-05 16:31:46 +02:00
Heinz Mauelshagen
8f25ad6416 raid_manip: fix log print format from commit d2c3b23e6d 2016-08-05 16:29:56 +02:00
Heinz Mauelshagen
9aefe9aa7a WHATS_NEW: add '--rebuild PV' option to lvchange to allow for PV selective rebuilds 2016-08-05 16:07:14 +02:00
Heinz Mauelshagen
d2c3b23e6d lvchange: Allow device specification when requesting a repair
'lvchange --resync LV' or 'lvchange --syncaction repair LV' request the
RAID layout specific parity blocks in raid4/5/6 to be recreated or the
mirrored blocks to be copied again from the master leg/copy for raid1/10,
thus not allowing a rebuild of a particular PV.

Introduce repeatable option '--[raid]rebuild PV' to allow to request
rebuilds of specific PVs in a RaidLV which are known to contain corrupt
data (e.g. rebuild a raid1 master leg).

Add test lvchange-rebuild-raid.sh to test/shell doing rebuild
variations on raid1/10 and 5; add aux function check_status_chars
to support the new test.

 - Resolves rhbz1064592
2016-08-05 16:01:46 +02:00
Alasdair G Kergon
91f866f786 raid: Tell lib whether stripesize was specified 2016-08-05 14:28:14 +01:00
Alasdair G Kergon
7482ff93b8 raid: Turn lv_raid_change_image_count into wrapper
Eventually the separate entry point will disappear.
2016-08-05 14:17:54 +01:00
Alasdair G Kergon
b66fa91c46 segtypes: Further segtype macros. 2016-08-05 14:00:40 +01:00
Alasdair G Kergon
b1b0b134ec raid0: Validate presence of raid0 meta_areas more tightly. 2016-08-04 21:15:07 +01:00
David Teigland
d1a25fe597 lvconvert: add FIXME
operations are no longer identified correctly.
2016-08-04 13:01:48 -05:00
Alasdair G Kergon
4a15abe865 striped: Add precise macros for original segtype.
The existing striped macros include raid0 segments.
2016-08-04 01:24:39 +01:00
Alasdair G Kergon
5c3141a8b9 lvconvert: Improve error message when no -m. 2016-08-03 23:43:59 +01:00
David Teigland
be497175e0 man: minor corrections in pvscan 2016-08-03 15:49:43 -05:00
David Teigland
2b01dca28a man: include info about disabled lvmetad 2016-08-03 15:42:12 -05:00
Alasdair G Kergon
8b1a368b59 lvconvert: Provide entry point for new functionality.
Prepare for new segment type conversion functionality in cases that
currently fail.  In the short-term, we need to do this while limiting
the changes to the code paths for the conversions that are already
supported.
2016-08-03 03:53:29 +01:00
Alasdair G Kergon
fdc3fcbfce lvconvert: Pass region_size to lv_raid_convert. 2016-08-02 23:51:20 +01:00
Alasdair G Kergon
a234cebbed lvconvert: Preserve mirror region size with --repair. 2016-08-02 19:50:04 +01:00
Alasdair G Kergon
415c5fd5d8 lvconvert: Divide into 12 categories. 2016-08-02 16:44:21 +01:00
Alasdair G Kergon
6361bc4734 lvconvert: Treat --repair as an independent case. 2016-08-02 16:22:12 +01:00
Alasdair G Kergon
804a397643 lvconvert: Forbid stripe parameters with --repair. 2016-08-02 15:59:12 +01:00
Heinz Mauelshagen
d0d03f315b vg_validate: correct min_recovery_rate check message 2016-08-02 15:27:13 +02:00
Heinz Mauelshagen
5765a28456 vg_validate: new RAID segment checks in check_lv_segments()
introduced with commit 8f62b7bfe5 rely on complete
             defintions of the relations between the LVs of a VG.
             Hence only run these checks when the complete_vg flag
             is set on calls to check_lv_segments().

             lvconvert failed in test lvconvert-thin-raid.sh when
             calling check_lv_segments() from _read_segments() without
             providing a complete definition.
2016-08-01 22:42:05 +02:00
Alasdair G Kergon
c490be9134 Revert "thin: when converting a thin pool data or metadata LV from"
This reverts commit 237f84e038.

This case failed:
    lvcreate --type raid1 -m1 -l2 vg99
    lvcreate -aey -l2 -s vg99/lvol0
    lvconvert -m2 vg99/lvol0
2016-08-01 15:17:44 +01:00
Alasdair G Kergon
d0df1ff995 lvconvert: Set lp->segtype in only one place. 2016-07-30 18:20:04 +01:00
Alasdair G Kergon
1ce958bc5e lvconvert: Rely upon lp->thin and lp->cache. 2016-07-30 15:58:09 +01:00
Alasdair G Kergon
48d9c46daa lvconvert: Fix --type thin recognition.
lp->thin already holds the result of the cmdline arg resolution.
2016-07-30 15:08:50 +01:00
Alasdair G Kergon
52d2fa7022 tools: Also recognise segtype with thin and cache.
(--type thin still needs this for lvcreate - more logic should be
shared between lvcreate and lvconvert)
2016-07-30 04:12:58 +01:00
Alasdair G Kergon
d1ff254c3c tools: mirror also supports stripesize 2016-07-30 03:52:49 +01:00
Alasdair G Kergon
b3fbcd1ff7 lvconvert: Move stripe validation code later.
Simpler to delay it all until the actual LV being changed is available,
rather than having it split in two parts.
2016-07-30 02:52:06 +01:00
Alasdair G Kergon
4ffe15bf6a tools: Unify stripesize parameter validation.
Move it all into get_stripe_params().
Some code paths missed --stripesize checks.
E.g. lvcreate --type raid4 -i1
2016-07-30 02:05:50 +01:00
Alasdair G Kergon
d01b1b6cc1 lvconvert: Rearrange code that decides segtype. 2016-07-30 00:22:13 +01:00
Alasdair G Kergon
a8e4790810 lvconvert: Only obtain --type parameter once. 2016-07-29 21:45:22 +01:00
Alasdair G Kergon
800c0d3dd6 lvconvert: Remove hard-coded segment names. 2016-07-29 21:11:12 +01:00
Heinz Mauelshagen
237f84e038 thin: when converting a thin pool data or metadata LV from
linear to raid1, the linear wasnt't switched to the
      raid1 mapping, thus creating the false impression of
      resilience.
2016-07-29 19:17:12 +02:00
Alasdair G Kergon
6b6e258e0c post-release 2016-07-28 19:58:22 +01:00