return true;
}
+bool OSD::require_self_aliveness(OpRequestRef& op, epoch_t 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_up_osd_peer(OpRequestRef& op, OSDMapRef& map,
epoch_t their_epoch)
{
int from = op->get_req()->get_source().num();
- if (!require_osd_peer(op)) {
+ if (!require_self_aliveness(op, their_epoch)) {
+ return false;
+ } else if (!require_osd_peer(op)) {
return false;
} else if (map->get_epoch() >= their_epoch &&
(!map->have_inst(from) ||
return false;
}
- if (epoch < up_epoch) {
- dout(7) << "from pre-up epoch " << epoch << " < " << up_epoch << dendl;
+ if (!require_self_aliveness(op, epoch)) {
return false;
}
}
}
- // ok, we have at least as new a map as they do. are we (re)booting?
- if (!is_active()) {
- dout(7) << "still in boot state, dropping message " << *m << dendl;
- return false;
- }
-
return true;
}
bool require_mon_peer(Message *m);
bool require_osd_peer(OpRequestRef& op);
+ /***
+ * Verifies that we were alive in the given epoch, and that
+ * still are.
+ */
+ bool require_self_aliveness(OpRequestRef& op, epoch_t alive_since);
bool require_up_osd_peer(OpRequestRef& Op, OSDMapRef& map,
epoch_t their_epoch);