<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }p { margin-top: 0px; margin-bottom: 0px; }div.foxdiv20160420092216278887 { }body { font-size: 16pt; font-family: 微软雅黑; color: rgb(0, 0, 0); line-height: 1.5; }</style>
</head>
<body>
<div><span></span></div>
<blockquote style="margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em;">
<div class="FoxDiv20160420092216278887">
<p style="font-size: 16px;"><span style="line-height: 19px; background-color: rgb(255, 255, 255);"> </span></p>
<p><font face="Consolas" size="3"><span style="line-height: 19px;">Hi everyone</span></font></p>
<p><font face="Consolas" size="3"><span style="line-height: 19px;"><br>
</span></font></p>
<p style="font-size: 16px;"><font face="Consolas" size="2" style="font-size: 16px;"><span style="background-color: rgb(255, 255, 255);"><span style="line-height: 19px;">In ocfs2, when one storage volume can't access, all </span><span style="line-height: 19px;">nodes
which have mounted the </span><span style="line-height: 19px;">volume</span><span style="line-height: 19px;"> will fence self</span></span></font></p>
<p style="font-size: 16px;"><font face="Consolas" size="2" style="font-size: 16px;"><span style="background-color: rgb(255, 255, 255);"><span style="line-height: 19px;">due to write timeout or io error. </span></span></font><span style="font-family: Consolas; line-height: 16.0160007476807px; widows: 1;">So
I make a useful attempt to add autoumount option. </span></p>
<p style="font-size: 16px;"><span style="font-family: Consolas; line-height: 16.0160007476807px; widows: 1;">in the case, </span><span style="font-family: Consolas; line-height: normal; widows: 1;">I know that for some reason umount may be hung.</span><font style="font-family: Consolas; line-height: 1.5; widows: 1;"><span style="line-height: 30px;">Based
on the analysis process of ocfs2 umount,</span></font></p>
<p style="font-size: 16px;"><font style="font-family: Consolas; line-height: 1.5; widows: 1;"><span style="line-height: 30px;">it's </span></font><span style="font-family: Consolas; widows: 1; line-height: 30px;">possible</span><span style="font-family: Consolas; widows: 1; line-height: 30px;"> </span><span style="font-family: Consolas; line-height: 1.5; widows: 1;">to
complete all locks and wake up block events before umounting the volume.</span></p>
<p><span style="font-size: 16px; widows: 1; line-height: 1.5; background-color: rgb(255, 255, 255);"><font face="Consolas" size="2" style="font-size: 16px;">the way is to work well by forever </font></span><font face="Consolas"><span style="font-size: 16px; line-height: 18px; widows: 1;">experimenting
and devising </span><span style="line-height: 18px; widows: 1;"><font size="3">tests.the patch may be release in the recent times.</font></span></font></p>
<p><font face="Consolas"><span style="line-height: 18px; widows: 1;"><font size="3">Is the patch risky and reasonable?
</font></span></font><font face="Consolas" size="3"><span style="line-height: normal;">what do you think ?</span><span style="line-height: normal;"> Thanks</span></font></p>
<p style="font-size: 16px;"><font size="2" face="Consolas" style="background-color: window; line-height: normal; font-size: 16px;">Best regards</font></p>
<p style="font-size: 16px;"><br>
</p>
<p><br>
</p>
<p><font size="2">------------------------------<br>
<br>
Message: 3<br>
Date: Thu, 24 Mar 2016 10:50:31 +0800<br>
From: Junxiao Bi <junxiao.bi@oracle.com><br>
Subject: Re: [Ocfs2-devel] [patch 19/25] ocfs2: o2hb: add negotiate<br>
timer<br>
To: akpm@linux-foundation.org, mfasheh@suse.de, jlbec@evilplan.org,<br>
joseph.qi@huawei.com, ocfs2-devel@oss.oracle.com, ghe@suse.com,<br>
rwxybh@126.com, ryan.ding@oracle.com<br>
Message-ID: <56F355F7.2040004@oracle.com><br>
Content-Type: text/plain; charset=windows-1252<br>
<br>
This is v1 version, I sent out V2 patch set before to fix all code style<br>
issue.<br>
<br>
On 03/24/2016 04:12 AM, akpm@linux-foundation.org wrote:<br>
> From: Junxiao Bi <junxiao.bi@oracle.com><br>
> Subject: ocfs2: o2hb: add negotiate timer<br>
><br>
> This series of patches is to fix the issue that when storage down, all<br>
> nodes will fence self due to write timeout.<br>
><br>
> With this patch set, all nodes will keep going until storage back online,<br>
> except if the following issue happens, then all nodes will do as before to<br>
> fence self.<br>
><br>
> 1. io error got<br>
> 2. network between nodes down<br>
> 3. nodes panic<br>
><br>
><br>
> This patch (of 6):<br>
><br>
> When storage down, all nodes will fence self due to write timeout. The<br>
> negotiate timer is designed to avoid this, with it node will wait until<br>
> storage up again.<br>
><br>
> Negotiate timer working in the following way:<br>
><br>
> 1. The timer expires before write timeout timer, its timeout is half<br>
> of write timeout now. It is re-queued along with write timeout timer.<br>
> If expires, it will send NEGO_TIMEOUT message to master node(node with<br>
> lowest node number). This message does nothing but marks a bit in a<br>
> bitmap recording which nodes are negotiating timeout on master node.<br>
><br>
> 2. If storage down, nodes will send this message to master node, then<br>
> when master node finds its bitmap including all online nodes, it sends<br>
> NEGO_APPROVL message to all nodes one by one, this message will<br>
> re-queue write timeout timer and negotiate timer. For any node doesn't<br>
> receive this message or meets some issue when handling this message, it<br>
> will be fenced. If storage up at any time, o2hb_thread will run and<br>
> re-queue all the timer, nothing will be affected by these two steps.<br>
><br>
> Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com><br>
> Reviewed-by: Ryan Ding <ryan.ding@oracle.com><br>
> Cc: Gang He <ghe@suse.com><br>
> Cc: rwxybh <rwxybh@126.com><br>
> Cc: Mark Fasheh <mfasheh@suse.de><br>
> Cc: Joel Becker <jlbec@evilplan.org><br>
> Cc: Joseph Qi <joseph.qi@huawei.com><br>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org><br>
> ---<br>
><br>
> fs/ocfs2/cluster/heartbeat.c | 52 ++++++++++++++++++++++++++++++---<br>
> 1 file changed, 48 insertions(+), 4 deletions(-)<br>
><br>
> diff -puN fs/ocfs2/cluster/heartbeat.c~ocfs2-o2hb-add-negotiate-timer fs/ocfs2/cluster/heartbeat.c<br>
> --- a/fs/ocfs2/cluster/heartbeat.c~ocfs2-o2hb-add-negotiate-timer<br>
> +++ a/fs/ocfs2/cluster/heartbeat.c<br>
> @@ -272,6 +272,10 @@ struct o2hb_region {<br>
> struct delayed_work hr_write_timeout_work;<br>
> unsigned long hr_last_timeout_start;<br>
> <br>
> + /* negotiate timer, used to negotiate extending hb timeout. */<br>
> + struct delayed_work hr_nego_timeout_work;<br>
> + unsigned long hr_nego_node_bitmap[BITS_TO_LONGS(O2NM_MAX_NODES)];<br>
> +<br>
> /* Used during o2hb_check_slot to hold a copy of the block<br>
> * being checked because we temporarily have to zero out the<br>
> * crc field. */<br>
> @@ -319,7 +323,7 @@ static void o2hb_write_timeout(struct wo<br>
> o2quo_disk_timeout();<br>
> }<br>
> <br>
> -static void o2hb_arm_write_timeout(struct o2hb_region *reg)<br>
> +static void o2hb_arm_timeout(struct o2hb_region *reg)<br>
> {<br>
> /* Arm writeout only after thread reaches steady state */<br>
> if (atomic_read(&reg->hr_steady_iterations) != 0)<br>
> @@ -337,11 +341,50 @@ static void o2hb_arm_write_timeout(struc<br>
> reg->hr_last_timeout_start = jiffies;<br>
> schedule_delayed_work(&reg->hr_write_timeout_work,<br>
> msecs_to_jiffies(O2HB_MAX_WRITE_TIMEOUT_MS));<br>
> +<br>
> + cancel_delayed_work(&reg->hr_nego_timeout_work);<br>
> + /* negotiate timeout must be less than write timeout. */<br>
> + schedule_delayed_work(&reg->hr_nego_timeout_work,<br>
> + msecs_to_jiffies(O2HB_MAX_WRITE_TIMEOUT_MS)/2);<br>
> + memset(reg->hr_nego_node_bitmap, 0, sizeof(reg->hr_nego_node_bitmap));<br>
> }<br>
> <br>
> -static void o2hb_disarm_write_timeout(struct o2hb_region *reg)<br>
> +static void o2hb_disarm_timeout(struct o2hb_region *reg)<br>
> {<br>
> cancel_delayed_work_sync(&reg->hr_write_timeout_work);<br>
> + cancel_delayed_work_sync(&reg->hr_nego_timeout_work);<br>
> +}<br>
> +<br>
> +static void o2hb_nego_timeout(struct work_struct *work)<br>
> +{<br>
> + struct o2hb_region *reg =<br>
> + container_of(work, struct o2hb_region,<br>
> + hr_nego_timeout_work.work);<br>
> + unsigned long live_node_bitmap[BITS_TO_LONGS(O2NM_MAX_NODES)];<br>
> + int master_node;<br>
> +<br>
> + o2hb_fill_node_map(live_node_bitmap, sizeof(live_node_bitmap));<br>
> + /* lowest node as master node to make negotiate decision. */<br>
> + master_node = find_next_bit(live_node_bitmap, O2NM_MAX_NODES, 0);<br>
> +<br>
> + if (master_node == o2nm_this_node()) {<br>
> + set_bit(master_node, reg->hr_nego_node_bitmap);<br>
> + if (memcmp(reg->hr_nego_node_bitmap, live_node_bitmap,<br>
> + sizeof(reg->hr_nego_node_bitmap))) {<br>
> + /* check negotiate bitmap every second to do timeout<br>
> + * approve decision.<br>
> + */<br>
> + schedule_delayed_work(&reg->hr_nego_timeout_work,<br>
> + msecs_to_jiffies(1000));<br>
> +<br>
> + return;<br>
> + }<br>
> +<br>
> + /* approve negotiate timeout request. */<br>
> + } else {<br>
> + /* negotiate timeout with master node. */<br>
> + }<br>
> +<br>
> }<br>
> <br>
> static inline void o2hb_bio_wait_init(struct o2hb_bio_wait_ctxt *wc)<br>
> @@ -1032,7 +1075,7 @@ static int o2hb_do_disk_heartbeat(struct<br>
> /* Skip disarming the timeout if own slot has stale/bad data */<br>
> if (own_slot_ok) {<br>
> o2hb_set_quorum_device(reg);<br>
> - o2hb_arm_write_timeout(reg);<br>
> + o2hb_arm_timeout(reg);<br>
> }<br>
> <br>
> bail:<br>
> @@ -1114,7 +1157,7 @@ static int o2hb_thread(void *data)<br>
> }<br>
> }<br>
> <br>
> - o2hb_disarm_write_timeout(reg);<br>
> + o2hb_disarm_timeout(reg);<br>
> <br>
> /* unclean stop is only used in very bad situation */<br>
> for(i = 0; !reg->hr_unclean_stop && i < reg->hr_blocks; i++)<br>
> @@ -1763,6 +1806,7 @@ static ssize_t o2hb_region_dev_store(str<br>
> }<br>
> <br>
> INIT_DELAYED_WORK(&reg->hr_write_timeout_work, o2hb_write_timeout);<br>
> + INIT_DELAYED_WORK(&reg->hr_nego_timeout_work, o2hb_nego_timeout);<br>
> <br>
> /*<br>
> * A node is considered live after it has beat LIVE_THRESHOLD<br>
> _<br>
><br>
<br>
</font></p>
</div>
</blockquote>
<span style="font-size:7.5pt;font-family:华文细黑;color:gray"><span lang="EN-US">-------------------------------------------------------------------------------------------------------------------------------------<br>
</span>本邮件及其附件含有杭州华三通信技术有限公司的保密信息,仅限于发送给上面地址中列出<span lang="EN-US"><br>
</span>的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、<span lang="EN-US"><br>
</span>或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本<span lang="EN-US"><br>
</span>邮件!<span lang="EN-US"><br>
</span></span><span lang="EN-US" style="font-size:7.5pt;font-family:"Arial","sans-serif";color:gray">This e-mail and its attachments contain confidential information from H3C, which is
<br>
intended only for the person or entity whose address is listed above. Any use of the
<br>
information contained herein in any way (including, but not limited to, total or partial
<br>
disclosure, reproduction, or dissemination) by persons other than the intended <br>
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
<br>
by phone or email immediately and delete it!</span>
</body>
</html>