]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge remote-tracking branch 'gh/wip-8880'
authorSage Weil <sage@redhat.com>
Tue, 5 Aug 2014 16:15:12 +0000 (09:15 -0700)
committerSage Weil <sage@redhat.com>
Tue, 5 Aug 2014 16:15:12 +0000 (09:15 -0700)
Conflicts:
src/osd/OSD.cc

1  2 
src/osd/OSD.cc
src/osd/OSD.h

diff --cc src/osd/OSD.cc
index 534df4d19aac9e8f8dca508e94d064a58e783631,058b867fa9bcdb6b70798413b3fb4ca02ce70eea..09432821f950cd641d86602ee5c270b82bbbb645
@@@ -6571,6 -6564,63 +6571,63 @@@ bool OSD::require_osd_peer(OpRequestRef
    return true;
  }
  
 -    cluster_messenger->mark_down(con.get());
+ bool OSD::require_self_aliveness(OpRequestRef& op, epoch_t epoch)
+ {
+   epoch_t up_epoch = service.get_up_epoch();
+   if (epoch < up_epoch) {
+     dout(7) << "from pre-up epoch " << epoch << " < " << up_epoch << dendl;
+     return false;
+   }
+   if (!is_active()) {
+     dout(7) << "still in boot state, dropping message " << *op->get_req() << dendl;
+     return false;
+   }
+   return true;
+ }
+ bool OSD::require_same_peer_instance(OpRequestRef& op, OSDMapRef& map)
+ {
+   Message *m = op->get_req();
+   int from = m->get_source().num();
+   
+   if (!map->have_inst(from) ||
+       (map->get_cluster_addr(from) != m->get_source_inst().addr)) {
+     dout(5) << "from dead osd." << from << ", marking down, "
+           << " msg was " << m->get_source_inst().addr
+           << " expected " << (map->have_inst(from) ?
+                               map->get_cluster_addr(from) : entity_addr_t())
+           << dendl;
+     ConnectionRef con = m->get_connection();
++    con->mark_down();
+     Session *s = static_cast<Session*>(con->get_priv());
+     if (s) {
+       s->session_dispatch_lock.Lock();
+       clear_session_waiting_on_map(s);
+       con->set_priv(NULL);   // break ref <-> session cycle, if any
+       s->session_dispatch_lock.Unlock();
+       s->put();
+     }
+     return false;
+   }
+   return true;
+ }
+ bool OSD::require_up_osd_peer(OpRequestRef& op, OSDMapRef& map,
+                               epoch_t their_epoch)
+ {
+   if (!require_self_aliveness(op, their_epoch)) {
+     return false;
+   } else if (!require_osd_peer(op)) {
+     return false;
+   } else if (map->get_epoch() >= their_epoch &&
+            !require_same_peer_instance(op, map)) {
+     return false;
+   }
+   return true;
+ }
  /*
   * require that we have same (or newer) map, and that
   * the source is the pg primary.
diff --cc src/osd/OSD.h
Simple merge