Project

General

Profile

Actions

Bug #54054

closed

dencoder: missing lots of rgw and cls_rgw types in src/tools/ceph-dencoder/rgw_types.h

Added by Casey Bodley over 2 years ago. Updated 12 months ago.

Status:
Resolved
Priority:
High
Assignee:
Target version:
-
% Done:

0%

Source:
Tags:
low-hanging-fruit
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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

Actions #1

Updated by Casey Bodley over 2 years ago

  • Tags set to easy first bug
Actions #2

Updated by Matt Benjamin over 2 years ago

we'll consider this as an intern project ;)

Actions #3

Updated by Casey Bodley over 2 years ago

  • Tags changed from easy first bug to low-hanging-fruit
Actions #4

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

Actions #5

Updated by ping zheng about 2 years ago

I am trying to fix this

Actions #6

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.

Actions #7

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?

Actions #8

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

Actions #9

Updated by Casey Bodley about 2 years ago

  • Status changed from New to Fix Under Review
  • Pull request ID set to 45841
Actions #10

Updated by Iqbal Khan about 2 years ago

Added missing functions and types of *cls_rgw_types.h*  class.

PR: https://github.com/ceph/ceph/pull/45394

Actions #11

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

Actions #12

Updated by Casey Bodley almost 2 years ago

  • Pull request ID changed from 45841 to 46316
Actions #13

Updated by Casey Bodley over 1 year ago

  • Assignee set to Casey Bodley
Actions #14

Updated by Casey Bodley 12 months ago

  • Status changed from Fix Under Review to Resolved
Actions

Also available in: Atom PDF