Skip to content

ceph-dencoder: RGW - Add missing types#52198

Merged
ivancich merged 2 commits intomainfrom
wip-nitzan-ceph-dencoder-rgw-extend-types-available
Sep 7, 2023
Merged

ceph-dencoder: RGW - Add missing types#52198
ivancich merged 2 commits intomainfrom
wip-nitzan-ceph-dencoder-rgw-extend-types-available

Conversation

@NitzanMordhai
Copy link
Contributor

@NitzanMordhai NitzanMordhai commented Jun 27, 2023

Currently, ceph-dencoder lacks certain rgw 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

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 a review from a team as a code owner June 27, 2023 05:34
@github-actions github-actions bot added the rgw label Jun 27, 2023
@NitzanMordhai
Copy link
Contributor Author

jenkins test make check

@NitzanMordhai NitzanMordhai force-pushed the wip-nitzan-ceph-dencoder-rgw-extend-types-available branch 2 times, most recently from 888de97 to c48707b Compare June 28, 2023 05:05
@NitzanMordhai NitzanMordhai force-pushed the wip-nitzan-ceph-dencoder-rgw-extend-types-available branch from c48707b to 84dc3a0 Compare July 17, 2023 12:38
@NitzanMordhai
Copy link
Contributor Author

jenkins retest this please

@NitzanMordhai NitzanMordhai force-pushed the wip-nitzan-ceph-dencoder-rgw-extend-types-available branch from 84dc3a0 to b230bba Compare July 24, 2023 12:29
@rzarzynski rzarzynski requested a review from cbodley July 24, 2023 13:50
Copy link
Contributor

@cbodley cbodley left a comment

Choose a reason for hiding this comment

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

thanks! we were working on some of this in https://tracker.ceph.com/issues/54054 but didn't cover anything

Comment on lines +532 to +536
f->open_array_section("keep_attr_prefixes_list");
for (auto iter = keep_attr_prefixes.begin(); iter != keep_attr_prefixes.end(); ++iter) {
f->dump_string("keep_attr_prefix", *iter);
}
f->close_section();
Copy link
Contributor

Choose a reason for hiding this comment

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

the helpers in src/common/ceph_json.h support std::list<T> already:

encode_json("keep_attr_prefixes", keep_attr_prefixes, f);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, missed that encode_json.. Changing it

Comment on lines +822 to +828
f->open_array_section("entries");
for (std::list<rgw_cls_bi_entry>::const_iterator iter = entries.begin(); iter != entries.end(); ++iter) {
f->open_object_section("entry");
iter->dump(f);
f->close_section();
}
f->close_section();
Copy link
Contributor

Choose a reason for hiding this comment

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

encode_json("entries", entries, f);

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


void dump(Formatter *f) const;
void decode_json(JSONObj *obj);
//static void generate_test_instances(std::list<RGWSystemMetaObj*>& o);
Copy link
Contributor

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

Comment on lines +49 to +58
f->open_array_section("AllowedOrigin");
for (auto& origin : allowed_origins) {
f->dump_string("Origin", origin);
}
f->close_section();
Copy link
Contributor

Choose a reason for hiding this comment

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

does encode_json work for these lists too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, changed

Comment on lines +239 to +240
//#include "rgw/driver/rados/rgw_zone.h"
//TYPE_FEATUREFUL_NONDETERMINISTIC(RGWSystemMetaObj)
Copy link
Contributor

Choose a reason for hiding this comment

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

why commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Abstract class, need to remove

@cbodley
Copy link
Contributor

cbodley commented Jul 25, 2023

a 'make check' failure

**** reencode of /home/jenkins-build/build/workspace/ceph-pull-requests/ceph-object-corpus/archive/15.0.0-539-g191ab33faf/objects/rgw_placement_rule/276cee7e7a31943b9d27987b75241f8d resulted in a different dump ****
3c3
<     "storage_class": "STANDARD"
---
>     "storage_class": ""

@NitzanMordhai NitzanMordhai force-pushed the wip-nitzan-ceph-dencoder-rgw-extend-types-available branch from b230bba to f4d65da Compare July 26, 2023 06:22
@NitzanMordhai NitzanMordhai requested a review from cbodley July 26, 2023 06:22
@NitzanMordhai NitzanMordhai force-pushed the wip-nitzan-ceph-dencoder-rgw-extend-types-available branch from f4d65da to ceade3f Compare July 26, 2023 06:32
@cbodley
Copy link
Contributor

cbodley commented Jul 31, 2023

jenkins test make check

@NitzanMordhai NitzanMordhai force-pushed the wip-nitzan-ceph-dencoder-rgw-extend-types-available branch from ceade3f to 35dd76c Compare August 1, 2023 07:07
@NitzanMordhai
Copy link
Contributor Author

**** reencode of /home/jenkins-build/build/workspace/ceph-pull-requests/ceph-object-corpus/archive/15.0.0-539-g191ab33faf/objects/rgw_placement_rule/276cee7e7a31943b9d27987b75241f8d resulted in a different dump ****
3c3
< "storage_class": "STANDARD"

"storage_class": ""

fixed the dump function to use the get storage class

@NitzanMordhai NitzanMordhai changed the title ceph-dencoder: Add missing rgw types to ceph-dencoder for accurate encode-decode comparison ceph-dencoder: RGW - Add missing types Aug 6, 2023
@ivancich ivancich added the wip-eric-testing-1 for ivancich testing label Aug 23, 2023
@ivancich
Copy link
Member

@NitzanMordhai -- this PR is different than others I've worked with in that your branch is not on your own fork of ceph/ceph but within ceph/ceph itself. I don't know if that's proper. @cbodley -- what are your thoughts?

@NitzanMordhai
Copy link
Contributor Author

@NitzanMordhai -- this PR is different than others I've worked with in that your branch is not on your own fork of ceph/ceph but within ceph/ceph itself. I don't know if that's proper. @cbodley -- what are your thoughts?

Yes, I made a mistake with those PRs, and it won't happen again, I talked to @rzarzynski, and it looks like there is no easy way to change the base repository without closing and reopening new pr, which means losing all the comments.

@NitzanMordhai NitzanMordhai force-pushed the wip-nitzan-ceph-dencoder-rgw-extend-types-available branch from 35dd76c to d7c7b00 Compare September 6, 2023 09:00
…code-decode comparison

Currently, ceph-dencoder lacks certain rgw 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>
Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
@NitzanMordhai NitzanMordhai force-pushed the wip-nitzan-ceph-dencoder-rgw-extend-types-available branch from 82f23e9 to 94021bb Compare September 7, 2023 11:28
@ivancich ivancich merged commit cbc4c2b into main Sep 7, 2023
@ivancich ivancich deleted the wip-nitzan-ceph-dencoder-rgw-extend-types-available branch September 7, 2023 16:40
@ivancich ivancich removed needs-qa wip-eric-testing-1 for ivancich testing labels Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants