Skip to content

rgw: metadata refactoring - #29118

Merged
cbodley merged 118 commits into
ceph:masterfrom
cbodley:wip-rgw-metadata-servicification
Aug 13, 2019
Merged

cbodley merged 118 commits into
ceph:masterfrom
cbodley:wip-rgw-metadata-servicification

Conversation

@cbodley

@cbodley cbodley commented Jul 18, 2019

Copy link
Copy Markdown
Contributor

rebase of #28679 with some additional cleanup

@cbodley
cbodley requested review from adamemerson and dang July 18, 2019 19:25
@cbodley
cbodley force-pushed the wip-rgw-metadata-servicification branch 4 times, most recently from 595c080 to 8469c77 Compare July 19, 2019 20:39
@cbodley

cbodley commented Jul 26, 2019

Copy link
Copy Markdown
Contributor Author

cc @yehudasa

@cbodley

cbodley commented Jul 29, 2019

Copy link
Copy Markdown
Contributor Author

@cbodley

cbodley commented Jul 29, 2019

Copy link
Copy Markdown
Contributor Author

from qa/tasks/radosgw_admin.py, the creation of user2=fud fails during # create a second user to link the bucket to, because it finds an access_key2 object pointing at user1=foo. this key is added to user1 in # TESTCASE 'add-keys','key','create','w/valid info','succeeds' and removed in # TESTCASE 'rm-key','key','rm','newly added key','succeeds, key is removed', but it looks like the rados object doesn't get deleted

Comment thread src/rgw/rgw_user.cc Resolved
yehudasa added 17 commits July 29, 2019 15:20
Signed-off-by: Yehuda Sadeh <[email protected]>
move code out of RGWRados, refactor a bit to use rados svc.

Signed-off-by: Yehuda Sadeh <[email protected]>
Dependency reduction

Signed-off-by: Yehuda Sadeh <[email protected]>
cascading changes, and minor improvements.

Signed-off-by: Yehuda Sadeh <[email protected]>
Consolidate objclass util services.

Signed-off-by: Yehuda Sadeh <[email protected]>
move implementation out of header.

Signed-off-by: Yehuda Sadeh <[email protected]>
I didn't intend for it to be such a big commit, and it's not
even compiling yet. This changes the structure of how
the metadata manager and handlers work.
The idea is to be able to relatively easily hook in different
meta backends (or same backends with different handling -- such
as the otp).
Added new services for meta, meta backend, and meta backend sysobj
implementation.
The meta backend service is responsible for the final data storage,
and updating the meta log (log might be split later on, but at the
moment it keeping it together for simplicity).
The handlers themselves are the ones responsible for reading or
modifying the metadata. This means that they need to call the
meta backend service instead of calling the utility functions.
The utility functions need to call the handlers, and not the other
way around. Handlers can have utility methods to assist.

Left to do: get everything actually compiling and implemented. The
structure is there, now need to fill in the gaps.

Signed-off-by: Yehuda Sadeh <[email protected]>
@cbodley

cbodley commented Jul 29, 2019

Copy link
Copy Markdown
Contributor Author

the valgrind leak was because RGWSI_MetaBackend_Handler::Op doesn't have a virtual destructor, so the derived Op_ManagedCtx destructor isn't called to delete the allocated Context. since Op doesn't have any other virtual methods, i decided against making its destructor virtual. instead, i pushed a commit that uses the public Op_ManagedCtx directly

@cbodley

cbodley commented Jul 31, 2019

Copy link
Copy Markdown
Contributor Author

next failure is in radosgw_admin_rest on test case # try creating an object with the first user which should cause an error after 'bucket link' with another user:

   File "qa/tasks/radosgw_admin_rest.py", line 520, in task
    assert denied

Comment thread src/rgw/rgw_bucket.cc Outdated

// ...and encode the acl
attrs[RGW_ATTR_ACL].clear();
policy.encode(attrs[RGW_ATTR_ACL]);

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.

this was missing the call to clear(), so re-encoding the policy was appending to the old one and not taking effect

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@cbodley looks good, but maybe can do it like this:
auto& attr = atts[RGW_ATTR_ACL]; attr.clear(); policy.encode(attr);

to avoid a double lookup?

@cbodley

cbodley commented Aug 2, 2019

Copy link
Copy Markdown
Contributor Author

@cbodley
cbodley force-pushed the wip-rgw-metadata-servicification branch from dd0e60d to 8f912a6 Compare August 9, 2019 15:14
@cbodley

cbodley commented Aug 9, 2019

Copy link
Copy Markdown
Contributor Author

i squashed everything into a single commit (because individual commits did not compile on their own), and rebased on top of #29540

@yehudasa

yehudasa commented Aug 9, 2019

Copy link
Copy Markdown
Member

i squashed everything into a single commit (because individual commits did not compile on their own), and rebased on top of #29540

@cbodley Then we'll lose all history that I worked really hard to retain when rebasing it the first time. How about doing a git merge instead of rebase?

@mattbenjamin

Copy link
Copy Markdown
Contributor

@yehudasa how much of the history is history just of the evolution of metadata refactor in your checkout?

@yehudasa

yehudasa commented Aug 9, 2019

Copy link
Copy Markdown
Member

@mattbenjamin I can't really say. History can have value, even if not immediately clear. Squashing everything and applying a single commit is technically the same as running git merge. Is there a reason to lose all the history?

@cbodley
cbodley force-pushed the wip-rgw-metadata-servicification branch from 8f912a6 to 3e7dc95 Compare August 9, 2019 19:25
Comment thread src/rgw/rgw_user.h Resolved
@cbodley
cbodley force-pushed the wip-rgw-metadata-servicification branch from f5d6064 to 96cbc98 Compare August 12, 2019 19:59
 Conflicts:
	src/rgw/rgw_auth.cc
	src/rgw/rgw_auth_registry.h
	src/rgw/rgw_auth_s3.h
	src/rgw/rgw_bucket.cc
	src/rgw/rgw_bucket.h
	src/rgw/rgw_data_sync.h
	src/rgw/rgw_frontend.h
	src/rgw/rgw_log.h
	src/rgw/rgw_main.cc
	src/rgw/rgw_rados.cc
	src/rgw/rgw_rados.h
	src/rgw/rgw_rest_s3.h
	src/rgw/rgw_rest_sts.h
	src/rgw/rgw_swift_auth.h
	src/rgw/rgw_user.cc
	src/rgw/rgw_user.h
	src/rgw/services/svc_sys_obj_core.h
@cbodley
cbodley force-pushed the wip-rgw-metadata-servicification branch from 96cbc98 to 75e1ec8 Compare August 13, 2019 14:25
@cbodley

cbodley commented Aug 13, 2019

Copy link
Copy Markdown
Contributor Author

mostly passed in http://pulpito.ceph.com/cbodley-2019-08-13_12:16:43-rgw-wip-cbodley-testing-distro-basic-smithi/

some 403 Forbidden failures from radosgw-admin tests because i missed a couple pieces of 'user rename' in the last rebase. i added those back and pushed the branch after verifying the fix locally. i'd like to merge this as is to unblock other work; any objections @yehudasa @dang?

@yehudasa

Copy link
Copy Markdown
Member

@cbodley no objections

@cbodley
cbodley merged commit a3039be into ceph:master Aug 13, 2019
@cbodley
cbodley deleted the wip-rgw-metadata-servicification branch August 13, 2019 16:57
@votdev

votdev commented Aug 20, 2019

Copy link
Copy Markdown
Member

Please run the Dashboard QA test suites before next time to ensure RGW changes do not break the Dashboard or inform the Dashboard team and open a tracker issue with the changes that needs to be adapted in the Dashboard.

@cbodley

cbodley commented Aug 20, 2019

Copy link
Copy Markdown
Contributor Author

@votdev i don't think it's reasonable to run every rgw pr through an extra teuthology suite. i'd prefer to move the dashboard's functional test coverage of rgw admin apis into qa/tasks/radosgw_admin_rest.py which runs as part of the rgw suite

Comment thread src/rgw/rgw_bucket.cc
return -EINVAL;
}
rgw_bucket old_bucket = bucket;
bucket.tenant = tenant;

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.

oops, somehow this change snuck into the rebase

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