]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: handle incoming lossy connection when outgoing policy is lossless
authorSage Weil <sage@newdream.net>
Mon, 13 Oct 2008 19:50:06 +0000 (12:50 -0700)
committerSage Weil <sage@newdream.net>
Mon, 13 Oct 2008 19:50:06 +0000 (12:50 -0700)
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

index b244e3471d6313e002f7cb12552e27dc1541ddd6..be9f23e6dd1fe6e3f06ccffba8f8b460960369d2 100644 (file)
@@ -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) {