]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/PG: move reject_reservation out of RemoteReservationRejected reaction
authorSage Weil <sage@redhat.com>
Sun, 1 Oct 2017 19:59:31 +0000 (14:59 -0500)
committerSage Weil <sage@redhat.com>
Sun, 1 Oct 2017 20:06:19 +0000 (15:06 -0500)
The RemoteReservationRejected event is also submitted when we are a
replica or backfill target and get a MBackfillReserve REJECT message
because the primary canceled or was preempted.  In that case, we don't
want to send a REJECT back to the primary; we only need to send it in the
cases where *we*, locally, decide to reject.  Move the call to those call
sites.

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

index 432d536b6212245697ecf59e94964a11077d7728..762d83d9d1d67f35506e18a871aa4fb5a99fe262 100644 (file)
@@ -6485,11 +6485,13 @@ PG::RecoveryState::RepNotRecovering::react(const RequestBackfillPrio &evt)
       (rand()%1000 < (pg->cct->_conf->osd_debug_reject_backfill_probability*1000.0))) {
     ldout(pg->cct, 10) << "backfill reservation rejected: failure injection"
                       << dendl;
+    pg->reject_reservation();
     post_event(RemoteReservationRejected());
   } else if (!pg->cct->_conf->osd_debug_skip_full_check_in_backfill_reservation &&
       pg->osd->check_backfill_full(ss)) {
     ldout(pg->cct, 10) << "backfill reservation rejected: "
                       << ss.str() << dendl;
+    pg->reject_reservation();
     post_event(RemoteReservationRejected());
   } else {
     pg->osd->remote_reserver.request_reservation(
@@ -6519,6 +6521,7 @@ PG::RecoveryState::RepWaitBackfillReserved::react(const RemoteBackfillReserved &
       (rand()%1000 < (pg->cct->_conf->osd_debug_reject_backfill_probability*1000.0))) {
     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();
@@ -6526,6 +6529,7 @@ PG::RecoveryState::RepWaitBackfillReserved::react(const RemoteBackfillReserved &
             pg->osd->check_backfill_full(ss)) {
     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();
@@ -6545,7 +6549,6 @@ boost::statechart::result
 PG::RecoveryState::RepWaitBackfillReserved::react(const RemoteReservationRejected &evt)
 {
   PG *pg = context< RecoveryMachine >().pg;
-  pg->reject_reservation();
   return transit<RepNotRecovering>();
 }