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: add xml output header in RGWCopyObj_ObjStore_S3 response msg #19475

Merged
merged 1 commit into from Jan 8, 2018

Conversation

ZVampirEM77
Copy link
Contributor

@ZVampirEM77 ZVampirEM77 commented Dec 13, 2017

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

When move object by s3cmd mv, s3cmd will do four things:

  • get source object acl
  • copy source object from source bucket to destination bucket and destination object
  • put acl for destination object
  • delete source object in source bucket

But in RGW now, the s3cmd mv will put a new object in destination bucket without deleting the
source object in source bucket, this is not same with S3, eg:

s3cmd ls s3://bucket1
2017-12-13 04:04 1871 s3://bucket1/obj1
2017-12-13 04:04 8034 s3://bucket1/obj2

s3cmd mv s3://bucket1/obj1 s3://bucket1/obj3
move: 's3://bucket1/obj1' -> 's3://bucket1/obj3'

s3cmd ls s3://bucket1
2017-12-13 04:04 1871 s3://bucket1/obj1
2017-12-13 04:04 8034 s3://bucket1/obj2
2017-12-13 07:06 1871 s3://bucket1/obj3

By reading source code of s3cmd, I found s3cmd would parse the data field in response msg which should contain <?xml version="1.0" encoding="UTF-8"?> to decide whether send delete object request or not.

So now, the result is:

s3cmd ls s3://bucket1
2017-12-13 04:04 1871 s3://bucket1/obj1
2017-12-13 04:04 8034 s3://bucket1/obj2

s3cmd mv s3://bucket1/obj1 s3://bucket1/obj3
move: 's3://bucket1/obj1' -> 's3://bucket1/obj3'

s3cmd ls s3://bucket1
2017-12-13 04:04 8034 s3://bucket1/obj2
2017-12-13 07:06 1871 s3://bucket1/obj3

Signed-off-by: Enming Zhang enming.zhang@umcloud.com

@ZVampirEM77
Copy link
Contributor Author

Jenkins, retest this please.

1 similar comment
@ZVampirEM77
Copy link
Contributor Author

Jenkins, retest this please.

@ZVampirEM77
Copy link
Contributor Author

@mattbenjamin @cbodley ping~

Copy link
Contributor

@cbodley cbodley left a comment

Choose a reason for hiding this comment

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

thanks for the detailed analysis! that makes review so much easier 👍

Copy link
Contributor

@scienceluo scienceluo left a comment

Choose a reason for hiding this comment

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

LGTM.
Good Job,Enming Bro.

@yuriw
Copy link
Contributor

yuriw commented Jan 2, 2018

@yuriw yuriw merged commit 585ffbe into ceph:master Jan 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants