Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw: multipart uploads copy part support #5673

Closed
wants to merge 2 commits into from

Conversation

jmunhoz
Copy link
Contributor

@jmunhoz jmunhoz commented Aug 26, 2015

Add multipart uploads copy part feature.

Fixes: #12790

Signed-off-by: Javier M. Mellid jmunhoz@igalia.com

@jmunhoz
Copy link
Contributor Author

jmunhoz commented Sep 2, 2015

@yehudasa I moved the functionality to RGWCopyObj as suggested. Added some tests at ceph/s3-tests#75 too.

@yehudasa
Copy link
Member

@jmunhoz I think I liked the original version better. There's a lot of code copied here, it doesn't look like the correct way to go. What I would like to see is a reuse of the current code with adjustments where needed. If it's easier with your original approach then it's fine.

@jmunhoz
Copy link
Contributor Author

jmunhoz commented Oct 20, 2015

@yehudasa ok, I will try to reuse the current code with adjustments where needed.

@jmunhoz
Copy link
Contributor Author

jmunhoz commented Dec 9, 2015

@yehudasa done. It reuses the current code with adjustments where needed. Rebased and fixed conflicts.

@jmunhoz
Copy link
Contributor Author

jmunhoz commented Dec 16, 2015

@yehudasa rebased and fixed conflicts.

@yehudasa
Copy link
Member

@jmunhoz take a look here https://github.com/yehudasa/ceph/tree/wip-multipart-uploads-cp -- reworked your commit a bit to remove some accidental indentation issues, and other minor cosmetic cleanups that inflated the diff and made it impossible to review. Now that I see where you were going at, I'm not sure that consolidating the PutObj and the CopyObj is actually needed. At the point where we generate the op (RGWOp *RGWHandler_ObjStore_Obj_S3::op_put()) we can create the relevant op. Will that work?

@jmunhoz
Copy link
Contributor Author

jmunhoz commented Dec 19, 2015

@yehudasa Not sure. I will have a look

@yehudasa
Copy link
Member

@jmunhoz ping

@jmunhoz
Copy link
Contributor Author

jmunhoz commented Feb 15, 2016

@yehudasa Sorry! it is in my TODO reviewing the new suggested approach. I need to have a look in the code but I am not sure if generating a new operation would add a lot of redundant code...

@yehudasa yehudasa added this to the jewel milestone Feb 27, 2016
@yehudasa yehudasa removed this from the jewel milestone Mar 5, 2016
@mattbenjamin
Copy link
Contributor

@jmunhoz hi--just checkin in; are you continuing with this change?

@jmunhoz
Copy link
Contributor Author

jmunhoz commented May 24, 2016

@mattbenjamin hi! yes, my idea is retaking the first version and working from there. I am working in the aws4 chunked stream support now. I should be working on this feat in the short. Would it be ok?

@jmunhoz
Copy link
Contributor Author

jmunhoz commented Jul 26, 2016

Rebased and catched up the master head. I am experimenting some issues to test the feature with the old s3-tests. The current test cases (ceph/s3-tests#75) got old and they stop working. It doesn't look a problem with the feature though.

I uploaded a test case working in python http://tracker.ceph.com/issues/12790#note-3 It is useful to validate the feature and as possible template for the s3-tests failing.

/* handle x-amz-copy-source */

if (copy_source) {
bucket = s->info.env->get("HTTP_X_AMZ_COPY_SOURCE");
Copy link
Member

Choose a reason for hiding this comment

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

@jmunhoz should do this prior to execute(), probably in get_params(). As it is, it's a security issue, we don't check here permissions of the source object, which needs to happen.

Add multipart uploads copy part feature.

Fixes: http://tracker.ceph.com/issues/12790

Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
@jmunhoz
Copy link
Contributor Author

jmunhoz commented Sep 15, 2016

@yehudasa I updated the patch with your comments (tenant handling, const strings refs for input params, calling get_bucket_info() much earlier, checking permissions of the source object, etc)

The param stuff and early errors are handled in get_params now. Checking permissions of the source object is handled in verify_permissions.

I had a look in RGWCopyObj::verify_permission() to see how permission checking could be done in this case. I would appreciate if you double-check the RGWPutObj::verify_permission() code cause I am not sure if it is the right approach to verify or some more proper interface is in place.

@yehudasa
Copy link
Member

@jmunhoz please see #11269. Added a few things, I also have a branch in the s3-tests suite that adds more tests.

@jmunhoz
Copy link
Contributor Author

jmunhoz commented Sep 30, 2016

@yehudasa added comment there. thanks!

@yehudasa
Copy link
Member

yehudasa commented Oct 4, 2016

@jmunhoz closing this one as there's another PR opened for this

@yehudasa yehudasa closed this Oct 4, 2016
dump_content_length(s, 0);
if (!s->info.env->get("HTTP_X_AMZ_COPY_SOURCE")) {
dump_etag(s, etag.c_str());
dump_content_length(s, 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

why are we setting the content length to 0 in the response header?

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