From be8b2281406e608f96bc45ebf07366be9519c4f1 Mon Sep 17 00:00:00 2001 From: David Zafman Date: Thu, 3 Apr 2014 22:13:17 -0700 Subject: [PATCH] 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 --- src/osd/PG.cc | 23 +++++++++++++++++++++++ src/osd/PG.h | 1 + 2 files changed, 24 insertions(+) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 579cb099e7244..49503efc0a3c3 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 2e7a3fd0fdef1..f6873add98b34 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); -- 2.39.5