From: David Zafman Date: Fri, 4 Apr 2014 05:13:17 +0000 (-0700) Subject: osd: Send REJECT to all previously acquired reservations X-Git-Tag: v0.79~11^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1600%2Fhead;p=ceph.git osd: Send REJECT to all previously acquired reservations When getting a REJECT from a backfill target, tell already GRANTed targets to go back to RepNotRecovering state by sending a REJECT to them. Fixes: #7922 Signed-off-by: David Zafman --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 579cb099e724..49503efc0a3c 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -5714,6 +5714,29 @@ PG::RecoveryState::WaitRemoteBackfillReserved::react(const RemoteReservationReje { PG *pg = context< RecoveryMachine >().pg; pg->osd->local_reserver.cancel_reservation(pg->info.pgid); + + // Send REJECT to all previously acquired reservations + set::const_iterator it, begin, end, next; + begin = context< Active >().sorted_backfill_set.begin(); + end = context< Active >().sorted_backfill_set.end(); + assert(begin != end); + for (next = it = begin, ++next ; next != backfill_osd_it; ++it, ++next) { + //The primary never backfills itself + assert(*it != pg->pg_whoami); + ConnectionRef con = pg->osd->get_con_osd_cluster( + it->osd, pg->get_osdmap()->get_epoch()); + if (con) { + if (con->has_feature(CEPH_FEATURE_BACKFILL_RESERVATION)) { + pg->osd->send_message_osd_cluster( + new MBackfillReserve( + MBackfillReserve::REJECT, + spg_t(pg->info.pgid.pgid, it->shard), + pg->get_osdmap()->get_epoch()), + con.get()); + } + } + } + pg->state_clear(PG_STATE_BACKFILL_WAIT); pg->state_set(PG_STATE_BACKFILL_TOOFULL); diff --git a/src/osd/PG.h b/src/osd/PG.h index 2e7a3fd0fdef..f6873add98b3 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -1650,6 +1650,7 @@ public: struct RepRecovering : boost::statechart::state< RepRecovering, ReplicaActive >, NamedState { typedef boost::mpl::list< boost::statechart::transition< RecoveryDone, RepNotRecovering >, + boost::statechart::transition< RemoteReservationRejected, RepNotRecovering >, boost::statechart::custom_reaction< BackfillTooFull > > reactions; RepRecovering(my_context ctx);