summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-07-12 16:21:24 -0700
committerSage Weil <sage@inktank.com>2013-07-24 16:20:36 -0700
commit48105a32605aa59b6970eb89fce4ecc4201e8d04 (patch)
tree741cae6c374b901caaf6fea6e40aac0687a4fe0b
parent1eab069017ce6b71e4bc2bb9679dbe31b50ae938 (diff)
downloadceph-48105a32605aa59b6970eb89fce4ecc4201e8d04.tar.gz
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 <sage@inktank.com> Reviewed-by: Greg Farnum <greg@inktank.com> (cherry picked from commit 495ee108dbb39d63e44cd3d4938a6ec7d11b12e3)
-rw-r--r--src/msg/Pipe.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/msg/Pipe.cc b/src/msg/Pipe.cc
index bb8d7bdb427..16b6de88502 100644
--- a/src/msg/Pipe.cc
+++ b/src/msg/Pipe.cc
@@ -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;