From 39e8de2d72e2541323f8ed9d8b68075fcbd02701 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 7 Jan 2019 08:34:18 -0600 Subject: [PATCH] msg/async/Protocol*: bump global_seq when retrying connection In the top connect retry in particular we do not bump connect_seq, so it is critical that we bump global_seq so that the two connection attempts are distinguishable at the peer. Signed-off-by: Sage Weil --- src/msg/async/ProtocolV1.cc | 2 ++ src/msg/async/ProtocolV2.cc | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/msg/async/ProtocolV1.cc b/src/msg/async/ProtocolV1.cc index 0c2627b33782a..7ab46873a43ba 100644 --- a/src/msg/async/ProtocolV1.cc +++ b/src/msg/async/ProtocolV1.cc @@ -199,6 +199,7 @@ void ProtocolV1::fault() { backoff.set_from_double(cct->_conf->ms_max_backoff); } + global_seq = messenger->get_global_seq(); state = START_CONNECT; connection->state = AsyncConnection::STATE_CONNECTING; ldout(cct, 10) << __func__ << " waiting " << backoff << dendl; @@ -214,6 +215,7 @@ void ProtocolV1::fault() { } else { ldout(cct, 0) << __func__ << " initiating reconnect" << dendl; connect_seq++; + global_seq = messenger->get_global_seq(); state = START_CONNECT; connection->state = AsyncConnection::STATE_CONNECTING; } diff --git a/src/msg/async/ProtocolV2.cc b/src/msg/async/ProtocolV2.cc index bfa08fc4038a2..587f726f74666 100644 --- a/src/msg/async/ProtocolV2.cc +++ b/src/msg/async/ProtocolV2.cc @@ -196,6 +196,7 @@ void ProtocolV2::fault() { backoff.set_from_double(cct->_conf->ms_max_backoff); } + global_seq = messenger->get_global_seq(); state = START_CONNECT; connection->state = AsyncConnection::STATE_CONNECTING; ldout(cct, 10) << __func__ << " waiting " << backoff << dendl; @@ -211,6 +212,7 @@ void ProtocolV2::fault() { } else { ldout(cct, 0) << __func__ << " initiating reconnect" << dendl; connect_seq++; + global_seq = messenger->get_global_seq(); state = START_CONNECT; connection->state = AsyncConnection::STATE_CONNECTING; } -- 2.39.5