From c2f263d64f7150e055946bb38641aec9c421ef92 Mon Sep 17 00:00:00 2001 From: Prashant D Date: Mon, 23 May 2022 02:32:37 -0400 Subject: [PATCH] mon/LogMonitor, MgrStat: Report logm and mgrstat committed version Only way to get the first and last committed version for logm and mgrstat is through the monstore db dump. Reporting first and last committed version for logm and mgrstat in ceph report will help in debugging monstore is too big issues. Signed-off-by: Prashant D --- src/mon/LogMonitor.cc | 5 +++++ src/mon/LogMonitor.h | 1 + src/mon/MgrStatMonitor.h | 2 ++ src/mon/Monitor.cc | 1 + 4 files changed, 9 insertions(+) diff --git a/src/mon/LogMonitor.cc b/src/mon/LogMonitor.cc index c196e8429fbe..0f883862384a 100644 --- a/src/mon/LogMonitor.cc +++ b/src/mon/LogMonitor.cc @@ -1038,6 +1038,11 @@ bool LogMonitor::prepare_command(MonOpRequestRef op) return false; } +void LogMonitor::dump_info(Formatter *f) +{ + f->dump_unsigned("logm_first_committed", get_first_committed()); + f->dump_unsigned("logm_last_committed", get_last_committed()); +} int LogMonitor::sub_name_to_id(const string& n) { diff --git a/src/mon/LogMonitor.h b/src/mon/LogMonitor.h index 715f380af6a4..d83c02ba7c24 100644 --- a/src/mon/LogMonitor.h +++ b/src/mon/LogMonitor.h @@ -164,6 +164,7 @@ private: void tick() override; // check state, take actions + void dump_info(Formatter *f); void check_subs(); void check_sub(Subscription *s); diff --git a/src/mon/MgrStatMonitor.h b/src/mon/MgrStatMonitor.h index aa0ae49ffd61..8f27a98781cf 100644 --- a/src/mon/MgrStatMonitor.h +++ b/src/mon/MgrStatMonitor.h @@ -94,6 +94,8 @@ public: void dump_info(ceph::Formatter *f) const { digest.dump(f); f->dump_object("servicemap", get_service_map()); + f->dump_unsigned("mgrstat_first_committed", get_first_committed()); + f->dump_unsigned("mgrstat_last_committed", get_last_committed()); } void dump_cluster_stats(std::stringstream *ss, ceph::Formatter *f, diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 2d6e7cf4572d..8089c44006c4 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -3710,6 +3710,7 @@ void Monitor::handle_command(MonOpRequestRef op) mdsmon()->dump_info(f.get()); authmon()->dump_info(f.get()); mgrstatmon()->dump_info(f.get()); + logmon()->dump_info(f.get()); paxos->dump_info(f.get()); -- 2.47.3