Skip to content

rgw: move forward_request_to_master() out of sal#50599

Merged
cbodley merged 23 commits intoceph:mainfrom
cbodley:wip-rgw-sal-forward
Nov 8, 2023
Merged

rgw: move forward_request_to_master() out of sal#50599
cbodley merged 23 commits intoceph:mainfrom
cbodley:wip-rgw-sal-forward

Conversation

@cbodley
Copy link
Contributor

@cbodley cbodley commented Mar 20, 2023

bucket creation/deletion were the only things that used it inside of sal. it's now the caller's responsibility to forward these requests before calling into sal. in order for RGWBucketCreate to call forward_request_to_master() itself, other things like bucket placement needed to move out as well

renamed the sal::Driver::get_bucket() functions that load the bucket from storage to load_bucket(). the non-loading get_bucket() function never fails, so it now returns std::unique_ptr<Bucket> directly

because RGWBucketCreate always has to handle the existing-bucket case, i moved the create_bucket() function from sal::User into sal::Bucket::create(). that allows us to reuse the handle we allocated in sal::Driver::load_bucket()

finally, moves Driver::forward_request_to_master() to a free function in rgw_op.cc, and Driver::forward_iam_request_to_master() to a free function in rgw_rest_role.cc

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

@cbodley cbodley requested a review from a team as a code owner March 20, 2023 16:19
@cbodley cbodley force-pushed the wip-rgw-sal-forward branch from 6191a7a to f6ee32a Compare March 20, 2023 19:00
@github-actions github-actions bot added the tests label Mar 20, 2023
@cbodley cbodley force-pushed the wip-rgw-sal-forward branch from f6ee32a to 2d301f1 Compare March 20, 2023 19:25
@cbodley cbodley force-pushed the wip-rgw-sal-forward branch from 2d301f1 to e94dd36 Compare March 21, 2023 20:14
@cbodley
Copy link
Contributor Author

cbodley commented Mar 21, 2023

fixed up the dbstore tests now that the caller no longer passes in an objv to create_bucket()

@github-actions
Copy link

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

@cbodley
Copy link
Contributor Author

cbodley commented May 15, 2023

@github-actions
Copy link

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

@yuriw
Copy link
Contributor

yuriw commented Jul 12, 2023

@cbodley needs rebase and merge

@github-actions
Copy link

github-actions bot commented Oct 1, 2023

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions bot added the stale label Oct 1, 2023
@cbodley cbodley force-pushed the wip-rgw-sal-forward branch from 9f9d53b to 7079703 Compare October 3, 2023 14:38
@cbodley cbodley requested a review from dang October 3, 2023 14:40
this avoids the need to construct a temporary rgw_bucket_key just to
construct a rgw_bucket without an instance id

Signed-off-by: Casey Bodley <[email protected]>
@cbodley
Copy link
Contributor Author

cbodley commented Nov 6, 2023

now tempest.api.object_storage.test_account_bulk.BulkTest.test_extract_archive is failing to list an object from the archive

the rgw log seems to think the bucket created by bulk-upload only has a single shard, so doesn't find the object inside:

swift:list_bucket cls_bucket_list_ordered: request from each of 1 shard(s) for 10001 entries to get 10001 total entries

when i tried to reproduce this under vstart, it had the expected 11 shards:

swift:list_bucket cls_bucket_list_ordered: request from each of 11 shard(s) for 976 entries to get 10001 total entries

the reproducer, including the magic curl command (where X-Auth-Token was copied from swift list --debug output):

# contents of archive.tar:
$ tar -tf archive.tar
archive/
archive/foo.txt

# upload archive.tar to the account root:
$ curl -i http://localhost:8000/swift/v1?extract-archive=tar -X PUT -H "X-Auth-Token: AUTH_rgwtk0b000000746573743a746573746572b7c23cb32a2810d1d7824a654d45c31f67ffa8be2fd012232586f398831746431d7dfe8a" -H "Content-Length: 10240" --data-binary "@archive.tar"
HTTP/1.1 200 OK
Transfer-Encoding: chunked
X-Trans-Id: tx000001049b8c5eedd0d97-0065494b4b-1033-default
X-Openstack-Request-Id: tx000001049b8c5eedd0d97-0065494b4b-1033-default
Content-Type: text/plain; charset=utf-8
Server: Ceph Object Gateway (reef)
Date: Mon, 06 Nov 2023 20:23:45 GMT
Connection: Keep-Alive

Number Files Created: 1
Response Body: 
Response Status: 201 Created
Errors: 

# list the extracted 'archive' container:
$ swift -A http://localhost:8000/auth/v1 -U test:tester -K testing list archive
foo.txt


using namespace std;

int forward_iam_request_to_master(const DoutPrefixProvider* dpp,
Copy link
Contributor

Choose a reason for hiding this comment

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

@cbodley : Just a question here - if in future we plan to add multisite replication for oidc-provider in rgw, where should this method be shifted to? rgw_rest_iam.h?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

rgw_rest_conn.* might be a good place since these functions depend on RGWRESTConn

the CreateBucket operation always has to deal with existing buckets, so
we have to load the Bucket handle first anyway

also moves the related placement and forward_request_to_master() logic
out of sal entirely

Signed-off-by: Casey Bodley <[email protected]>
@cbodley cbodley force-pushed the wip-rgw-sal-forward branch from f51364d to 0ead6ff Compare November 7, 2023 17:18
@cbodley
Copy link
Contributor Author

cbodley commented Nov 7, 2023

now tempest.api.object_storage.test_account_bulk.BulkTest.test_extract_archive is failing to list an object from the archive

ok, fixed by adding the createparams.zone_placement = rgw::find_zone_placement(...) to RGWBulkUploadOp::handle_dir(). will rerun the whole suite now

@cbodley
Copy link
Contributor Author

cbodley commented Nov 8, 2023

jenkins test api

@cbodley
Copy link
Contributor Author

cbodley commented Nov 8, 2023

@cbodley
Copy link
Contributor Author

cbodley commented Nov 8, 2023

oops, that rerun didn't use the right ceph branch. re-rerunning in https://pulpito.ceph.com/cbodley-2023-11-08_17:26:47-rgw-wip-rgw-sal-forward-distro-default-smithi/

edit: the rgw/crypt job passed there too

Comment on lines +58 to +63
auto conn = RGWRESTConn{dpp->get_cct(), z->second.id, z->second.endpoints,
std::move(creds), zg->second.id, zg->second.api_name};
bufferlist outdata;
constexpr size_t max_response_size = 128 * 1024; // we expect a very small response
int ret = conn.forward_iam_request(dpp, creds, req, nullptr, max_response_size,
&indata, &outdata, y);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops, creds was moved into the RGWRESTConn ctor call above. i opened #55148 to address this

cc @jzhu116-bloomberg

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.

4 participants