osd/PG: cancel local reservation in RemoteReservationRejected handler

We can get a RemoteReservationRejected event either because *we* decide
to reject, or because we get a REJECT from the primary that means "cancel"
(e.g., because recovery/backfill was preempted there).  In both cases we
want to cancel our remote_reservation.

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2017-10-01 15:01:05 -05:00
parent 57d18f0e8d
commit f5809afb0f

View File

@ -6522,7 +6522,6 @@ PG::RecoveryState::RepWaitBackfillReserved::react(const RemoteBackfillReserved &
ldout(pg->cct, 10) << "backfill reservation rejected after reservation: "
<< "failure injection" << dendl;
pg->reject_reservation();
pg->osd->remote_reserver.cancel_reservation(pg->info.pgid);
post_event(RemoteReservationRejected());
return discard_event();
} else if (!pg->cct->_conf->osd_debug_skip_full_check_in_backfill_reservation &&
@ -6530,7 +6529,6 @@ PG::RecoveryState::RepWaitBackfillReserved::react(const RemoteBackfillReserved &
ldout(pg->cct, 10) << "backfill reservation rejected after reservation: "
<< ss.str() << dendl;
pg->reject_reservation();
pg->osd->remote_reserver.cancel_reservation(pg->info.pgid);
post_event(RemoteReservationRejected());
return discard_event();
} else {
@ -6549,6 +6547,7 @@ boost::statechart::result
PG::RecoveryState::RepWaitBackfillReserved::react(const RemoteReservationRejected &evt)
{
PG *pg = context< RecoveryMachine >().pg;
pg->osd->remote_reserver.cancel_reservation(pg->info.pgid);
return transit<RepNotRecovering>();
}