From: Sage Weil Date: Tue, 23 Jul 2019 19:01:34 +0000 (-0500) Subject: osd: send ops back to primary if replica is not readable X-Git-Tag: v15.1.0~1379^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ca80c3fc213f8c82b1805cb9d866caf6f167253a;p=ceph.git osd: send ops back to primary if replica is not readable This is the simplest strategy--much simpler than queueing them and waking them up again later. Signed-off-by: Sage Weil --- diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 98e70ac1f36c..07c0e252b367 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -1145,7 +1145,8 @@ void PeeringState::proc_lease(const pg_lease_t& l) if (ru > readable_until) { readable_until = ru; psdout(20) << __func__ << " readable_until now " << readable_until << dendl; -#warning fixme: wake up replica? + // NOTE: if we ever decide to block/queue ops on the replica, + // we'll need to wake them up here. } ceph::signedspan ruub; diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index de99a66acb95..2947c51f37c6 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -767,6 +767,11 @@ bool PrimaryLogPG::check_laggy(OpRequestRef& op) << " mnow " << mnow << " > readable_until " << ru << dendl; + if (!is_primary()) { + osd->reply_op_error(op, -EAGAIN); + return false; + } + // go to laggy state state_set(PG_STATE_LAGGY); publish_stats_to_osd();