From: Sage Weil Date: Tue, 6 Aug 2019 03:05:38 +0000 (-0500) Subject: osd/PeeringState: renew before activate messages; send after activated X-Git-Tag: v15.1.0~1379^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c8383b7c9fe7cc2602189a38c5ff461e38d826e7;p=ceph.git osd/PeeringState: renew before activate messages; send after activated 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 --- diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 44fac7b54c5e..1770e0f2fade 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -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 complete_shards; for (set::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) {