ceph-dencoder: OSD - Add missing types#52871
Conversation
|
@Matan-B please continue review here |
it won't resolve until ceph/ceph-object-corpus#16 will be merged |
4b484e6 to
f190a1a
Compare
|
@rzarzynski please review my changes in that PR |
rzarzynski
left a comment
There was a problem hiding this comment.
Basically LGTM; just nits.
src/mon/MgrMap.h
Outdated
| f->dump_unsigned("gid", gid); | ||
| f->dump_string("name", name); | ||
| f->open_array_section("available_modules"); | ||
| for (auto& i : available_modules) { |
There was a problem hiding this comment.
using encode_json will reduce the number of lines
src/mon/MonMap.cc
Outdated
| f->dump_int("priority", priority); | ||
| f->dump_float("weight", weight); | ||
| f->open_object_section("crush_locations"); | ||
| for (auto& p : crush_loc) { |
There was a problem hiding this comment.
Converted to encode_json
f190a1a to
b8e4eac
Compare
rzarzynski
left a comment
There was a problem hiding this comment.
My only concern is about breaking the format abstraction with encode_json(). Apart of that just nits.
Otherwise LGTM!
| f->dump_stream("addr") << public_addrs; | ||
| f->dump_int("priority", priority); | ||
| f->dump_float("weight", weight); | ||
| encode_json("crush_location", crush_loc, f); |
There was a problem hiding this comment.
I'm not sure reusing the encode_json() is the right thing. The problem is that the dump() methods are supposed to format-agnostic – they are getting abstract Formatter.
However, the idea to employ a helper function is nice. Maybe Formatter already offers a facility for dumping containers?
There was a problem hiding this comment.
@rzarzynski it will end up almost duplicating the code in ceph_json, i'll need to create a template dump function and then functions for each type. and that will duplicate for all other formats. ceph_json will work for xml and other types (even though ceph dencoder dumping only json)
src/mon/MgrMap.h
Outdated
| } | ||
| DECODE_FINISH(p); | ||
| } | ||
| void dump(ceph::Formatter *f) const { |
There was a problem hiding this comment.
nit: let's be consistent with this {.
There was a problem hiding this comment.
Done, also fixed all other dump function that already had inconsistent use of {
src/os/bluestore/bluestore_types.h
Outdated
| }; | ||
| WRITE_CLASS_DENC(bluestore_extent_ref_map_t) | ||
|
|
||
| WRITE_CLASS_DENC(bluestore_extent_ref_map_t::record_t); |
src/tools/ceph-dencoder/osd_types.h
Outdated
| #include "os/kstore/kstore_types.h" | ||
| TYPE(kstore_cnode_t) | ||
| TYPE(kstore_onode_t) | ||
|
|
b8e4eac to
3dd16d4
Compare
3dd16d4 to
83173f9
Compare
728b87a to
1c4013c
Compare
|
@rzarzynski all checks pass now, please review |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
@NitzanMordhai looks like this branch needs to be rebased. |
|
@NitzanMordhai pls rebase and merge |
Currently, ceph-dencoder lacks certain osd types, preventing us from accurately checking the ceph corpus for encode-decode mismatches. This pull request aims to address this issue by adding the missing types to ceph-dencoder. To successfully incorporate these types into ceph-dencoder, we need to introduce the necessary `dump` and `generate_test_instances` functions that was missing in some types. These functions are essential for proper encode and decode of the added types. This PR will enhance the functionality of ceph-dencoder by including the missing types, enabling a comprehensive analysis of encode-decode consistency. With the addition of these types, we can ensure the robustness and correctness of the ceph corpus. This update will significantly contribute to improving the overall reliability and accuracy of ceph-dencoder. It allows for a more comprehensive assessment of the encode-decode behavior, leading to enhanced data integrity and stability within the ceph ecosystem. Fixes: https://tracker.ceph.com/issues/61788 Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
2c81e09 to
899276a
Compare
Wrong forked repo mentioned in #52482 that PR is fixing it
Currently, ceph-dencoder lacks certain osd type, preventing us from accurately checking the ceph corpus for encode-decode mismatches. This pull request aims to address this issue by adding the missing types to ceph-dencoder.
To successfully incorporate these types into ceph-dencoder, we need to introduce the necessary dump and generate_test_instances functions that was missing in some types. These functions are essential for proper encode and decode of the added types.
This PR will enhance the functionality of ceph-dencoder by including the missing types, enabling a comprehensive analysis of encode-decode consistency. With the addition of these types, we can ensure the robustness and correctness of the ceph corpus.
This update will significantly contribute to improving the overall reliability and accuracy of ceph-dencoder. It allows for a more comprehensive assessment of the encode-decode behavior, leading to enhanced data integrity and stability within the ceph ecosystem.
Fixes: https://tracker.ceph.com/issues/61788
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windows