]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/PeeringState: disable read lease until require_osd_release >= octopus
authorSage Weil <sage@redhat.com>
Wed, 2 Oct 2019 13:58:32 +0000 (08:58 -0500)
committerSage Weil <sage@redhat.com>
Wed, 2 Oct 2019 13:58:32 +0000 (08:58 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PeeringState.cc
src/osd/PrimaryLogPG.cc

index ae55a3a73dc59c061b4e014f7f98f53fee108fbd..2c0b26274fa2d33d6eb9c288d159fc719f0b369f 100644 (file)
@@ -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
index 52386a344ba580c9d8185cbde3fc80b1703814bc..7f5a0c56b2c9aad294551f5671d90f6640245561 100644 (file)
@@ -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
   }