]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PeeringState: renew before activate messages; send after activated
authorSage Weil <sage@redhat.com>
Tue, 6 Aug 2019 03:05:38 +0000 (22:05 -0500)
committerSage Weil <sage@redhat.com>
Sat, 28 Sep 2019 16:51:18 +0000 (11:51 -0500)
We want to renew before we prepeare or send activate messages so that we
have the opportunity to include leases in them (coming soon!).

And we do not want to send explicit lease messages until we know that the
peers have activate.  In particular, we want to avoid queueing a notify
(via pending_activators) and then sending a lease that will arrive before
it.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PeeringState.cc

index 44fac7b54c5ebde2ceba04da528f74cf087509a4..1770e0f2fade9c63721aa44d14f714bacb0b03ee 100644 (file)
@@ -2360,6 +2360,9 @@ void PeeringState::activate(
     purged.intersection_of(to_trim, info.purged_snaps);
     to_trim.subtract(purged);
 
+    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
     // reflect only those snaps that we thought were pruned and were still in
@@ -2508,10 +2511,6 @@ void PeeringState::activate(
       }
     }
 
-    renew_lease(pl->get_mnow());
-    send_lease();
-    schedule_renew_lease();
-
     // Set up missing_loc
     set<pg_shard_t> complete_shards;
     for (set<pg_shard_t>::iterator i = acting_recovery_backfill.begin();
@@ -5832,6 +5831,8 @@ void PeeringState::Active::all_activated_and_committed()
   ceph_assert(!ps->acting_recovery_backfill.empty());
   ceph_assert(ps->blocked_by.empty());
 
+  ps->send_lease();
+
   // Degraded?
   ps->update_calc_stats();
   if (ps->info.stats.stats.sum.num_objects_degraded) {