From 72864d9eb8608423db849805d7bbd91d59d2ffd5 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 13 Oct 2008 12:50:06 -0700 Subject: [PATCH] msgr: handle incoming lossy connection when outgoing policy is lossless Basically, try to wake up our lossless connection. The lossy attempt never survives. This avoids worrying about keeping session state alive (connect_seq, etc.). --- src/msg/SimpleMessenger.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/msg/SimpleMessenger.cc b/src/msg/SimpleMessenger.cc index b244e3471d631..be9f23e6dd1fe 100644 --- a/src/msg/SimpleMessenger.cc +++ b/src/msg/SimpleMessenger.cc @@ -873,6 +873,19 @@ int Rank::Pipe::accept() existing->was_session_reset(); goto replace; } + if (lossy_rx) { + if (existing->state == STATE_STANDBY) { + dout(-10) << "accept incoming lossy connection, kicking outgoing lossless" << dendl; + existing->state = STATE_CONNECTING; + existing->cond.Signal(); + } else { + dout(-10) << "accept incoming lossy connection, our lossless has state " << existing->state + << ", doing nothing" << dendl; + } + existing->lock.Unlock(); + rank.lock.Unlock(); + goto fail; + } if (connect.connect_seq < existing->connect_seq) { if (connect.connect_seq == 0) { -- 2.39.5