]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr/simple: set Pipe::out_seq to in_seq of the connecting side 21585/head
authorXuehan Xu <xuxuehan@360.cn>
Sat, 21 Apr 2018 01:40:07 +0000 (09:40 +0800)
committerXuehan Xu <xuxuehan@360.cn>
Tue, 24 Apr 2018 03:34:11 +0000 (11:34 +0800)
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 <xuxuehan@360.cn>
src/msg/async/AsyncConnection.cc
src/msg/simple/Pipe.cc

index c6384e34165f8ab89872c03de477597ff25a8f28..91d9ba43b48931bd0dba96e0755525164cc3fd71 100644 (file)
@@ -1972,8 +1972,10 @@ void AsyncConnection::discard_requeued_up_to(uint64_t seq)
 {
   ldout(async_msgr->cct, 10) << __func__ << " " << seq << dendl;
   std::lock_guard<std::mutex> 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<pair<bufferlist, Message*> >& rq = out_q[CEPH_MSG_PRIO_HIGHEST];
   while (!rq.empty()) {
     pair<bufferlist, Message*> p = rq.front();
index 2c8b1ae63d3df8483dddac33d535a6090a66a57d..26f562f1e4516b288a7766098f33386b5a398d7f 100644 (file)
@@ -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<Message*>& rq = out_q[CEPH_MSG_PRIO_HIGHEST];
   while (!rq.empty()) {
     Message *m = rq.front();