mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
d5896f0afd
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. |
||
---|---|---|
.. | ||
.gitignore | ||
configure.h.in | ||
crc_gen.c | ||
crc.c | ||
crc.h | ||
intl.h | ||
last-path-component.h | ||
lib.h | ||
lvm-exec.c | ||
lvm-exec.h | ||
lvm-file.c | ||
lvm-file.h | ||
lvm-globals.c | ||
lvm-globals.h | ||
lvm-percent.c | ||
lvm-percent.h | ||
lvm-string.c | ||
lvm-string.h | ||
lvm-version.h.in | ||
lvm-wrappers.c | ||
lvm-wrappers.h | ||
sharedlib.c | ||
sharedlib.h | ||
timestamp.c | ||
timestamp.h | ||
util.h |