[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 6/7] sheep: remove duplicate recovery complete no
From: |
Liu Yuan |
Subject: |
[Qemu-devel] [PATCH v2 6/7] sheep: remove duplicate recovery complete notification |
Date: |
Fri, 29 Mar 2013 13:42:23 +0800 |
From: Liu Yuan <address@hidden>
Signed-off-by: Liu Yuan <address@hidden>
---
sheep/ops.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/sheep/ops.c b/sheep/ops.c
index 3839437..204befd 100644
--- a/sheep/ops.c
+++ b/sheep/ops.c
@@ -624,7 +624,19 @@ static int cluster_recovery_completion(const struct sd_req
*req,
nr_recovereds = 0;
}
- recovereds[nr_recovereds++] = *(struct sd_node *)node;
+ /*
+ * Disk failure might send duplicate notication, ingore it.
+ *
+ * We can't simply stop disk recovery from sending notication because
+ * disk recovery might supersed node recovery, which indeed need
+ * to send notication
+ */
+ for (i = 0; i < nr_recovereds; i++)
+ if (!node_id_cmp(&node->nid, &recovereds[i].nid)) {
+ sd_dprintf("duplicate %s", node_to_str(node));
+ return SD_RES_SUCCESS;
+ }
+ recovereds[nr_recovereds++] = *node;
qsort(recovereds, nr_recovereds, sizeof(*recovereds), node_id_cmp);
sd_dprintf("%s is recovered at epoch %d", node_to_str(node), epoch);
--
1.7.9.5
- [Qemu-devel] [PATCH v2 0/7] md: add hot-plug and hot-unplug support, Liu Yuan, 2013/03/29
- [Qemu-devel] [PATCH v2 1/7] md: add support for simultaneous disk failure on the same node, Liu Yuan, 2013/03/29
- [Qemu-devel] [PATCH v2 2/7] tests/055: test simultaneous multiple disk failures on the same node, Liu Yuan, 2013/03/29
- [Qemu-devel] [PATCH v2 3/7] net: enlarge connect_to_addr() scope, Liu Yuan, 2013/03/29
- [Qemu-devel] [PATCH v2 4/7] md: add hot-plug and hot-unplug support, Liu Yuan, 2013/03/29
- [Qemu-devel] [PATCH v2 5/7] collie: add new commands to manipulate multi-disks, Liu Yuan, 2013/03/29
- [Qemu-devel] [PATCH v2 6/7] sheep: remove duplicate recovery complete notification,
Liu Yuan <=
- [Qemu-devel] [PATCH v2 7/7] tsets: add 057 to test md hot-plug and hot-unplug, Liu Yuan, 2013/03/29
- Re: [Qemu-devel] [PATCH v2 0/7] md: add hot-plug and hot-unplug support, Liu Yuan, 2013/03/29