1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 03:27:58 +03:00
LVM2 mirror repository https://sourceware.org/lvm2/
Go to file
Jonathan Brassow d5896f0afd Mirror: Fix hangs and lock-ups caused by attempting label reads of mirrors
There is a problem with the way mirrors have been designed to handle
failures that is resulting in stuck LVM processes and hung I/O.  When
mirrors encounter a write failure, they block I/O and notify userspace
to reconfigure the mirror to remove failed devices.  This process is
open to a couple races:
1) Any LVM process other than the one that is meant to deal with the
mirror failure can attempt to read the mirror, fail, and block other
LVM commands (including the repair command) from proceeding due to
holding a lock on the volume group.
2) If there are multiple mirrors that suffer a failure in the same
volume group, a repair can block while attempting to read the LVM
label from one mirror while trying to repair the other.

Mitigation of these races has been attempted by disallowing label reading
of mirrors that are either suspended or are indicated as blocking by
the kernel.  While this has closed the window of opportunity for hitting
the above problems considerably, it hasn't closed it completely.  This is
because it is still possible to start an LVM command, read the status of
the mirror as healthy, and then perform the read for the label at the
moment after a the failure is discovered by the kernel.

I can see two solutions to this problem:
1) Allow users to configure whether mirrors can be candidates for LVM
labels (i.e. whether PVs can be created on mirror LVs).  If the user
chooses to allow label scanning of mirror LVs, it will be at the expense
of a possible hang in I/O or LVM processes.
2) Instrument a way to allow asynchronous label reading - allowing
blocked label reads to be ignored while continuing to process the LVM
command.  This would action would allow LVM commands to continue even
though they would have otherwise blocked trying to read a mirror.  They
can then release their lock and allow a repair command to commence.  In
the event of #2 above, the repair command already in progress can continue
and repair the failed mirror.

This patch brings solution #1.  If solution #2 is developed later on, the
configuration option created in #1 can be negated - allowing mirrors to
be scanned for labels by default once again.
2013-10-22 19:14:33 -05:00
autoconf
conf Mirror: Fix hangs and lock-ups caused by attempting label reads of mirrors 2013-10-22 19:14:33 -05:00
daemons
doc
include
lib Mirror: Fix hangs and lock-ups caused by attempting label reads of mirrors 2013-10-22 19:14:33 -05:00
libdaemon
libdm
liblvm
man
old-tests
po
python
report-generators
reports
scripts
test
tools
udev
unit-tests
.gitignore
aclocal.m4
configure
configure.in
COPYING
COPYING.LIB
INSTALL
make.tmpl.in
Makefile.in
README
VERSION
VERSION_DM
WHATS_NEW Mirror: Fix hangs and lock-ups caused by attempting label reads of mirrors 2013-10-22 19:14:33 -05:00
WHATS_NEW_DM

This tree contains the LVM2 and device-mapper tools and libraries.

For more information about LVM2 read the changelog in the WHATS_NEW file.
Installation instructions are in INSTALL.

There is no warranty - see COPYING and COPYING.LIB.

Tarballs are available from:
  ftp://sources.redhat.com/pub/lvm2/

The source code is stored in git:
  http://git.fedorahosted.org/git/lvm2.git
  git clone git://git.fedorahosted.org/git/lvm2.git

Mailing list for general discussion related to LVM2:
  linux-lvm@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm

Mailing lists for LVM2 development, patches and commits:
  lvm-devel@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm

  lvm2-commits@lists.fedorahosted.org (Read-only archive of commits)
  Subscribe from https://fedorahosted.org/mailman/listinfo/lvm2-commits

Mailing list for device-mapper development, including kernel patches
and multipath-tools:
  dm-devel@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/dm-devel

The source code repository used until 7th June 2012 is accessible here:
  http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/?cvsroot=lvm2.