]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: handle RecoveryReservationRejected in RepWaitRecoveryReserved
authorSage Weil <sage@redhat.com>
Sun, 1 Oct 2017 20:04:34 +0000 (15:04 -0500)
committerSage Weil <sage@redhat.com>
Sun, 1 Oct 2017 20:06:22 +0000 (15:06 -0500)
This state is analogous to RepWaitBackfillReserved; just like we do there
we want to handle the REJECT from the primary by canceling our local
remote_reservation.

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

index 338fd9a6d233c81153f114a67719c5972833de9e..08f4e2a72518d56f7b0bc08dd618715ac5c596af 100644 (file)
@@ -6459,6 +6459,15 @@ PG::RecoveryState::RepWaitRecoveryReserved::react(const RemoteRecoveryReserved &
   return transit<RepRecovering>();
 }
 
+boost::statechart::result
+PG::RecoveryState::RepWaitRecoveryReserved::react(
+  const RemoteReservationRejected &evt)
+{
+  PG *pg = context< RecoveryMachine >().pg;
+  pg->osd->remote_reserver.cancel_reservation(pg->info.pgid);
+  return transit<RepNotRecovering>();
+}
+
 void PG::RecoveryState::RepWaitRecoveryReserved::exit()
 {
   context< RecoveryMachine >().log_exit(state_name, enter_time);
index 02c52d7dc24f008a1c090f047cb46c98f3bfe041..abaef117a8054fd077f38c2e19f26de12d23a7a9 100644 (file)
@@ -2001,11 +2001,13 @@ public:
 
     struct RepWaitRecoveryReserved : boost::statechart::state< RepWaitRecoveryReserved, ReplicaActive >, NamedState {
       typedef boost::mpl::list<
-       boost::statechart::custom_reaction< RemoteRecoveryReserved >
+       boost::statechart::custom_reaction< RemoteRecoveryReserved >,
+       boost::statechart::custom_reaction< RemoteReservationRejected >
        > reactions;
       explicit RepWaitRecoveryReserved(my_context ctx);
       void exit();
       boost::statechart::result react(const RemoteRecoveryReserved &evt);
+      boost::statechart::result react(const RemoteReservationRejected &evt);
     };
 
     struct RepNotRecovering : boost::statechart::state< RepNotRecovering, ReplicaActive>, NamedState {