]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Rename backfill reservation reject names to reflect too full use 29999/head
authorDavid Zafman <dzafman@redhat.com>
Fri, 23 Aug 2019 15:54:28 +0000 (08:54 -0700)
committerNathan Cutler <ncutler@suse.com>
Sat, 12 Oct 2019 09:03:52 +0000 (11:03 +0200)
The only reason for a reject is in a too full condition.  Now that we
have two types of revoke, let's make this clearer.

Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 0115595c1d1366cb3633e9dc6730496b9e5cf5c4)

Conflicts:
src/osd/PeeringEvent.h
- file does not exist in nautilus due to refactoring: made the changes manually to src/osd/PGPeeringEvent.h
src/osd/PeeringState.cc
src/osd/PeeringState.h
- files do not exist in nautilus due to refactoring: made the changes manually to src/osd/PG.{cc,h}
  by doing:
      s/RejectRemoteReservation/RejectTooFullRemoteReservation/g
      s/RemoteReservationRejected/RemoteReservationRejectedTooFull/g

src/messages/MBackfillReserve.h
src/osd/PG.cc
src/osd/PG.h
src/osd/PGPeeringEvent.h

index 1b4e021a9a38b0acc8fc2586481df5cb6e5fb2a3..ac813293aa8ca320c8d971f785903ba92fc6f53d 100644 (file)
@@ -30,7 +30,7 @@ public:
   enum {
     REQUEST = 0,   // primary->replica: please reserve a slot
     GRANT = 1,     // replica->primary: ok, i reserved it
-    REJECT = 2,    // replica->primary: sorry, try again later (*)
+    REJECT_TOOFULL = 2,    // replica->primary: too full, sorry, try again later (*)
     RELEASE = 3,   // primary->replcia: release the slot i reserved before
     REVOKE_TOOFULL = 4,   // replica->primary: too full, stop backfilling
     REVOKE = 5,    // replica->primary: i'm taking back the slot i gave you
@@ -63,7 +63,7 @@ public:
        query_epoch,
        query_epoch,
        RemoteBackfillReserved());
-    case REJECT:
+    case REJECT_TOOFULL:
       // NOTE: this is replica -> primary "i reject your request"
       //      and also primary -> replica "cancel my previously-granted request"
       //                                  (for older peers)
@@ -72,7 +72,7 @@ public:
       return new PGPeeringEvent(
        query_epoch,
        query_epoch,
-       RemoteReservationRejected());
+       RemoteReservationRejectedTooFull());
     case RELEASE:
       return new PGPeeringEvent(
        query_epoch,
@@ -119,8 +119,8 @@ public:
     case GRANT:
       out << "GRANT";
       break;
-    case REJECT:
-      out << "REJECT ";
+    case REJECT_TOOFULL:
+      out << "REJECT_TOOFULL";
       break;
     case RELEASE:
       out << "RELEASE";
@@ -160,7 +160,7 @@ public:
       encode(pgid.pgid, payload);
       encode(query_epoch, payload);
       encode((type == RELEASE || type == REVOKE_TOOFULL || type == REVOKE) ?
-              REJECT : type, payload);
+              REJECT_TOOFULL : type, payload);
       encode(priority, payload);
       encode(pgid.shard, payload);
       return;
index 3ea5596fbbe1a06c0afe5d424fa5d1295e8fcb52..ed44e5d986fb8506c976a1fc325428c3e37df2a0 100644 (file)
@@ -4703,7 +4703,7 @@ void PG::reject_reservation()
   osd->send_message_osd_cluster(
     primary.osd,
     new MBackfillReserve(
-      MBackfillReserve::REJECT,
+      MBackfillReserve::REJECT_TOOFULL,
       spg_t(info.pgid.pgid, primary.shard),
       get_osdmap_epoch()),
     get_osdmap_epoch());
@@ -7768,7 +7768,7 @@ void PG::RecoveryState::WaitRemoteBackfillReserved::retry()
 }
 
 boost::statechart::result
-PG::RecoveryState::WaitRemoteBackfillReserved::react(const RemoteReservationRejected &evt)
+PG::RecoveryState::WaitRemoteBackfillReserved::react(const RemoteReservationRejectedTooFull &evt)
 {
   PG *pg = context< RecoveryMachine >().pg;
   pg->state_set(PG_STATE_BACKFILL_TOOFULL);
@@ -7829,7 +7829,7 @@ PG::RecoveryState::NotBackfilling::react(const RemoteBackfillReserved &evt)
 }
 
 boost::statechart::result
-PG::RecoveryState::NotBackfilling::react(const RemoteReservationRejected &evt)
+PG::RecoveryState::NotBackfilling::react(const RemoteReservationRejectedTooFull &evt)
 {
   return discard_event();
 }
@@ -7871,11 +7871,11 @@ PG::RecoveryState::RepNotRecovering::RepNotRecovering(my_context ctx)
 }
 
 boost::statechart::result
-PG::RecoveryState::RepNotRecovering::react(const RejectRemoteReservation &evt)
+PG::RecoveryState::RepNotRecovering::react(const RejectTooFullRemoteReservation &evt)
 {
   PG *pg = context< RecoveryMachine >().pg;
   pg->reject_reservation();
-  post_event(RemoteReservationRejected());
+  post_event(RemoteReservationRejectedTooFull());
   return discard_event();
 }
 
@@ -7979,12 +7979,12 @@ PG::RecoveryState::RepNotRecovering::react(const RequestBackfillPrio &evt)
       (rand()%1000 < (pg->cct->_conf->osd_debug_reject_backfill_probability*1000.0))) {
     ldout(pg->cct, 10) << "backfill reservation rejected: failure injection"
                       << dendl;
-    post_event(RejectRemoteReservation());
+    post_event(RejectTooFullRemoteReservation());
   } else if (!pg->cct->_conf->osd_debug_skip_full_check_in_backfill_reservation &&
       pg->osd->tentative_backfill_full(pg, pending_adjustment, cur_stat)) {
     ldout(pg->cct, 10) << "backfill reservation rejected: backfill full"
                       << dendl;
-    post_event(RejectRemoteReservation());
+    post_event(RejectTooFullRemoteReservation());
   } else {
     Context *preempt = nullptr;
     // Don't reserve space if skipped reservation check, this is used
@@ -8066,17 +8066,17 @@ PG::RecoveryState::RepWaitBackfillReserved::react(const RemoteBackfillReserved &
 
 boost::statechart::result
 PG::RecoveryState::RepWaitBackfillReserved::react(
-  const RejectRemoteReservation &evt)
+  const RejectTooFullRemoteReservation &evt)
 {
   PG *pg = context< RecoveryMachine >().pg;
   pg->reject_reservation();
-  post_event(RemoteReservationRejected());
+  post_event(RemoteReservationRejectedTooFull());
   return discard_event();
 }
 
 boost::statechart::result
 PG::RecoveryState::RepWaitBackfillReserved::react(
-  const RemoteReservationRejected &evt)
+  const RemoteReservationRejectedTooFull &evt)
 {
   PG *pg = context< RecoveryMachine >().pg;
   pg->clear_reserved_num_bytes();
index 6aa8b95afaee0a94bfc27ed86644537fb6f913d4..eb2260aca88c7c9e87234beca84b3d3626e7654d 100644 (file)
@@ -2043,7 +2043,7 @@ protected:
   TrivialEvent(NeedUpThru)
   TrivialEvent(Backfilled)
   TrivialEvent(LocalBackfillReserved)
-  TrivialEvent(RejectRemoteReservation)
+  TrivialEvent(RejectTooFullRemoteReservation)
   public:
   TrivialEvent(RequestBackfill)
   protected:
@@ -2431,12 +2431,12 @@ protected:
         boost::statechart::custom_reaction< Backfilled >,
        boost::statechart::custom_reaction< DeferBackfill >,
        boost::statechart::custom_reaction< UnfoundBackfill >,
-       boost::statechart::custom_reaction< RemoteReservationRejected >,
+       boost::statechart::custom_reaction< RemoteReservationRejectedTooFull >,
        boost::statechart::custom_reaction< RemoteReservationRevokedTooFull>,
        boost::statechart::custom_reaction< RemoteReservationRevoked>
        > reactions;
       explicit Backfilling(my_context ctx);
-      boost::statechart::result react(const RemoteReservationRejected& evt) {
+      boost::statechart::result react(const RemoteReservationRejectedTooFull& evt) {
        // for compat with old peers
        post_event(RemoteReservationRevokedTooFull());
        return discard_event();
@@ -2454,7 +2454,7 @@ protected:
     struct WaitRemoteBackfillReserved : boost::statechart::state< WaitRemoteBackfillReserved, Active >, NamedState {
       typedef boost::mpl::list<
        boost::statechart::custom_reaction< RemoteBackfillReserved >,
-       boost::statechart::custom_reaction< RemoteReservationRejected >,
+       boost::statechart::custom_reaction< RemoteReservationRejectedTooFull >,
        boost::statechart::custom_reaction< RemoteReservationRevoked >,
        boost::statechart::transition< AllBackfillsReserved, Backfilling >
        > reactions;
@@ -2463,7 +2463,7 @@ protected:
       void retry();
       void exit();
       boost::statechart::result react(const RemoteBackfillReserved& evt);
-      boost::statechart::result react(const RemoteReservationRejected& evt);
+      boost::statechart::result react(const RemoteReservationRejectedTooFull& evt);
       boost::statechart::result react(const RemoteReservationRevoked& evt);
     };
 
@@ -2479,12 +2479,12 @@ protected:
       typedef boost::mpl::list<
        boost::statechart::transition< RequestBackfill, WaitLocalBackfillReserved>,
        boost::statechart::custom_reaction< RemoteBackfillReserved >,
-       boost::statechart::custom_reaction< RemoteReservationRejected >
+       boost::statechart::custom_reaction< RemoteReservationRejectedTooFull >
        > reactions;
       explicit NotBackfilling(my_context ctx);
       void exit();
       boost::statechart::result react(const RemoteBackfillReserved& evt);
-      boost::statechart::result react(const RemoteReservationRejected& evt);
+      boost::statechart::result react(const RemoteReservationRejectedTooFull& evt);
     };
 
     struct NotRecovering : boost::statechart::state< NotRecovering, Active>, NamedState {
@@ -2562,7 +2562,7 @@ protected:
       typedef boost::mpl::list<
        boost::statechart::transition< RecoveryDone, RepNotRecovering >,
        // for compat with old peers
-       boost::statechart::transition< RemoteReservationRejected, RepNotRecovering >,
+       boost::statechart::transition< RemoteReservationRejectedTooFull, RepNotRecovering >,
        boost::statechart::transition< RemoteReservationCanceled, RepNotRecovering >,
        boost::statechart::custom_reaction< BackfillTooFull >,
        boost::statechart::custom_reaction< RemoteRecoveryPreempted >,
@@ -2578,15 +2578,15 @@ protected:
     struct RepWaitBackfillReserved : boost::statechart::state< RepWaitBackfillReserved, ReplicaActive >, NamedState {
       typedef boost::mpl::list<
        boost::statechart::custom_reaction< RemoteBackfillReserved >,
-       boost::statechart::custom_reaction< RejectRemoteReservation >,
-       boost::statechart::custom_reaction< RemoteReservationRejected >,
+       boost::statechart::custom_reaction< RejectTooFullRemoteReservation >,
+       boost::statechart::custom_reaction< RemoteReservationRejectedTooFull >,
        boost::statechart::custom_reaction< RemoteReservationCanceled >
        > reactions;
       explicit RepWaitBackfillReserved(my_context ctx);
       void exit();
       boost::statechart::result react(const RemoteBackfillReserved &evt);
-      boost::statechart::result react(const RejectRemoteReservation &evt);
-      boost::statechart::result react(const RemoteReservationRejected &evt);
+      boost::statechart::result react(const RejectTooFullRemoteReservation &evt);
+      boost::statechart::result react(const RemoteReservationRejectedTooFull &evt);
       boost::statechart::result react(const RemoteReservationCanceled &evt);
     };
 
@@ -2594,13 +2594,13 @@ protected:
       typedef boost::mpl::list<
        boost::statechart::custom_reaction< RemoteRecoveryReserved >,
        // for compat with old peers
-       boost::statechart::custom_reaction< RemoteReservationRejected >,
+       boost::statechart::custom_reaction< RemoteReservationRejectedTooFull >,
        boost::statechart::custom_reaction< RemoteReservationCanceled >
        > reactions;
       explicit RepWaitRecoveryReserved(my_context ctx);
       void exit();
       boost::statechart::result react(const RemoteRecoveryReserved &evt);
-      boost::statechart::result react(const RemoteReservationRejected &evt) {
+      boost::statechart::result react(const RemoteReservationRejectedTooFull &evt) {
        // for compat with old peers
        post_event(RemoteReservationCanceled());
        return discard_event();
@@ -2612,8 +2612,8 @@ protected:
       typedef boost::mpl::list<
        boost::statechart::custom_reaction< RequestRecoveryPrio >,
        boost::statechart::custom_reaction< RequestBackfillPrio >,
-       boost::statechart::custom_reaction< RejectRemoteReservation >,
-       boost::statechart::transition< RemoteReservationRejected, RepNotRecovering >,
+       boost::statechart::custom_reaction< RejectTooFullRemoteReservation >,
+       boost::statechart::transition< RemoteReservationRejectedTooFull, RepNotRecovering >,
        boost::statechart::transition< RemoteReservationCanceled, RepNotRecovering >,
        boost::statechart::custom_reaction< RemoteRecoveryReserved >,
        boost::statechart::custom_reaction< RemoteBackfillReserved >,
@@ -2630,7 +2630,7 @@ protected:
        // my reservation completion raced with a RELEASE from primary
        return discard_event();
       }
-      boost::statechart::result react(const RejectRemoteReservation &evt);
+      boost::statechart::result react(const RejectTooFullRemoteReservation &evt);
       void exit();
     };
 
index 02b8360a46b2579c45857804f429983b18768736..a4a557ef1c312b13e0e848ed5f0ec3669ad01a54 100644 (file)
@@ -165,7 +165,7 @@ struct RequestRecoveryPrio : boost::statechart::event< RequestRecoveryPrio > {
 
 TrivialEvent(NullEvt)
 TrivialEvent(RemoteBackfillReserved)
-TrivialEvent(RemoteReservationRejected)
+TrivialEvent(RemoteReservationRejectedTooFull)
 TrivialEvent(RemoteReservationRevokedTooFull)
 TrivialEvent(RemoteReservationRevoked)
 TrivialEvent(RemoteReservationCanceled)