]> 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>
Thu, 5 Oct 2017 19:38:50 +0000 (14:38 -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>
(cherry picked from commit ab8f1d291216c07fed7b661896b0a0c1279f50eb)

src/osd/PG.cc
src/osd/PG.h

index 6f130a0979e04aca52120f58eb4e4c6f59c3a116..0955cbbcd6c6c11e35f708c22b86771526c69e1e 100644 (file)
@@ -6678,6 +6678,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 2bbe927aa7c47693a41fe38cddec0cdc9d86b62f..c8d6b9fa21023ad905f3462e45833054b826eba8 100644 (file)
@@ -2006,11 +2006,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 {