Bug #54054
closeddencoder: missing lots of rgw and cls_rgw types in src/tools/ceph-dencoder/rgw_types.h
0%
Description
the ceph-dencoder and ceph-object-corpus give us regression test coverage of the encodings listed in rgw_types.h, so we should take advantage of them
Updated by Matt Benjamin over 2 years ago
we'll consider this as an intern project ;)
Updated by Casey Bodley over 2 years ago
- Tags changed from easy first bug to low-hanging-fruit
Updated by Casey Bodley about 2 years ago
example commit that added cls_rgw_lc_get_entry_ret in https://github.com/ceph/ceph/pull/44743/commits/c8291d9662a8dcaccdad0c1c93265c4b89d49c8a
in src/tools/ceph-dencoder/rgw_types.h, the types are organized by their header:
#include "cls/rgw/cls_rgw_types.h" TYPE(rgw_bucket_pending_info) TYPE(rgw_bucket_dir_entry_meta) ...
each type needs 5 member functions:
struct rgw_bucket_dir_entry_meta { ... void encode(ceph::buffer::list &bl) const; void decode(ceph::buffer::list::const_iterator &bl); void dump(ceph::Formatter *f) const; void decode_json(JSONObj *obj); static void generate_test_instances(std::list<rgw_bucket_dir_entry_meta*>& o); }; WRITE_CLASS_ENCODER(rgw_bucket_dir_entry_meta)
the encode/decode/WRITE_CLASS_ENCODER bits should already be there - if they aren't, then the class doesn't need to be listed in rgw_types.h
for dump/decode_json/generate_test_instances, see existing types for examples
start with cls_rgw_ops.h and cls_rgw_types.h
Updated by ping zheng about 2 years ago
Casey Bodley wrote:
example commit that added cls_rgw_lc_get_entry_ret in https://github.com/ceph/ceph/pull/44743/commits/c8291d9662a8dcaccdad0c1c93265c4b89d49c8a
in src/tools/ceph-dencoder/rgw_types.h, the types are organized by their header:
[...]each type needs 5 member functions:
[...]
the encode/decode/WRITE_CLASS_ENCODER bits should already be there - if they aren't, then the class doesn't need to be listed in rgw_types.h
for dump/decode_json/generate_test_instances, see existing types for examples
start with cls_rgw_ops.h and cls_rgw_types.h
I am working on v14.2.22, I don't find rgw_types.h here, but types.h exists in the tool. Then I only add 5 types from cls_rgw_ops.h for test, when this is acknowledged , I will add the left types.
My pr is here:https://github.com/ceph/ceph/pull/45836, there are some errors here, who can help me go through this.
Updated by ping zheng about 2 years ago
with the Signed-off-by I recreate the pr here , is there something wrong in the code?
Updated by ping zheng about 2 years ago
ping zheng wrote:
with the Signed-off-by I recreate the pr here , is there something wrong in the code?
Sorry, the pr url is https://github.com/ceph/ceph/pull/45841
Updated by Casey Bodley about 2 years ago
- Status changed from New to Fix Under Review
- Pull request ID set to 45841
Updated by Iqbal Khan about 2 years ago
Added missing functions and types of *cls_rgw_types.h* class.
Updated by ping zheng almost 2 years ago
Casey Bodley wrote:
example commit that added cls_rgw_lc_get_entry_ret in https://github.com/ceph/ceph/pull/44743/commits/c8291d9662a8dcaccdad0c1c93265c4b89d49c8a
in src/tools/ceph-dencoder/rgw_types.h, the types are organized by their header:
[...]each type needs 5 member functions:
[...]
the encode/decode/WRITE_CLASS_ENCODER bits should already be there - if they aren't, then the class doesn't need to be listed in rgw_types.h
for dump/decode_json/generate_test_instances, see existing types for examples
start with cls_rgw_ops.h and cls_rgw_types.h
Pr of 45841 is closed, as I am not working from branch of master. I have to rebase it, then I recommit a new pr below:
Added missing functions and types of cls_rgw_ops.h class.
PR: https://github.com/ceph/ceph/pull/46316
Updated by Casey Bodley almost 2 years ago
- Pull request ID changed from 45841 to 46316
Updated by Casey Bodley 12 months ago
- Status changed from Fix Under Review to Resolved