Skip to content

rgw: simplify request dispatch hot paths - #70676

Merged
chardan merged 1 commit into
mainfrom
jfw-rgw-op-fusion
Sep 11, 2026
Merged

chardan merged 1 commit into
mainfrom
jfw-rgw-op-fusion

Conversation

@chardan

@chardan chardan commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Refactors RGW operation and REST dispatch paths to reduce repeated branching, avoid
avoidable string copies, and split related operation families out of rgw_op.cc.

  • centralizes HTTP argument classification and enables string_view/transparent lookup
  • avoids extra copies in root S3 POST action parsing
  • simplifies REST manager resource routing
  • splits ACL, forwarding, object-attrs, and object-lock code out of rgw_op.cc
Area                                      Speed vs. Baseline   Allocations vs. Baseline
HTTP long-key get() via string_view       54.4% faster         100% fewer, -1 alloc/op
Cached exists("uploadId")                 98.3% faster         unchanged, 0 allocs/op
Cached sub_resource_exists("uploadId")    98.3% faster         unchanged, 0 allocs/op
HTTP arg classification on append         57.4% faster         unchanged
REST route, empty frontend prefix         75.8% faster         50% fewer, -1 alloc/op
REST route, nonempty frontend prefix      52.5% faster         unchanged
Root S3 POST action parse                 76.9% faster         76.5% fewer, -26 allocs/op

Cleanups:
rgw_op.cc is massive and terrifying. This steps toward cleaning it up:

  • rgw_op_acl.cc‎ - moves ACL operations out of rgw_op.cc
  • rgw_op_forward.cc: isolates multisite forward-to-master helper
  • rgw_op_obj_attrs.cc: isolates RGWGetObjAttrs
  • rgw_op_obj_lock.cc: isolates bucket/object lock operations
  • rgw_op_internal.h: adds private cross-file helpers

Tests:
RGW tests: adds focused C++ coverage for REST routing, HTTP args, POST parsing, and tar EOF behavior.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Fixes: https://tracker.ceph.com/issues/78902

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

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@chardan chardan self-assigned this Jul 29, 2026
@chardan chardan changed the title rgw: simplify operation dispatch hot paths rgw: simplify request dispatch hot paths Jul 29, 2026
@chardan
chardan marked this pull request as ready for review July 29, 2026 16:34
@chardan
chardan requested a review from a team as a code owner July 29, 2026 16:34
@yuvalif

yuvalif commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@chardan thanks! will review the bucket logging and lua bits (cc @nbalacha)
one small request, even if the code is ugly... could you please avoid formatting changes to the code (as it makes the review harder and will also confuse future backports, git blames etc.)

Comment thread src/rgw/rgw_common.cc Resolved
@chardan

chardan commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

@yuvalif Thanks for your help and constructive feedback! I've tried to undo at least some of the more gratuitous formatting changes and will be more mindful, the point about commit histories and so on is significant (although sometimes it is certainly hard to resist). Appreciated!

Comment thread src/rgw/rgw_lua_utils.h Resolved
Comment thread src/rgw/rgw_process.cc Resolved
@yuvalif

yuvalif commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

although sometimes it is certainly hard to resist

true :-) but would really appriciate reveting the cosmetic changes in rgw_rest_bucket_logging.cc

Comment thread src/rgw/rgw_rest_bucket_logging.cc Resolved
@anrao19

anrao19 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by anuchaithra started 2026-08-03-05:57.

@chardan
chardan force-pushed the jfw-rgw-op-fusion branch from fa53c74 to 5327a2b Compare August 3, 2026 23:54
@anrao19

anrao19 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by anuchaithra started 2026-08-03-05:57.

Pr testing was complete, since new commits added would need to retest so removing this pr from above tracker

@anrao19

anrao19 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

jenkins test windows

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

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

yuvalif
yuvalif previously requested changes Sep 3, 2026

@yuvalif yuvalif 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.

i thought that the bucket logging fix was here: #71236 ?

are there other bucket logging fixes here, or just the perf improvemets (note that @mkogan1's perf tests do not cover bucket logging).
also, looks like there are many formatting changes in bucket logging code, would really appriciate if this could be avoided

@chardan

chardan commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Hi, @yuvalif! Yes, that's where the fix is-- I didn't update the description, thank you for pointing that out. There aren't other bucket logging changes here (or at least there shouldn't be). As the purpose of the change is to simplify the implementation (and, as you will recall, demonstrate some of the C++ Concepts) it is natural that there will be some cosmetic changes; I did make a pass to remove some of the more gratuitous ones. If there are specific concerns with the bucket logging code, please raise them on that PR. Thank you very much!

@yuvalif

yuvalif commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Hi, @yuvalif! Yes, that's where the fix is-- I didn't update the description, thank you for pointing that out. There aren't other bucket logging changes here (or at least there shouldn't be). As the purpose of the change is to simplify the implementation (and, as you will recall, demonstrate some of the C++ Concepts) it is natural that there will be some cosmetic changes; I did make a pass to remove some of the more gratuitous ones. If there are specific concerns with the bucket logging code, please raise them on that PR. Thank you very much!

i see, the changes here are in src/rgw/rgw_rest_bucket_logging.cc - unrelated to the bucket logging bug fix, but still related to bucket logging. there is quite a bit of refactoring there. is this related to the general attribute refacoring of this PR or addressing something else?
(nothing in the description fo the PR explains the reason for these changes)

unless it is depended with other changes here, I would appriciate if you can break it up to its own PR.
and also, please try to minimize cometic changes - this will make the review process much faster, and would minimize backporting conflicts in the future.

Comment thread src/rgw/rgw_rest_bucket_logging.cc Outdated
decode(tmp_mtime, mtime_it->second);
mtime = std::move(tmp_mtime);
} catch (buffer::error& err) {
ldpp_dout(dpp, 5) << "WARNING: failed to decode logging mtime attribute '"

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.

Why are some messages using ldpp_dout and others ldpp_dout_fmt ?

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.

I had wanted to convert things to ldpp_dout_fmt() while I was at it and then backed off after comments about churn. Anything "new" is hopefully using ldpp_dout_fmt(). Personally, I would rather do it all while I'm here, but that isn't a universal sentiment, and I can also see the reasoning in migrating those calls as a separate set of changes.

Assisted-by: Codex:GPT-5

Signed-off-by: Jesse F. Williamson <[email protected]>
@chardan

chardan commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

@yuvalif Ok, bucket logging moved to #71637

@yuvalif
yuvalif dismissed their stale review September 10, 2026 15:25

code moved to another PR

@chardan
chardan merged commit 1a29756 into main Sep 11, 2026
25 checks passed
@chardan
chardan deleted the jfw-rgw-op-fusion branch September 11, 2026 18:22
@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I have resolved the following tracker ticket due to the merge of this PR:

No backports are pending for the ticket. If this is incorrect, please update the tracker
ticket and reset to Pending Backport state.

Update Log: https://github.com/ceph/ceph/actions/runs/34632942909

@anrao19

anrao19 commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

This PR has been removed from main integration testing by anuchaithra started 2026-09-02-05:41.

@yuvalif

yuvalif commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

@chardan @anrao19 this PR touches 35 files in the RGW codebase.
why is it being merged without being tested?
(cc @adamemerson)

Comment thread src/rgw/rgw_rest_s3.cc
if (!post_body.empty() && std::string_view::npos != post_body.find("Action")) {
attribute_map attributes;
for (const auto token : post_body | std::views::split('&')) {
const std::string_view text { std::begin(token), std::end(token) };

ghost Sep 16, 2026

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.

this is currently not compiling with gcc11. was this successfully built in shaman?

@chardan

ghost commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor Author

@chardan @anrao19 this PR touches 35 files in the RGW codebase. why is it being merged without being tested? (cc @adamemerson)

Well, that is my fault... I got a bit trigger happy again.

It does need to run on Teuthology, I'll see what I can do.

@chardan

ghost commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

Split into multiple commits:
#71849

@chardan chardan mentioned this pull request Sep 16, 2026
4 of 14 tasks
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.

6 participants