osd->reply_op_error(op, -EPERM);
return;
}
- if (must_delay_request(op)) {
+ if (op_must_wait_for_map(get_osdmap(), op)) {
dout(20) << " waiting for map on " << op << dendl;
waiting_for_map.push_back(op);
return;
return false;
}
-bool PG::must_delay_request(OpRequestRef op)
+bool PG::op_must_wait_for_map(OSDMapRef curmap, OpRequestRef op)
{
switch (op->request->get_type()) {
case CEPH_MSG_OSD_OP:
return !have_same_or_newer_map(
+ curmap,
static_cast<MOSDOp*>(op->request)->get_map_epoch());
case MSG_OSD_SUBOP:
return !have_same_or_newer_map(
+ curmap,
static_cast<MOSDSubOp*>(op->request)->map_epoch);
case MSG_OSD_SUBOPREPLY:
return !have_same_or_newer_map(
+ curmap,
static_cast<MOSDSubOpReply*>(op->request)->map_epoch);
case MSG_OSD_PG_SCAN:
return !have_same_or_newer_map(
+ curmap,
static_cast<MOSDPGScan*>(op->request)->map_epoch);
case MSG_OSD_PG_BACKFILL:
return !have_same_or_newer_map(
+ curmap,
static_cast<MOSDPGBackfill*>(op->request)->map_epoch);
}
assert(0);
bool can_discard_backfill(OpRequestRef op);
bool can_discard_request(OpRequestRef op);
- bool must_delay_request(OpRequestRef op);
+ static bool op_must_wait_for_map(OSDMapRef curmap, OpRequestRef op);
static bool split_request(OpRequestRef op, unsigned match, unsigned bits);
bool old_peering_evt(CephPeeringEvtRef evt) {
return old_peering_msg(evt->get_epoch_sent(), evt->get_epoch_requested());
}
+ static bool have_same_or_newer_map(OSDMapRef osdmap, epoch_t e) {
+ return e <= osdmap->get_epoch();
+ }
bool have_same_or_newer_map(epoch_t e) {
return e <= get_osdmap()->get_epoch();
}