From: "Arkadiusz Bubała" <arkadiusz.bubala@open-e.com>
To: linux-raid <linux-raid@vger.kernel.org>
Subject: Mdadm monitor sometimes doesn't send events.
Date: Mon, 29 Apr 2013 10:52:57 +0200 [thread overview]
Message-ID: <517E34E9.3050602@open-e.com> (raw)
Hello,
We've got a problem that sometimes mdadm monitor doesn't send events.
Actions are as follows:
start:
create new RAID 5 array
wait until it's rebuilding
stop created array
go to start
Only first time we get "NewArray" event then when new array is created
only "RebuildStarted" event appears. After our analysis we found out
that when we stop an array we get "DeviceDisapeared" event and when we
create a new array we get "RebuildFinished" and then "RebuildStarted"
event. Sometimes those two events don't show up.
The problem is in mdstat_read function:
else if (ent->percent == -1 && w[0] >= '0' && w[0] <= '9' && w[l-1] ==
'%') {
ent->percent = atoi(w);
}
atoi(w) sometimes returns 0 instead -1. It causes that mse->percent = 0 in:
if (mse &&
mse->percent == -1 &&
st->percent >= 0)
alert("RebuildFinished", dev, NULL, mailaddr, mailfrom,
alert_cmd, dosyslog);
and above conditions aren't met. Then in:
if (mse)
st->percent = mse->percent;
st->percent becomes 0 and next conditions where "RebuildStarted" event
should be sent also aren't met:
if (mse &&
st->percent == -1 &&
mse->percent >= 0)
alert("RebuildStarted", dev, NULL, mailaddr, mailfrom,
alert_cmd, dosyslog);
Probably it is fine because rebuild already started and this is what
monitor reads from /proc/mdstat. Shouldn't it return "NewArray" event
instead those two "RebuildFinished" and "RebuildStarted" in this situation?
We use mdadm version 2.5.6 and monitor runs as a daemon with 10s
interval and scan option.
Do we need to restart mdadm monitor when new disk is added to the system
(hotplug)? Do we need to generate config file in such situation or
running mdadm with option --scan is sufficient?
--
Best regards
Arkadiusz Bubała
Open-E Poland Sp. z o.o.
www.open-e.com
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2013-04-29 8:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-29 8:52 Arkadiusz Bubała [this message]
2013-04-30 1:48 ` Mdadm monitor sometimes doesn't send events NeilBrown
2013-05-02 8:34 ` Arkadiusz Bubała
2013-05-02 10:30 ` NeilBrown
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=517E34E9.3050602@open-e.com \
--to=arkadiusz.bubala@open-e.com \
--cc=linux-raid@vger.kernel.org \
/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.