From 0c94e25d0487c86d1fec479fd723e10cf1226339 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 2 Oct 2019 08:58:32 -0500 Subject: [PATCH] osd/PeeringState: disable read lease until require_osd_release >= octopus Signed-off-by: Sage Weil --- src/osd/PeeringState.cc | 15 +++++++++++++-- src/osd/PrimaryLogPG.cc | 7 +++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index ae55a3a73dc..2c0b26274fa 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -1135,6 +1135,9 @@ void PeeringState::send_lease() void PeeringState::proc_lease(const pg_lease_t& l) { + if (get_osdmap()->require_osd_release < ceph_release_t::octopus) { + return; + } if (!is_nonprimary()) { return; } @@ -1175,6 +1178,9 @@ void PeeringState::proc_lease(const pg_lease_t& l) void PeeringState::proc_lease_ack(int from, const pg_lease_ack_t& a) { + if (get_osdmap()->require_osd_release < ceph_release_t::octopus) { + return; + } auto now = pl->get_mnow(); bool was_min = false; for (unsigned i = 0; i < acting.size(); ++i) { @@ -1220,6 +1226,9 @@ void PeeringState::recalc_readable_until() bool PeeringState::check_prior_readable_down_osds(const OSDMapRef& map) { + if (get_osdmap()->require_osd_release < ceph_release_t::octopus) { + return false; + } bool changed = false; auto p = prior_readable_down_osds.begin(); while (p != prior_readable_down_osds.end()) { @@ -2372,8 +2381,10 @@ void PeeringState::activate( purged.intersection_of(to_trim, info.purged_snaps); to_trim.subtract(purged); - renew_lease(pl->get_mnow()); - schedule_renew_lease(); + if (get_osdmap()->require_osd_release >= ceph_release_t::octopus) { + renew_lease(pl->get_mnow()); + schedule_renew_lease(); + } // adjust purged_snaps: PG may have been inactive while snaps were pruned // from the removed_snaps_queue in the osdmap. update local purged_snaps diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 52386a344ba..7f5a0c56b2c 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -754,6 +754,10 @@ void PrimaryLogPG::maybe_force_recovery() bool PrimaryLogPG::check_laggy(OpRequestRef& op) { + if (get_osdmap()->require_osd_release < ceph_release_t::octopus) { + dout(10) << __func__ << " require_osd_release < octopus" << dendl; + return true; + } if (state_test(PG_STATE_WAIT)) { dout(10) << __func__ << " PG is WAIT state" << dendl; } else if (!state_test(PG_STATE_LAGGY)) { @@ -784,6 +788,9 @@ bool PrimaryLogPG::check_laggy(OpRequestRef& op) bool PrimaryLogPG::check_laggy_requeue(OpRequestRef& op) { + if (get_osdmap()->require_osd_release < ceph_release_t::octopus) { + return true; + } if (!state_test(PG_STATE_WAIT) && !state_test(PG_STATE_LAGGY)) { return true; // not laggy } -- 2.39.5