• Junxiao Bi's avatar
    ocfs2: o2net: don't shutdown connection when idle timeout · c43c363d
    Junxiao Bi authored
    This patch series is to fix a possible message lost bug in ocfs2 when
    network go bad.  This bug will cause ocfs2 hung forever even network
    become good again.
    
    The messages may lost in this case.  After the tcp connection is
    established between two nodes, an idle timer will be set to check its
    state periodically, if no messages are received during this time, idle
    timer will timeout, it will shutdown the connection and try to
    reconnect, so pending messages in tcp queues will be lost.  This
    messages may be from dlm.  Dlm may get hung in this case.  This may
    cause the whole ocfs2 cluster hung.
    
    This is very possible to happen when network state goes bad.  Do the
    reconnect is useless, it will fail if network state is still bad.  Just
    waiting there for network recovering may be a good idea, it will not
    lost messages and some node will be fenced until cluster goes into
    split-brain state, for this case, Tcp user timeout is used to override
    the tcp retransmit timeout.  It will timeout after 25 days, user should
    have notice this through the provided log and fix the network, if they
    don't, ocfs2 will fall back to original reconnect way.
    
    This patch (of 3):
    
    Some messages in the tcp queue maybe lost if we shutdown the connection
    and reconnect when idle timeout.  If packets lost and reconnect success,
    then the ocfs2 cluster maybe hung.
    
    To fix this, we can leave the connection there and do the fence decision
    when idle timeout, if network recover before fence dicision is made, the
    connection survive without lost any messages.
    
    This bug can be saw when network state go bad.  It may cause ocfs2 hung
    forever if some packets lost.  With this fix, ocfs2 will recover from
    hung if network becomes good again.
    Signed-off-by: default avatarJunxiao Bi <junxiao.bi@oracle.com>
    Reviewed-by: default avatarSrinivas Eeda <srinivas.eeda@oracle.com>
    Reviewed-by: default avatarMark Fasheh <mfasheh@suse.de>
    Cc: Joel Becker <jlbec@evilplan.org>
    Cc: Joseph Qi <joseph.qi@huawei.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    c43c363d
tcp.c 59.1 KB