1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
lvm2/lib/metadata
Jonathan Brassow c87907dcd5 lvconvert: linear -> raid1 upconvert should cause "recover" not "resync"
Two of the sync actions performed by the kernel (aka MD runtime) are
"resync" and "recover".  The "resync" refers to when an entirely new array
is going through the process of initializing (or resynchronizing after an
unexpected shutdown).  The "recover" is the process of initializing a new
member device to the array.  So, a brand new array with all new devices
will undergo "resync".  An array with replaced or added sub-LVs will undergo
"recover".

These two states are treated very differently when failures happen.  If any
device is lost or replaced while "resync", there are no worries.  This is
because any writes created from the inception of the array have occurred to
all the devices and can be safely recovered.  Even though non-initialized
portions will still be resync'ed with uninitialized data, it is ok.  However,
if a pre-existing device is lost (aka, the original linear device in a
linear -> raid1 convert) during a "recover", data loss can be the result.
Thus, writes are errored by the kernel and recovery is halted.  The failed
device must be restored or removed.  This is the correct behavior.

Unfortunately, we were treating an up-convert from linear as a "resync"
when we should have been treating it as a "recover".  This patch
removes the special case for linear upconvert.  It allows each new image
sub-LV to be marked with a rebuild flag and treats the array as 'in-sync'.
This has the correct effect of causing the upconvert to be treated as a
"recover" rather than a "resync".  There is no need to flag these two states
differently in LVM metadata, because they are already considered differently
by the kernel RAID metadata.  (Any activation/deactivation will properly
resume the "recover" process and not a "resync" process.)

We make this behavior change based on the presense of dm-raid target
version 1.9.0+.
2017-06-14 08:35:22 -05:00
..
cache_manip.c cache: enable usage of --cachemetadataformat 2017-03-10 19:33:01 +01:00
lv_alloc.h lvconvert: add infrastructure for RaidLV reshaping support 2017-02-24 05:20:58 +01:00
lv_manip.c mirror/raid: display adjusted region size with units 2017-04-20 20:42:21 +02:00
lv.c properties: only thin-pool provides discards 2017-03-17 14:22:33 +01:00
lv.h lv: introduce lvseg_percent_with_info_and_seg_status 2016-05-27 15:47:24 +02:00
merge.c Fix typo 2017-05-24 13:47:45 +02:00
metadata-exported.h raid: add reshape segtype flag support 2017-06-09 22:23:04 +02:00
metadata.c print warning about in-use orphans 2017-06-01 11:18:42 -05:00
metadata.h thin: enforce there is some free space in thin pool metadata 2016-09-19 14:00:56 +02:00
mirror.c mirror/raid: display adjusted region size with units 2017-04-20 20:42:21 +02:00
pool_manip.c cleanup: minor cosmetics 2017-03-10 19:33:01 +01:00
pv_alloc.h doc: change fsf address 2016-01-21 12:11:37 +01:00
pv_manip.c pvresize: Missing a message on error path. 2017-04-27 15:00:41 +01:00
pv_map.c doc: change fsf address 2016-01-21 12:11:37 +01:00
pv_map.h doc: change fsf address 2016-01-21 12:11:37 +01:00
pv.c lvmcache: add optional dev arg to lvmcache_info_from_pvid 2016-06-07 15:15:47 -05:00
pv.h pv: add is_used_pv fn 2016-02-15 12:44:46 +01:00
raid_manip.c lvconvert: linear -> raid1 upconvert should cause "recover" not "resync" 2017-06-14 08:35:22 -05:00
replicator_manip.c lvmetad: two phase vg_update 2016-06-28 02:30:31 +01:00
segtype.c lvconvert: add infrastructure for RaidLV reshaping support 2017-02-24 05:20:58 +01:00
segtype.h lvconvert: linear -> raid1 upconvert should cause "recover" not "resync" 2017-06-14 08:35:22 -05:00
snapshot_manip.c lvconvert: add infrastructure for RaidLV reshaping support 2017-02-24 05:20:58 +01:00
takeover_matrix.h lvconvert: add infrastructure for RaidLV reshaping support 2017-02-24 05:20:58 +01:00
thin_manip.c cleanup: update message 2017-06-09 21:49:19 +02:00
vg.c macros: Use is_power_of_2. 2016-06-30 17:59:44 +01:00
vg.h lvmetad: two phase vg_update 2016-06-28 02:30:31 +01:00