mirror of
https://github.com/ceph/ceph
synced 2024-12-26 21:43:10 +00:00
mon: add 'osd last-stat-seq <osd>' command
Return the latest seq for the osd reflected in the mon's digest stats. Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
fa70d0e81c
commit
aac073dc2a
@ -54,6 +54,11 @@ public:
|
||||
CephContext *cct) const override;
|
||||
void tick() override;
|
||||
|
||||
uint64_t get_last_osd_stat_seq(int osd) {
|
||||
return digest.get_last_osd_stat_seq(osd);
|
||||
}
|
||||
|
||||
|
||||
void print_summary(Formatter *f, std::ostream *ss) const;
|
||||
|
||||
PGStatService *get_pg_stat_service();
|
||||
|
@ -133,6 +133,9 @@ COMMAND("pg set_nearfull_ratio name=ratio,type=CephFloat,range=0.0|1.0", \
|
||||
|
||||
COMMAND("pg map name=pgid,type=CephPgid", "show mapping of pg to osds", \
|
||||
"pg", "r", "cli,rest")
|
||||
COMMAND("osd last-stat-seq name=id,type=CephOsdName", \
|
||||
"get the last pg stats sequence number reported for this osd", \
|
||||
"osd", "r", "cli,rest")
|
||||
|
||||
/*
|
||||
* auth commands AuthMonitor.cc
|
||||
|
@ -2958,7 +2958,8 @@ void Monitor::handle_command(MonOpRequestRef op)
|
||||
mdsmon()->dispatch(op);
|
||||
return;
|
||||
}
|
||||
if (module == "osd" || prefix == "pg map") {
|
||||
if ((module == "osd" || prefix == "pg map") &&
|
||||
prefix != "osd last-stat-seq") {
|
||||
osdmon()->dispatch(op);
|
||||
return;
|
||||
}
|
||||
@ -3145,6 +3146,19 @@ void Monitor::handle_command(MonOpRequestRef op)
|
||||
ss2 << "report " << rdata.crc32c(CEPH_MON_PORT);
|
||||
rs = ss2.str();
|
||||
r = 0;
|
||||
} else if (prefix == "osd last-stat-seq") {
|
||||
int64_t osd;
|
||||
cmd_getval(g_ceph_context, cmdmap, "id", osd);
|
||||
uint64_t seq = mgrstatmon()->get_last_osd_stat_seq(osd);
|
||||
if (f) {
|
||||
f->dump_unsigned("seq", seq);
|
||||
f->flush(ds);
|
||||
} else {
|
||||
ds << seq;
|
||||
rdata.append(ds);
|
||||
}
|
||||
rs = "";
|
||||
r = 0;
|
||||
} else if (prefix == "node ls") {
|
||||
string node_type("all");
|
||||
cmd_getval(g_ceph_context, cmdmap, "type", node_type);
|
||||
|
Loading…
Reference in New Issue
Block a user