From 764cce1578e84d561843091e0f8c86367e9b4371 Mon Sep 17 00:00:00 2001 From: Xuehan Xu Date: Sat, 21 Apr 2018 09:40:07 +0800 Subject: [PATCH] msgr/simple: set Pipe::out_seq to in_seq of the connecting side If the current pipe has just replaced a newly created "existing pipe", its out_q would be empty, in which case out_seq cannot be move up to in_seq of the connecting side and later requests forwarded to leader wouldn't be acked. Fixes: http://tracker.ceph.com/issues/23807 Signed-off-by: Xuehan Xu --- src/msg/async/AsyncConnection.cc | 4 +++- src/msg/simple/Pipe.cc | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/msg/async/AsyncConnection.cc b/src/msg/async/AsyncConnection.cc index c6384e34165f8..91d9ba43b4893 100644 --- a/src/msg/async/AsyncConnection.cc +++ b/src/msg/async/AsyncConnection.cc @@ -1972,8 +1972,10 @@ void AsyncConnection::discard_requeued_up_to(uint64_t seq) { ldout(async_msgr->cct, 10) << __func__ << " " << seq << dendl; std::lock_guard l(write_lock); - if (out_q.count(CEPH_MSG_PRIO_HIGHEST) == 0) + if (out_q.count(CEPH_MSG_PRIO_HIGHEST) == 0) { + out_seq = seq; return; + } list >& rq = out_q[CEPH_MSG_PRIO_HIGHEST]; while (!rq.empty()) { pair p = rq.front(); diff --git a/src/msg/simple/Pipe.cc b/src/msg/simple/Pipe.cc index 2c8b1ae63d3df..26f562f1e4516 100644 --- a/src/msg/simple/Pipe.cc +++ b/src/msg/simple/Pipe.cc @@ -1411,8 +1411,10 @@ void Pipe::requeue_sent() void Pipe::discard_requeued_up_to(uint64_t seq) { ldout(msgr->cct, 10) << "discard_requeued_up_to " << seq << dendl; - if (out_q.count(CEPH_MSG_PRIO_HIGHEST) == 0) + if (out_q.count(CEPH_MSG_PRIO_HIGHEST) == 0) { + out_seq = seq; return; + } list& rq = out_q[CEPH_MSG_PRIO_HIGHEST]; while (!rq.empty()) { Message *m = rq.front(); -- 2.39.5