]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/Pipe: fix RECONNECT_SEQ behavior
authorSage Weil <sage@inktank.com>
Fri, 12 Jul 2013 23:21:24 +0000 (16:21 -0700)
committerSage Weil <sage@inktank.com>
Wed, 24 Jul 2013 23:20:36 +0000 (16:20 -0700)
Calling handle_ack() here has no effect because we have already
spliced sent messages back into our out queue.  Instead, pull them out
of there and discard.  Add a few assertions along the way.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
(cherry picked from commit 495ee108dbb39d63e44cd3d4938a6ec7d11b12e3)

src/msg/Pipe.cc

index bb8d7bdb427ba95cb1639c67989e13bc86af1e92..16b6de8850202ef021963da76653668e5abda58f 100644 (file)
@@ -1001,7 +1001,15 @@ int Pipe::connect()
           ldout(msgr->cct,2) << "connect read error on newly_acked_seq" << dendl;
           goto fail_locked;
         }
-        handle_ack(newly_acked_seq);
+       while (newly_acked_seq > out_seq) {
+         Message *m = _get_next_outgoing();
+         assert(m);
+         ldout(msgr->cct,2) << " discarding previously sent " << m->get_seq()
+                            << " " << *m << dendl;
+         assert(m->get_seq() <= newly_acked_seq);
+         m->put();
+         ++out_seq;
+       }
         if (tcp_write((char*)&in_seq, sizeof(in_seq)) < 0) {
           ldout(msgr->cct,2) << "connect write error on in_seq" << dendl;
           goto fail_locked;