... and not just to the OSD's log
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
(cherry picked from commit
84fe3622b887b645ffdb0b110963b89755c3c0f9)
Conflicts:
src/osd/scrubber/pg_scrubber.h
src/osd/scrubber/scrub_machine.cc
conflict resolution (performed automatically by the IDE):
pg_scrubber.h: removing the irrelevant get_snaps() that was picked;
scrub_machine.cc: no non-empty lines involved
Two missing lines will be included in the following commit.
}
}
+void PgScrubber::log_cluster_warning(const std::string& warning) const
+{
+ m_osds->clog->do_log(CLOG_WARN, warning);
+}
+
ostream& PgScrubber::show(ostream& out) const
{
return out << " [ " << m_pg_id << ": " << m_flags << " ] ";
utime_t scrub_begin_stamp;
std::ostream& gen_prefix(std::ostream& out) const final;
+ void log_cluster_warning(const std::string& warning) const final;
+
protected:
bool state_test(uint64_t m) const { return m_pg->state_test(m); }
void state_set(uint64_t m) { m_pg->state_set(m); }
}
}
+sc::result WaitReplicas::react(const DigestUpdate&)
+{
+ DECLARE_LOCALS; // 'scrbr' & 'pg_id' aliases
+ std::string warn_msg = "WaitReplicas::react(const DigestUpdate&): Unexpected DigestUpdate event";
+ dout(10) << warn_msg << dendl;
+ scrbr->log_cluster_warning(warn_msg);
+ return discard_event();
+}
+
// ----------------------- WaitDigestUpdate -----------------------------------
WaitDigestUpdate::WaitDigestUpdate(my_context ctx) : my_base(ctx)
/// exposed to be used by the scrub_machine logger
virtual std::ostream& gen_prefix(std::ostream& out) const = 0;
+
+ /// sending cluster-log warnings
+ virtual void log_cluster_warning(const std::string& msg) const = 0;
};