<div dir="ltr"><pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px">Hi,</pre>
<pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px"><br></pre><pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px">
I use DRBD ver 8.3.15 with configuratios</pre><pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px">
"net – on-congestion = pull-ahead".</pre><pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px">
"protocol C"</pre><pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px">
The connect state “Ahead” and never resync again.</pre><pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px">
"Ahead Stuck" Problem.
</pre><pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px"><br></pre>
<pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px">Fortunately, I can reproduce this problem with two</pre>
<pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px">I/O generaotors "fio" on Virtual Machines of</pre>
<pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px">VMFS5(ESXi Server v5.0u1) in 3 minutes.</pre>
<pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px"><br></pre><pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px">
So, I analisys the Ahead->SourceSync mechanizm by runnning code.</pre><pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px">
<br></pre><pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px">At function got_BarrierACK (drbd_receiver.c) will</pre>
<pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px">try to resync again.</pre>
<pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px">But when mdev->ap_in_flight is negative value, can not resync again.</pre>
<pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px"><br></pre><pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px">
I modified the source "drbd_receiver.c" and the problem is away at</pre><pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px">
the I/O pattern.</pre><pre style="word-wrap:break-word;margin-top:0px;margin-bottom:0px"><font color="#000000" face="courier, courier new, monospace"><span style="font-size:14px;line-height:19.600000381469727px;white-space:pre-wrap"><br>
</span></font></pre><pre style="word-wrap:break-word;margin-top:0px;margin-bottom:0px"><font color="#000000" face="courier, courier new, monospace"><span style="font-size:14px;line-height:19.600000381469727px;white-space:pre-wrap">The value "mdev->ap_in_flight" is used for only for</span></font></pre>
<pre style="word-wrap:break-word;margin-top:0px;margin-bottom:0px"><font color="#000000" face="courier, courier new, monospace"><span style="font-size:14px;line-height:19.600000381469727px;white-space:pre-wrap">"congestion fill", I think. Is this right?</span></font></pre>
<pre style="word-wrap:break-word;margin-top:0px;margin-bottom:0px"><br></pre><pre style="word-wrap:break-word;margin-top:0px;margin-bottom:0px"><font color="#000000" face="courier, courier new, monospace"><span style="font-size:14px;line-height:19.600000381469727px;white-space:pre-wrap">Please check difference below!!</span></font></pre>
<pre style="word-wrap:break-word;margin-top:0px;margin-bottom:0px"><span style="font-size:14px;line-height:19.600000381469727px;white-space:pre-wrap;color:rgb(0,0,0);font-family:courier,'courier new',monospace"><br>
</span></pre><pre style="word-wrap:break-word;margin-top:0px;margin-bottom:0px"><span style="font-size:14px;line-height:19.600000381469727px;white-space:pre-wrap;color:rgb(0,0,0);font-family:courier,'courier new',monospace">==[[Difference]]=================================</span><br>
</pre><pre style="word-wrap:break-word;margin-top:0px;margin-bottom:0px"><font color="#000000" face="courier, courier new, monospace"><span style="font-size:14px;line-height:19.600000381469727px;white-space:pre-wrap"># diff -c drbd_receiver.c.old drbd_receiver.c
*** drbd_receiver.c.old
--- drbd_receiver.c
***************
*** 4815,4831 ****
return true;
}
STATIC int got_BarrierAck(struct drbd_conf *mdev, struct p_header80 *h)
{
struct p_barrier_ack *p = (struct p_barrier_ack *)h;
tl_release(mdev, p->barrier, be32_to_cpu(p->set_size));
if (mdev->state.conn == C_AHEAD &&
! atomic_read(&mdev->ap_in_flight) == 0 &&
!drbd_test_and_set_flag(mdev, AHEAD_TO_SYNC_SOURCE)) {
mdev->start_resync_timer.expires = jiffies + HZ;
add_timer(&mdev->start_resync_timer);
}
return true;
</span></font><span style="font-size:14px;line-height:19.600000381469727px;white-space:pre-wrap;color:rgb(0,0,0);font-family:courier,'courier new',monospace">--- 4815,4846 ----</span></pre><pre style="word-wrap:break-word;margin-top:0px;margin-bottom:0px">
<font color="#000000" face="courier, courier new, monospace"><span style="font-size:14px;line-height:19.600000381469727px;white-space:pre-wrap"> return true;
}
+ /* Fix Ahead Stuck Problem */
STATIC int got_BarrierAck(struct drbd_conf *mdev, struct p_header80 *h)
{
struct p_barrier_ack *p = (struct p_barrier_ack *)h;
tl_release(mdev, p->barrier, be32_to_cpu(p->set_size));
+ /*[Debug] Output Detail */
+ dev_info( DEV, "got_BarrierACK(state.conn=%d,ap_in_flight=%d)\n",
+ mdev->state.conn, atomic_read(&mdev->ap_in_flight) );
+
if (mdev->state.conn == C_AHEAD &&
! /* ap_in_flight is sometime less than zero */
! /* atomic_read(&mdev->ap_in_flight) == 0 && */
! atomic_read(&mdev->ap_in_flight) <= 0 &&
!drbd_test_and_set_flag(mdev, AHEAD_TO_SYNC_SOURCE)) {
+
+ /* Reset ap_in_flight into zero */
+ atomic_set(&mdev->ap_in_flight, 0);
+
mdev->start_resync_timer.expires = jiffies + HZ;
add_timer(&mdev->start_resync_timer);
+
+ /*[Debug] resync timer start*/
+ dev_info(DEV,"start resync timer!!\n" );
+
}
return true;</span></font><span style="color:rgb(0,0,0);font-family:courier,'courier new',monospace;font-size:14px;line-height:19.600000381469727px;white-space:pre-wrap">
</span></pre><div><br></div><pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px">
<br></pre><pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19.600000381469727px">Regards</pre>
</div>