if (HAVE_FEATURE(upacting_features, SERVER_OCTOPUS)) {
renew_lease(pl->get_mnow());
- schedule_renew_lease();
+ // do not schedule until we are actually activated
}
// adjust purged_snaps: PG may have been inactive while snaps were pruned
ceph_assert(!ps->acting_recovery_backfill.empty());
ceph_assert(ps->blocked_by.empty());
+ if (HAVE_FEATURE(ps->upacting_features, SERVER_OCTOPUS)) {
+ // this is overkill when the activation is quick, but when it is slow it
+ // is important, because the lease was renewed by the activate itself but we
+ // don't know how long ago that was, and simply scheduling now may leave
+ // a gap in lease coverage. keep it simple and aggressively renew.
+ ps->renew_lease(pl->get_mnow());
+ ps->send_lease();
+ ps->schedule_renew_lease();
+ }
+
// Degraded?
ps->update_calc_stats();
if (ps->info.stats.stats.sum.num_objects_degraded) {