osd/OSD: simple perfcounter usage in OSDService#33770
Conversation
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
retest this please |
|
@tchaikov . ping. |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
tchaikov
left a comment
There was a problem hiding this comment.
LGTM. but the order of initialization could be confusing in future. as we keep a reference of pointer to logger and recoverystate_perf, do you think it would help with the readability to change create_logger() and create_recoverystate_perf() so they return a logger and recoverystate_perf respectively, and call them in the ctor's member initialization list, and init service, afterwards?
e67f42b to
7b267ef
Compare
|
@tchaikov . update by your suggestion. please review. |
|
jenkins test make check |
|
|
jenkins test dashboard backend |
| logger(NULL), | ||
| recoverystate_perf(NULL), | ||
| logger(create_logger()), | ||
| recoverystate_perf(create_recoverystate_perf()), |
There was a problem hiding this comment.
because get_osdmap_epoch() is used for printing the current osdmap epoch in OSD::create_logger() and in OSD::create_recoverystate_perf(), while osdmap is initialized after logger and recoverystate_perf. valgrind emitted warnings like
<error>
<unique>0x0</unique>
<tid>1</tid>
<kind>UninitCondition</kind>
<what>Conditional jump or move depends on uninitialised value(s)</what>
...
<frame>
<ip>0x791D98</ip>
<obj>/usr/bin/ceph-osd</obj>
<fn>atomic_load<const OSDMap></fn>
<dir>/usr/include/c++/8/bits</dir>
<file>shared_ptr_atomic.h</file>
<line>107</line>
</frame>
<frame>
<ip>0x791D98</ip>
<obj>/usr/bin/ceph-osd</obj>
<fn>get_osdmap</fn>
<dir>/usr/src/debug/ceph-16.0.0-3411.g73dcd530b88.el8.x86_64/src/osd</dir>
<file>OSD.h</file>
<line>1686</line>
</frame>
<frame>
<ip>0x791D98</ip>
<obj>/usr/bin/ceph-osd</obj>
<fn>OSD::get_osdmap_epoch() const</fn>
<dir>/usr/src/debug/ceph-16.0.0-3411.g73dcd530b88.el8.x86_64/src/osd</dir>
<file>OSD.h</file>
<line>1690</line>
</frame>
<frame>
<ip>0x72842B</ip>
<obj>/usr/bin/ceph-osd</obj>
<fn>OSD::create_logger()</fn>
<dir>/usr/src/debug/ceph-16.0.0-3411.g73dcd530b88.el8.x86_64/src/osd</dir>
<file>OSD.cc</file>
<line>4048</line>
</frame>
<frame>
<ip>0x781D2E</ip>
<obj>/usr/bin/ceph-osd</obj>
<fn>OSD::OSD(ceph::common::CephContext*, ObjectStore*, int, Messenger*, Messenger*, Messenger*, Messenger*, Messenger*, Messenger*, Messenger*, MonClient*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ceph::async::io_context_pool&)</fn>
<dir>/usr/src/debug/ceph-16.0.0-3411.g73dcd530b88.el8.x86_64/src/osd</dir>
<file>OSD.cc</file>
<line>2157</line>
</frame>
...
so i think we have at least three options here
- do not print debugging messages like
dout(10) << "create_logger" << dendl;in the beginning of these functions. - move declarations of
loggerandrecoverystate_perfinOSDclass after that of_osdmap - keep existing implementation unchanged -- initialize
loggerandrecoverystate_perfwith nullptr. and set them in the body of ctor function.
i am in favor of the first option. what do you think?
Move create_logger()/create_recoverystate_perf() into construct to avoid check logger in OSDService. And avoid in destructor delete nullptr. Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
7b267ef to
5ace640
Compare
|
jenkins test make check |
Move create_logger()/create_recoverystate_perf() into construct to avoid
check logger in OSDService.
And avoid in destructor delete nullptr.
Signed-off-by: Jianpeng Ma jianpeng.ma@intel.com
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard backendjenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume tox