Skip to content

rgw: reorganize rgw basic types (rgw_basic_types.h) for portability across build contexts - #48767

Closed
mattbenjamin wants to merge 2 commits into
ceph:mainfrom
linuxbox2:wip-basic-types-reorg
Closed

mattbenjamin wants to merge 2 commits into
ceph:mainfrom
linuxbox2:wip-basic-types-reorg

Conversation

@mattbenjamin

@mattbenjamin mattbenjamin commented Nov 7, 2022 •

Copy link
Copy Markdown
Contributor

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

@mattbenjamin

Copy link
Copy Markdown
Contributor Author

@yuvalif note that minimally, the inclusion of rgw_basic_types.h in the rgw cls headers is proving correctness

@mattbenjamin
mattbenjamin requested a review from yima77 November 7, 2022 17:25
@mattbenjamin mattbenjamin mentioned this pull request Nov 7, 2022
3 tasks

@dang dang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems plausible.

@cbodley cbodley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

a very nice cleanup of the existing structure 👍

in the context of zipper, i'd like to put more thought into defining our library boundaries. we'll need to eliminate any circular dependencies between the rgw code above zipper, and the rgw code that sal and its modules depend on. and by making it obvious which headers/types are used by sal, we can understand which changes will break api compatibility

Comment thread src/rgw/rgw_obj_manifest.h Resolved
Comment thread src/rgw/rgw_quota.h Resolved
Comment thread src/rgw/rgw_zone_types.h Resolved
Comment thread src/rgw/rgw_zone_types.h
encode(endpoint, bl);
encode(key, bl);
encode(region, bl);
encode((uint32_t)host_style, bl); // XXX kill C-style casts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is the cast even required? enums should be encoded as their underlying type

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah, probably can just elide that

Comment thread src/rgw/rgw_acl.h Resolved
Comment thread src/rgw/rgw_basic_types.h Resolved
Comment thread src/rgw/rgw_obj_manifest.h Resolved
Comment thread src/rgw/rgw_basic_types.h Resolved
Comment thread src/cls/rgw/cls_rgw_client.h Resolved
Comment thread src/cls/rgw/cls_rgw_types.h Resolved
Comment thread src/rgw/rgw_basic_types.h Resolved
Comment thread src/rgw/rgw_zone_types.h Resolved
Comment thread src/rgw/rgw_bucket_types.h Outdated
void convert(cls_user_bucket *b) const;

void encode(ceph::buffer::list& bl) const {
ENCODE_START(10, 10, bl);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: indentation

Comment thread src/rgw/rgw_basic_types.h Resolved

@mattbenjamin mattbenjamin left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

about to repush--probably rebased into just 3 commits

Comment thread src/rgw/rgw_basic_types.h Resolved
Comment thread src/rgw/rgw_basic_types.h Resolved
Comment thread src/rgw/rgw_obj_manifest.h Resolved
Comment thread src/rgw/rgw_zone_types.h Resolved

@cbodley cbodley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

still a couple unresolved XXX comments, looks good otherwise

Comment thread src/rgw/rgw_basic_types.h Resolved
@mattbenjamin

Copy link
Copy Markdown
Contributor Author

oops, no, will update

@github-actions

Copy link
Copy Markdown

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

In downstream 4.1 version this change moved rgw_pool, rgw_bucket,
and some related types--but these have already moved on more
recent branches.

Include rgw_basic_types.h only from cls_rgw_types.h (review).

Signed-off-by: Matt Benjamin <[email protected]>
Defines a hierarchy of "simple" data types ensured to be
safe to include in any context above the zipper line, and
also from CLS.

The following headers are currently defined to contain basic
types only:

 rewrite src/rgw/rgw_basic_types.h (70%) // includes the whole hierarchy
 create mode 100644 src/rgw/rgw_acl_types.h
 create mode 100644 src/rgw/rgw_bucket_types.h
 create mode 100644 src/rgw/rgw_obj_types.h
 create mode 100644 src/rgw/rgw_placement_types.h
 create mode 100644 src/rgw/rgw_pool_types.h
 create mode 100644 src/rgw/rgw_quota_types.h
 create mode 100644 src/rgw/rgw_user_types.h
 create mode 100644 src/rgw/rgw_zone_types.h

This commit consolidates the following original commits:

* rgw: move RGWUploadPartInfo to rgw_basic_types.{h,cc}
* rgw: move rgw_obj_key to rgw_basic_types.{h,cc}
* rgw: move rgw_placement_rule to rgw_basic_types.{h,cc}
* rgw: move rgw_obj to rgw_basic_types.{h,cc}
* rgw: include rgw_compression_types.h in rgw_basic_types.{h,cc}
* rgw: move rgw_raw_obj to rgw_basic_types.{h,cc}
* rgw: rgw_multi.h: remove unused RGWMPObj forward decl

and the following cleanups from review:

* rgw: remove stray comments
* rgw: move rgw_obj_manifest.h inclusion to top of rgw_basic_types.h
* rgw: nit: indentation
* rgw: remove this line
* rgw: move rgw_bucket_shard to rgw_bucket_types.h, cleanup
* rgw: fix rgw_quota.h

Signed-off-by: Matt Benjamin <[email protected]>
@github-actions

github-actions Bot commented Dec 9, 2022

Copy link
Copy Markdown

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

@cbodley

cbodley commented Dec 9, 2022

Copy link
Copy Markdown
Contributor

these commits merged with #49336

@cbodley cbodley closed this Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants