From c8383b7c9fe7cc2602189a38c5ff461e38d826e7 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 5 Aug 2019 22:05:38 -0500 Subject: [PATCH] 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 --- src/osd/PeeringState.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 44fac7b54c5eb..1770e0f2fade9 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) { -- 2.39.5