]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: scrubber: minor modifications to debug logs and formatting
authorRonen Friedman <rfriedma@redhat.com>
Tue, 29 Dec 2020 09:24:24 +0000 (11:24 +0200)
committerRonen Friedman <rfriedma@redhat.com>
Wed, 13 Jan 2021 13:27:07 +0000 (15:27 +0200)
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/osd/PG.cc
src/osd/pg_scrubber.cc
src/osd/pg_scrubber.h
src/osd/scrub_machine.cc

index 2b97a6cc4eec2700a567546cc0f4264bc3cfd003..c514da463a572ab94a281aef4f32aee9f3b7514c 100644 (file)
@@ -353,6 +353,8 @@ void PG::update_object_snap_mapping(
 /******* PG ***********/
 void PG::clear_primary_state()
 {
+  dout(20) << __func__ << dendl;
+
   projected_log = PGLog::IndexedLog();
 
   snap_trimq.clear();
index fe57a9f2594c2ad0bb08aca77bb2d50c49faaba8..e2b4146c3fd8663f1df19110f59d5d0a580a76dd 100644 (file)
@@ -114,7 +114,7 @@ bool PgScrubber::verify_against_abort(epoch_t epoch_to_verify)
     return true;
   }
 
-  dout(15) << __func__ << " aborting. incoming epoch: " << epoch_to_verify
+  dout(10) << __func__ << " aborting. incoming epoch: " << epoch_to_verify
           << " vs last-aborted: " << m_last_aborted << dendl;
 
   // if we were not aware of the abort before - kill the scrub.
@@ -371,9 +371,9 @@ void PgScrubber::reg_next_scrub(const requested_scrub_t& request_flags)
     return;
   }
 
-  dout(10) << __func__ << " planned.m.s: " << request_flags.must_scrub
-          << ": planned.n.a.: " << request_flags.need_auto
-          << " stamp: " << m_pg->info.history.last_scrub_stamp << dendl;
+  dout(10) << __func__ << " planned: must? " << request_flags.must_scrub << " need-auto? "
+          << request_flags.need_auto << " stamp: " << m_pg->info.history.last_scrub_stamp
+          << dendl;
 
   ceph_assert(!is_scrub_registered());
 
@@ -411,6 +411,8 @@ void PgScrubber::reg_next_scrub(const requested_scrub_t& request_flags)
 
 void PgScrubber::unreg_next_scrub()
 {
+  dout(10) << __func__ << " existing-" << m_scrub_reg_stamp << ". was registered? "
+          << is_scrub_registered() << dendl;
   if (is_scrub_registered()) {
     m_osds->unreg_pg_scrub(m_pg->info.pgid, m_scrub_reg_stamp);
     m_scrub_reg_stamp = utime_t{};
@@ -618,11 +620,10 @@ void PgScrubber::add_delayed_scheduling()
   milliseconds sleep_time{0ms};
   if (m_needs_sleep) {
     double scrub_sleep = 1000.0 * m_osds->osd->scrub_sleep_time(m_flags.required);
-    dout(10) << __func__ << " sleep: " << scrub_sleep << dendl;
     sleep_time = milliseconds{long(scrub_sleep)};
   }
-  dout(15) << __func__ << " sleep: " << sleep_time.count() << " needed? " << m_needs_sleep
-          << dendl;
+  dout(15) << __func__ << " sleep: " << sleep_time.count() << "ms. needed? "
+          << m_needs_sleep << dendl;
 
   if (sleep_time.count()) {
     // schedule a transition for some 'sleep_time' ms in the future
@@ -1638,7 +1639,7 @@ void PgScrubber::scrub_finish()
 
 Scrub::FsmNext PgScrubber::on_digest_updates()
 {
-  dout(10) << __func__ << " #pending: " << num_digest_updates_pending << " are we done? "
+  dout(10) << __func__ << " #pending: " << num_digest_updates_pending << " pending? "
           << num_digest_updates_pending
           << (m_end.is_max() ? " <last chunk> " : " <mid chunk> ") << dendl;
 
index e24ad422dfc417b5a0387e6cb0be1b46d30cbfeb..226c5d41fca832c29f3ddd71fc01fa07311ceabb 100644 (file)
@@ -474,8 +474,6 @@ class PgScrubber : public ScrubPgIF, public ScrubMachineListener {
 
   epoch_t m_last_aborted{};  // last time we've noticed a request to abort
 
-
-
   /**
    * return true if any inconsistency/missing is repaired, false otherwise
    */
index 9ae3e873f9575bf22eaf0991f748f2e1f6e64884..2a2ee8732bda928de2464eec32d8e16154020928 100644 (file)
@@ -4,6 +4,9 @@
 #include "scrub_machine.h"
 
 #include <chrono>
+#include <typeinfo>
+
+#include <boost/core/demangle.hpp>
 
 #include "OSD.h"
 #include "OpRequest.h"
@@ -15,7 +18,6 @@
 #undef dout_prefix
 #define dout_prefix *_dout << " scrubberFSM "
 
-
 using namespace std::chrono;
 using namespace std::chrono_literals;
 namespace sc = boost::statechart;
@@ -32,19 +34,19 @@ namespace Scrub {
 
 void on_event_creation(std::string_view nm)
 {
-  dout(20) << " scrubberFSM event: --vvvv---- " << nm << dendl;
+  dout(20) << " event: --vvvv---- " << nm << dendl;
 }
 
 void on_event_discard(std::string_view nm)
 {
-  dout(20) << " scrubberFSM event: --^^^^---- " << nm << dendl;
+  dout(20) << " event: --^^^^---- " << nm << dendl;
 }
 
 void ScrubMachine::my_states() const
 {
   for (auto si = state_begin(); si != state_end(); ++si) {
     const auto& siw{*si};  // prevents a warning re side-effects
-    dout(20) << __func__ << " : scrub-states : " << typeid(siw).name() << dendl;
+    dout(20) << " state: " << boost::core::demangle(typeid(siw).name()) << dendl;
   }
 }
 
@@ -267,7 +269,7 @@ BuildMap::BuildMap(my_context ctx) : my_base(ctx)
   DECLARE_LOCALS;  // 'scrbr' & 'pg_id' aliases
 
   // no need to check for an epoch change, as all possible flows that brought us here have
-  // an check_interval() verification of their final event.
+  // a check_interval() verification of their final event.
 
   if (scrbr->get_preemptor().was_preempted()) {