master - mirror: Avoid reading mirrors with failed devices in mirrored log
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b248ba0a396d7fc9a459eea02cfdc70b33ce3441 Commit: b248ba0a396d7fc9a459eea02cfdc70b33ce3441 Parent: 9fd7ac7d035f0b2f8dcc3cb19935eb181816bd76 Author: Jonathan Brassow <[email protected]> AuthorDate: Thu Oct 25 00:42:45 2012 -0500 Committer: Jonathan Brassow <[email protected]> CommitterDate: Thu Oct 25 00:42:45 2012 -0500
mirror: Avoid reading mirrors with failed devices in mirrored log
Commit 9fd7ac7d035f0b2f8dcc3cb19935eb181816bd76 did not handle mirrors that contained mirrored logs. This is because the status line of the mirror does not give an indication of the health of the mirrored log, as you can see here:
[root at bp-01 lvm2]# dmsetup status vg-lv vg-lv_mlog
vg-lv: 0 409600 mirror 2 253:6 253:7 400/400 1 AA 3 disk 253:5 A
vg-lv_mlog: 0 8192 mirror 2 253:3 253:4 7/8 1 AD 1 coreThus, the possibility for LVM commands to hang still persists when mirror have mirrored logs. I discovered this while performing some testing that does polling with 'pvs' while doing I/O and killing devices. The 'pvs' managed to get between the mirrored log device failure and the attempt by dmeventd to repair it. The result was a very nasty block in LVM commands that is very difficult to remove - even for someone who knows what is going on. Thus, it is absolutely essential that the log of a mirror be recursively checked for mirror devices which may be failed as well.
Despite what the code comment says in the aforementioned commit...
+ * _mirrored_transient_status(). FIXME: It is unable to handle mirrors
+ * with mirrored logs because it does not have a way to get the status of
+ * the mirror that forms the log, which could be blocked.
... it is possible to get the status of the log because the log device major/minor is given to us by the status output of the top-level mirror. We can use that to query the log device for any DM status and see if it is a mirror that needs to be bypassed. This patch does just that and is now able to avoid reading from mirrors that have failed devices in a mirrored log.
--- WHATS_NEW | 1 + lib/activate/dev_manager.c | 54 +++++++++++++++++++++++++++++++------------- 2 files changed, 39 insertions(+), 16 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.99 - =================================== + Avoid reading mirrors with failed devices in its mirrored log. Avoid reading from mirrors that have failed devices if they block I/O. Change lvs heading Copy% to Cpy%Sync and print RAID4/5/6 sync% there too. Fix clvmd support for option -d and properly use its argument.
lib/activate/dev_manager.c +38 -16
100 lines not on this page · raw message