From: Sage Weil Date: Sun, 1 Oct 2017 20:04:34 +0000 (-0500) Subject: osd/PG: handle RecoveryReservationRejected in RepWaitRecoveryReserved X-Git-Tag: v12.2.2~157^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=260ab6009cdce0d846685e4c7789336db22885f1;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 (cherry picked from commit ab8f1d291216c07fed7b661896b0a0c1279f50eb) --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 6f130a0979e0..0955cbbcd6c6 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -6678,6 +6678,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 2bbe927aa7c4..c8d6b9fa2102 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -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 {