From: Samuel Just Date: Thu, 4 Jul 2024 04:26:23 +0000 (-0700) Subject: crimson/.../pg_interval_interrupt_condition: clarify member, add comments X-Git-Tag: v19.2.1~307^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=da8f89b914d636b910bcc432abf899d738752f73;p=ceph.git crimson/.../pg_interval_interrupt_condition: clarify member, add comments Signed-off-by: Samuel Just (cherry picked from commit b49f82a18b21732dfb18b0714bbfbd94c4b97ba3) --- diff --git a/src/crimson/osd/pg_interval_interrupt_condition.cc b/src/crimson/osd/pg_interval_interrupt_condition.cc index bc54b0914943..7a8cceb7f628 100644 --- a/src/crimson/osd/pg_interval_interrupt_condition.cc +++ b/src/crimson/osd/pg_interval_interrupt_condition.cc @@ -15,8 +15,8 @@ interrupt_cond; namespace crimson::osd { -IOInterruptCondition::IOInterruptCondition(Ref& pg, epoch_t e) - : pg(pg), e(e) {} +IOInterruptCondition::IOInterruptCondition(Ref& pg, epoch_t epoch_started) + : pg(pg), epoch_started(epoch_started) {} IOInterruptCondition::~IOInterruptCondition() { // for the sake of forward declaring PG (which is a detivate of @@ -26,9 +26,9 @@ IOInterruptCondition::~IOInterruptCondition() { bool IOInterruptCondition::new_interval_created() { LOG_PREFIX(IOInterruptCondition::new_interval_created); const epoch_t interval_start = pg->get_interval_start_epoch(); - bool ret = e < interval_start; + bool ret = epoch_started < interval_start; if (ret) { - DEBUGDPP("stored interval e{} < interval_start e{}", *pg, e, interval_start); + DEBUGDPP("stored epoch_started e{} < interval_start e{}", *pg, epoch_started, interval_start); } return ret; } diff --git a/src/crimson/osd/pg_interval_interrupt_condition.h b/src/crimson/osd/pg_interval_interrupt_condition.h index 95b3595cdd0b..46323bb52ccf 100644 --- a/src/crimson/osd/pg_interval_interrupt_condition.h +++ b/src/crimson/osd/pg_interval_interrupt_condition.h @@ -12,15 +12,41 @@ namespace crimson::osd { class PG; +/** + * IOInterruptCondition + * + * Encapsulates logic for determining whether a continuation chain + * started at should be halted for once of two reasons: + * 1. PG instance is stopping (includes if OSD is shutting down) + * 2. A map advance has caused an interval change since + * + * should be the epoch at which the operation was logically + * started, which may or may not pg->get_osdmap_epoch() at the time at which + * with_interruption is actually invoked. + */ class IOInterruptCondition { public: - IOInterruptCondition(Ref& pg, epoch_t e); + IOInterruptCondition(Ref& pg, epoch_t epoch_started); ~IOInterruptCondition(); + /** + * new_interval_created() + * + * Returns true iff the pg has entered a new interval since + * ( < pg->get_interval_start_epoch()) + */ bool new_interval_created(); + /// true iff pg->stopping bool is_stopping(); + /** + * is_primary + * + * True iff the pg is still primary. Used to populate + * ::crimson::common::actingset_changed upon interval change + * to indicate whether client IOs should be requeued. + */ bool is_primary(); template @@ -50,7 +76,7 @@ public: private: Ref pg; - epoch_t e; + epoch_t epoch_started; }; } // namespace crimson::osd