From: Kefu Chai Date: Fri, 25 Jun 2021 06:57:31 +0000 (+0800) Subject: Merge pull request #38939 from ronen-fr/wip-ronenf-scrub-blocked X-Git-Tag: v17.1.0~1561 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7b07baf457fb753f51e7891cded641dc1545d435;p=ceph.git Merge pull request #38939 from ronen-fr/wip-ronenf-scrub-blocked osd: issue a warning if the scrubber blocks for too long on an object Reviewed-by: David Zafman --- 7b07baf457fb753f51e7891cded641dc1545d435 diff --cc src/osd/pg_scrubber.h index e6beecab3d72,c63d94950641..0145ae6515f2 --- a/src/osd/pg_scrubber.h +++ b/src/osd/pg_scrubber.h @@@ -139,9 -139,9 +139,10 @@@ class MapsCollectionStatus friend ostream& operator<<(ostream& out, const MapsCollectionStatus& sf); }; + } // namespace Scrub + /** * the scrub operation flags. Primary only. * Set at scrub start. Checked in multiple locations - mostly @@@ -333,13 -319,21 +334,21 @@@ class PgScrubber : public ScrubPgIF, pu scrub_ls_result_t& res_inout) const override { return false; - }; + } + int asok_debug(std::string_view cmd, + std::string param, + Formatter* f, + stringstream& ss) override; + int m_debug_blockrange{0}; + // ------------------------------------------------------------------------------------------- // the I/F used by the state-machine (i.e. the implementation of ScrubMachineListener) - bool select_range() final; + void select_range_n_notify() final; + Scrub::BlockedRangeWarning acquire_blocked_alarm() final; + /// walk the log to find the latest update that affects our chunk eversion_t search_log_for_updates() const final; diff --cc src/osd/scrub_machine_lstnr.h index f0e652acec63,87a5bf87d1f2..167e5f618f51 --- a/src/osd/scrub_machine_lstnr.h +++ b/src/osd/scrub_machine_lstnr.h @@@ -44,15 -59,12 +56,17 @@@ using BlockedRangeWarning = std::unique struct ScrubMachineListener { - virtual ~ScrubMachineListener(){}; + struct MsgAndEpoch { + MessageRef m_msg; + epoch_t m_epoch; + }; - virtual bool select_range() = 0; + virtual ~ScrubMachineListener() = default; + + virtual void select_range_n_notify() = 0; + virtual Scrub::BlockedRangeWarning acquire_blocked_alarm() = 0; + /// walk the log to find the latest update that affects our chunk virtual eversion_t search_log_for_updates() const = 0;