From: Sage Weil Date: Sun, 1 Oct 2017 20:04:34 +0000 (-0500) Subject: osd/PG: handle RecoveryReservationRejected in RepWaitRecoveryReserved X-Git-Tag: v13.0.1~656^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ab8f1d291216c07fed7b661896b0a0c1279f50eb;p=ceph.git osd/PG: handle RecoveryReservationRejected in RepWaitRecoveryReserved 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 --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 338fd9a6d23..08f4e2a7251 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -6459,6 +6459,15 @@ PG::RecoveryState::RepWaitRecoveryReserved::react(const RemoteRecoveryReserved & return transit(); } +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(); +} + void PG::RecoveryState::RepWaitRecoveryReserved::exit() { context< RecoveryMachine >().log_exit(state_name, enter_time); diff --git a/src/osd/PG.h b/src/osd/PG.h index 02c52d7dc24..abaef117a80 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -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 {