]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Send REJECT to all previously acquired reservations 1600/head
authorDavid Zafman <david.zafman@inktank.com>
Fri, 4 Apr 2014 05:13:17 +0000 (22:13 -0700)
committerDavid Zafman <david.zafman@inktank.com>
Fri, 4 Apr 2014 05:13:17 +0000 (22:13 -0700)
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 <david.zafman@inktank.com>
src/osd/PG.cc
src/osd/PG.h

index 579cb099e724499938e62996ecf54eb8c477039f..49503efc0a3c34d4493de7c43f1034cec0a16eaf 100644 (file)
@@ -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<pg_shard_t>::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);
 
index 2e7a3fd0fdef1f6f787eb00920cdad2b417339ae..f6873add98b341849194d9d52b1e7dc45a467fd9 100644 (file)
@@ -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);