From: zhangjianwei2 Date: Fri, 15 Dec 2023 08:42:07 +0000 (+0800) Subject: OSD: oldest_map and newest_map should be displayed directly X-Git-Tag: v19.3.0~259^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=34dc9dda1faaa0489f6d28d30babc542c6385c3b;p=ceph.git OSD: oldest_map and newest_map should be displayed directly 9215996586ba79302c07e5cf586ec2add1ac159e delete these, ceph daemon osd.x status when osd status is displayed, only superblock.maps (begin ~ len) can be seen. this need calculate maps to get oldest_map/newest_map held by the current osd. moreover, it cannot be simply calculate. need pay attention to the boundaries。 this is not very friendly. Fixes: https://tracker.ceph.com/issues/63836 Signed-off-by: zhangjianwei2 --- diff --git a/src/crimson/osd/osd.cc b/src/crimson/osd/osd.cc index f3648c6df27..2c58b7c638c 100644 --- a/src/crimson/osd/osd.cc +++ b/src/crimson/osd/osd.cc @@ -713,6 +713,8 @@ void OSD::dump_status(Formatter* f) const f->dump_unsigned("whoami", superblock.whoami); f->dump_string("state", pg_shard_manager.get_osd_state_string()); f->dump_stream("maps") << superblock.maps; + f->dump_stream("oldest_map") << superblock.get_oldest_map(); + f->dump_stream("newest_map") << superblock.get_newest_map(); f->dump_unsigned("cluster_osdmap_trim_lower_bound", superblock.cluster_osdmap_trim_lower_bound); f->dump_unsigned("num_pgs", pg_shard_manager.get_num_pgs()); diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index a79b388deca..f7468653713 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -2696,6 +2696,8 @@ void OSD::asok_command( f->dump_unsigned("whoami", superblock.whoami); f->dump_string("state", get_state_name(get_state())); f->dump_stream("maps") << superblock.maps; + f->dump_stream("oldest_map") << superblock.get_oldest_map(); + f->dump_stream("newest_map") << superblock.get_newest_map(); f->dump_unsigned("cluster_osdmap_trim_lower_bound", superblock.cluster_osdmap_trim_lower_bound); f->dump_unsigned("num_pgs", num_pgs);