From 495ee108dbb39d63e44cd3d4938a6ec7d11b12e3 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 12 Jul 2013 16:21:24 -0700 Subject: [PATCH] msg/Pipe: fix RECONNECT_SEQ behavior 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 Reviewed-by: Greg Farnum --- src/msg/Pipe.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/msg/Pipe.cc b/src/msg/Pipe.cc index db5f709ddda..6714b9f7b6e 100644 --- a/src/msg/Pipe.cc +++ b/src/msg/Pipe.cc @@ -1007,7 +1007,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; -- 2.47.3