From 9cde71f243d430690e90f7e7f42553ab08e918df Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 27 Feb 2017 20:14:40 -0600 Subject: [PATCH] osd: wait based on min_epoch Signed-off-by: Sage Weil --- src/osd/OSD.cc | 2 +- src/osd/PG.cc | 2 +- src/osd/PrimaryLogPG.cc | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 92dacd75af6..b3a09c2b640 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -6361,7 +6361,7 @@ void OSD::dispatch_session_waiting(Session *session, OSDMapRef osdmap) assert(ms_can_fast_dispatch(op->get_req())); const MOSDFastDispatchOp *m = static_cast( op->get_req()); - if (m->get_map_epoch() > osdmap->get_epoch()) { + if (m->get_min_epoch() > osdmap->get_epoch()) { break; } session->waiting_on_map.erase(i++); diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 49bd4863475..4ebeeadc967 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -3452,7 +3452,7 @@ void PG::requeue_map_waiters() epoch_t epoch = get_osdmap()->get_epoch(); auto p = waiting_for_map.begin(); while (p != waiting_for_map.end()) { - if (op_must_wait_for_map(epoch, p->second.front())) { + if (epoch < p->second.front()->min_epoch) { dout(20) << __func__ << " " << p->first << " front op " << p->second.front() << " must still wait, doing nothing" << dendl; diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index c3a790ac6cd..8bf2dca2bf8 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -1564,9 +1564,9 @@ void PrimaryLogPG::do_request( op->mark_delayed("waiting_for_map not empty"); return; } - if (op_must_wait_for_map(get_osdmap()->get_epoch(), op)) { - dout(20) << __func__ << " queue on waiting_for_map " - << op->get_source() << dendl; + if (!have_same_or_newer_map(op->min_epoch)) { + dout(20) << __func__ << " min " << op->min_epoch + << ", queue on waiting_for_map " << op->get_source() << dendl; waiting_for_map[op->get_source()].push_back(op); op->mark_delayed("op must wait for map"); return;