1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 11:55:55 +03:00
lvm2/tools
Jonathan Brassow 82228acfc9 Mirror/Thin: Disallow thinpools on mirror logical volumes
The same corner cases that exist for snapshots on mirrors exist for
any logical volume layered on top of mirror.  (One example is when
a mirror image fails and a non-repair LVM command is the first to
detect it via label reading.  In this case, the LVM command will hang
and prevent the necessary LVM repair command from running.)  When
a better alternative exists, it makes no sense to allow a new target
to stack on mirrors as a new feature.  Since, RAID is now capable of
running EX in a cluster and thin is not active-active aware, it makes
sense to pair these two rather than mirror+thinpool.

As further background, here are some additional comments that I made
when addressing a bug related to mirror+thinpool:
(https://bugzilla.redhat.com/show_bug.cgi?id=919604#c9)
I am going to disallow thin* on top of mirror logical volumes.
Users will have to use the "raid1" segment type if they want this.

This bug has come down to a choice between:
1) Disallowing thin-LVs from being used as PVs.
2) Disallowing thinpools on top of mirrors.

The problem is that the code in dev_manager.c:device_is_usable() is unable
to tell whether there is a mirror device lower in the stack from the device
being checked.  Pretty much anything layered on top of a mirror will suffer
from this problem.  (Snapshots are a good example of this; and option #1
above has been chosen to deal with them.  This can also be seen in
dev_manager.c:device_is_usable().)  When a mirror failure occurs, the
kernel blocks all I/O to it.  If there is an LVM command that comes along
to do the repair (or a different operation that requires label reading), it
would normally avoid the mirror when it sees that it is blocked.  However,
if there is a snapshot or a thin-LV that is on a mirror, the above code
will not detect the mirror underneath and will issue label reading I/O.
This causes the command to hang.

Choosing #1 would mean that thin-LVs could never be used as PVs - even if
they are stacked on something other than mirrors.

Choosing #2 means that thinpools can never be placed on mirrors.  This is
probably better than we think, since it is preferred that people use the
"raid1" segment type in the first place.  However, RAID* cannot currently
be used in a cluster volume group - even in EX-only mode.  Thus, a complete
solution for option #2 must include the ability to activate RAID logical
volumes (and perform RAID operations) in a cluster volume group.  I've
already begun working on this.
2013-09-11 15:58:44 -05:00
..
.exported_symbols generate liblvm2cmd exported symbols too 2010-06-25 18:23:10 +00:00
.gitignore More .gitignore files for an in-source-tree build. 2012-06-08 16:34:43 +01:00
args.h tools: Use backgroundfork_ARG for pvscan -b 2013-09-06 01:43:24 +01:00
cmdnames.h Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
commands.h tools: Use backgroundfork_ARG for pvscan -b 2013-09-06 01:43:24 +01:00
dmsetup.c dmsetup: display any message output from kernel 2013-08-16 15:25:39 +01:00
dumpconfig.c dumpconfig: also mention profilable type if giving hint about known types 2013-08-19 08:32:03 +02:00
errors.h lvresize: separate validation from action 2013-07-06 03:28:21 +01:00
formats.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
lvchange.c RAID: Make RAID single-machine-exclusive capable in a cluster 2013-09-10 16:33:22 -05:00
lvconvert.c Mirror/Thin: Disallow thinpools on mirror logical volumes 2013-09-11 15:58:44 -05:00
lvcreate.c thin: apply VG profile if creating a new thin pool 2013-08-06 11:42:40 +02:00
lvdisplay.c Rework the toollib interface (process_each_*) on top of new vg_read. 2009-07-01 17:00:50 +00:00
lvextend.c Some whitespace tidy-ups. 2008-01-30 14:00:02 +00:00
lvm2cmd-static.c Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
lvm2cmd.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
lvm2cmd.h lvresize: separate validation from action 2013-07-06 03:28:21 +01:00
lvm2cmdline.h Support repetition of --addtag and --deltag arguments. 2010-11-11 17:29:05 +00:00
lvm-static.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
lvm.c config: add profile arg to find_config_tree_int 2013-07-02 15:19:09 +02:00
lvmchange.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
lvmcmdlib.c cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00
lvmcmdline.c logging: Write Completed message before resetting. 2013-09-06 01:47:41 +01:00
lvmdiskscan.c Few more close and dev_close trace 2012-03-01 21:12:37 +00:00
lvreduce.c Some whitespace tidy-ups. 2008-01-30 14:00:02 +00:00
lvremove.c cleanup: introduce return_ECMD_FAILED macro 2013-07-01 23:10:33 +02:00
lvrename.c cleanup: stack usage 2013-07-01 23:11:14 +02:00
lvresize.c lvresize: separate validation from action 2013-07-06 03:28:21 +01:00
lvscan.c config: add silent mode 2012-08-25 20:35:48 +01:00
Makefile.in lvmetad: lvm depends on libdaemonclient.a 2013-01-04 23:10:38 +00:00
polldaemon.c tools: add -b/--background for pvscan --cache -aay 2013-09-03 16:49:21 +02:00
polldaemon.h Start using 64-bit status flags - most of the code already handles them. 2011-09-06 18:49:31 +00:00
pvchange.c locking: Make it possible to pass down an LV to activation code. 2013-06-10 17:26:38 +02:00
pvck.c Move the core of the lib/config/config.c functionality into libdevmapper, 2011-08-30 14:55:15 +00:00
pvcreate.c tools: remove metadata-exported.h 2013-07-09 03:07:55 +01:00
pvdisplay.c cleanup: uint64_t casts 2012-08-23 14:37:21 +02:00
pvmove.c pvmove: Skip pvmove of RAID, thin, snapshot, origin, and mirror LVs in cluster 2013-09-03 13:17:01 -05:00
pvremove.c pvremove: stack trace 2013-07-08 14:01:41 +02:00
pvresize.c tools: remove metadata-exported.h 2013-07-09 03:07:55 +01:00
pvscan.c reinstate: commit 82d83a01ce 2013-09-03 16:49:21 +02:00
reporter.c report: remove LV_CREATE_PARAMS report type 2013-07-09 02:06:29 +01:00
segtypes.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
stub.h Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
toollib.c cleanup: drop within comment gcc warning 2013-09-09 12:17:11 +02:00
toollib.h tools: add -b/--background for pvscan --cache -aay 2013-09-03 16:49:21 +02:00
tools.h filters: check for mpath before opening devs 2013-08-13 23:26:58 +01:00
vgcfgbackup.c cleanup: stack usage 2013-07-01 23:11:14 +02:00
vgcfgrestore.c cleanup: introduce return_ECMD_FAILED macro 2013-07-01 23:10:33 +02:00
vgchange.c vgchange: require confirmation with -c and no VGs 2013-08-13 18:20:11 +01:00
vgck.c vgck: Fix #894136, notice on-disk corruption in spite of lvmetad. 2013-08-13 23:25:49 +02:00
vgconvert.c config: add profile arg to find_config_tree_int 2013-07-02 15:19:09 +02:00
vgcreate.c metadata: add support for storing profile name in metadata (during vgcreate/lvcreate) 2013-07-02 15:19:09 +02:00
vgdisplay.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
vgexport.c config: add silent mode 2012-08-25 20:35:48 +01:00
vgextend.c cleanup: introduce return_ECMD_FAILED macro 2013-07-01 23:10:33 +02:00
vgimport.c cleanup: comments and a message 2013-07-24 22:10:37 +01:00
vgmerge.c thin: vgsplit and vgmerge spare support 2013-07-18 18:22:44 +02:00
vgmknodes.c cleanup: introduce return_ECMD_FAILED macro 2013-07-01 23:10:33 +02:00
vgreduce.c locking: Make it possible to pass down an LV to activation code. 2013-06-10 17:26:38 +02:00
vgremove.c cleanup: introduce return_ECMD_FAILED macro 2013-07-01 23:10:33 +02:00
vgrename.c cleanup: introduce return_ECMD_FAILED macro 2013-07-01 23:10:33 +02:00
vgscan.c locking: Make it possible to pass down an LV to activation code. 2013-06-10 17:26:38 +02:00
vgsplit.c thin: vgsplit and vgmerge spare support 2013-07-18 18:22:44 +02:00