From: Neil Brown <neilb@suse.de>
To: lvm-devel@redhat.com
Subject: dmeventd doesn't handle failures during mirror resync.
Date: Thu, 29 Apr 2010 17:01:40 +1000 [thread overview]
Message-ID: <20100429170140.777db964@notabene.brown> (raw)
Hi,
I've been exploring the behaviour of dm-raid1 (particular in a clustered
environment) in response to various error conditions.
I was surprised to discover that while a normal write error is
handled properly - dmeventd runs 'lvconvert' to fix the array up,
this does not happen in response to a write error while syncing
the array.
If I arrange for the new device to die, then
lvconvert --repair --use-policies
will fix it up as I would expect, but dmeventd never asks it to do
this.
This seems to be a deliberate decision: in _process_status_code
in dmeventd_mirror.c, a status of 'F' will cause lvconvert to be
run while 'S' and 'R' (sync and read errors) will not.
Is there a reason for this?
I realise that the data is not at risk in the case of a sync error as the
dirty log records that the section of the array is out of sync so no
IO will be directed there. However it seems to go against expectation.
Also, if you then stop the array (vgchange -an) without lvconvert being
run, and restart it (vgchange -ay) the restart will fail unless you use
--partial.
This would mean that a shutdown/reboot would probably leave the volume
inactive (as it seems init scripts don't tend to inculde --partial) which
is not what I would expect.
Can we change dmeventd to response to sync (and read) errors in the same
way that it responds to write errors?
Thanks,
NeilBrown
diff --git a/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c b/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c
index 4d2eee5..7c6ceb9 100644
--- a/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c
+++ b/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c
@@ -41,21 +41,20 @@ static int _process_status_code(const char status_code, const char *dev_name,
* R => Read - A read failure occurred, mirror data unaffected
* U => Unclassified failure (bug)
*/
- if (status_code == 'F') {
+ if (status_code == 'F')
syslog(LOG_ERR, "%s device %s flush failed.",
dev_type, dev_name);
- r = ME_FAILURE;
- } else if (status_code == 'S')
+ else if (status_code == 'S')
syslog(LOG_ERR, "%s device %s sync failed.",
dev_type, dev_name);
else if (status_code == 'R')
syslog(LOG_ERR, "%s device %s read failed.",
dev_type, dev_name);
- else if (status_code != 'A') {
+ else if (status_code != 'A')
syslog(LOG_ERR, "%s device %s has failed (%c).",
dev_type, dev_name, status_code);
+ if (status_code != 'A')
r = ME_FAILURE;
- }
return r;
}
next reply other threads:[~2010-04-29 7:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-29 7:01 Neil Brown [this message]
2010-05-05 8:08 ` dmeventd doesn't handle failures during mirror resync Petr Rockai
2010-05-05 13:22 ` Jonathan Brassow
2010-05-05 15:26 ` Takahiro Yasui
2010-05-12 23:19 ` Neil Brown
2010-05-13 9:27 ` Nikanth Karthikesan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100429170140.777db964@notabene.brown \
--to=neilb@suse.de \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.