Skip to content

ceph-dencoder: OSD - Add missing types#52871

Merged
NitzanMordhai merged 1 commit intoceph:mainfrom
NitzanMordhai:wip-nitzan-ceph-dencoder-extend-osd-type-available
Dec 20, 2023
Merged

ceph-dencoder: OSD - Add missing types#52871
NitzanMordhai merged 1 commit intoceph:mainfrom
NitzanMordhai:wip-nitzan-ceph-dencoder-extend-osd-type-available

Conversation

@NitzanMordhai
Copy link
Contributor

@NitzanMordhai NitzanMordhai commented Aug 8, 2023

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

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

@NitzanMordhai NitzanMordhai requested review from a team as code owners August 8, 2023 06:27
@NitzanMordhai NitzanMordhai changed the base branch from wip-nitzan-ceph-dencoder-extend-osd-type-available to main August 8, 2023 06:27
@NitzanMordhai
Copy link
Contributor Author

@Matan-B please continue review here

Copy link
Contributor

@Matan-B Matan-B left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#52482 can be closed now.

make check fails with failed to decode.

@NitzanMordhai
Copy link
Contributor Author

make check fails with failed to decode.

it won't resolve until ceph/ceph-object-corpus#16 will be merged

@NitzanMordhai NitzanMordhai force-pushed the wip-nitzan-ceph-dencoder-extend-osd-type-available branch from 4b484e6 to f190a1a Compare August 9, 2023 11:23
@NitzanMordhai
Copy link
Contributor Author

@rzarzynski please review my changes in that PR

Copy link
Contributor

@rzarzynski rzarzynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: const auto&.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using encode_json will reduce the number of lines

f->dump_int("priority", priority);
f->dump_float("weight", weight);
f->open_object_section("crush_locations");
for (auto& p : crush_loc) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: const auto&.

Copy link
Contributor Author

@NitzanMordhai NitzanMordhai Aug 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Converted to encode_json

@NitzanMordhai NitzanMordhai force-pushed the wip-nitzan-ceph-dencoder-extend-osd-type-available branch from f190a1a to b8e4eac Compare August 10, 2023 05:09
@NitzanMordhai NitzanMordhai requested a review from Matan-B August 14, 2023 05:29
Copy link
Contributor

@rzarzynski rzarzynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: let's be consistent with this {.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, also fixed all other dump function that already had inconsistent use of {

};
WRITE_CLASS_DENC(bluestore_extent_ref_map_t)

WRITE_CLASS_DENC(bluestore_extent_ref_map_t::record_t);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: unneeded ;.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

#include "os/kstore/kstore_types.h"
TYPE(kstore_cnode_t)
TYPE(kstore_onode_t)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:unneeded \n.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@NitzanMordhai NitzanMordhai force-pushed the wip-nitzan-ceph-dencoder-extend-osd-type-available branch from b8e4eac to 3dd16d4 Compare September 5, 2023 10:05
@NitzanMordhai NitzanMordhai force-pushed the wip-nitzan-ceph-dencoder-extend-osd-type-available branch from 3dd16d4 to 83173f9 Compare September 6, 2023 06:04
@NitzanMordhai NitzanMordhai requested review from a team as code owners September 6, 2023 06:04
@NitzanMordhai NitzanMordhai requested review from avanthakkar and cloudbehl and removed request for a team September 6, 2023 06:04
@NitzanMordhai NitzanMordhai force-pushed the wip-nitzan-ceph-dencoder-extend-osd-type-available branch 3 times, most recently from 728b87a to 1c4013c Compare September 6, 2023 08:28
@NitzanMordhai
Copy link
Contributor Author

@rzarzynski all checks pass now, please review

@github-actions
Copy link

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@ljflores
Copy link
Member

@NitzanMordhai looks like this branch needs to be rebased.

@yuriw
Copy link
Contributor

yuriw commented Dec 19, 2023

@NitzanMordhai pls rebase and merge
ref: https://trello.com/c/tUEWtLfq

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>
@NitzanMordhai NitzanMordhai force-pushed the wip-nitzan-ceph-dencoder-extend-osd-type-available branch from 2c81e09 to 899276a Compare December 20, 2023 06:07
@NitzanMordhai NitzanMordhai merged commit 7eab324 into ceph:main Dec 20, 2023
@NitzanMordhai NitzanMordhai deleted the wip-nitzan-ceph-dencoder-extend-osd-type-available branch December 20, 2023 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants