Bug #64340
closedinvalid olh attributes on the target object after copy_object in a versioning suspended bucket
100%
Description
During copy_object in a versioning suspended bucket, the olh attributes (user.rgw.olh.idtag, user.rgw.olh.info, user.rgw.olh.ver) of the source object are copied to the target object, which is causing some problems on the GET request of the target object.
An example problem in our case:
We deleted the source object after the copy, then sent a GET request to get the target object. The Get request crashed the rgw in our ceph version. The ceph main behaves a little bit differently. The GET request didn't crash the rgw, instead, it silently failed. No error code returned, but no content returned either. It looks like the follow_olh follows the wrong/invalid olh.
The steps to reproduce the issue in vstart:
$ aws --endpoint-url http://localhost:8000 s3 ls $ aws --endpoint-url http://localhost:8000 s3 mb s3://bucket1 $ aws --endpoint-url http://localhost:8000 s3api put-bucket-versioning --bucket bucket1 --versioning-configuration Status=Enabled $ aws --endpoint-url http://localhost:8000 s3api get-bucket-versioning --bucket bucket1 $ head -c 4K < /dev/urandom > file_4k $ aws --endpoint-url http://localhost:8000 s3 cp file_4k s3://bucket1/file_4k $ aws --endpoint-url http://localhost:8000 s3api put-bucket-versioning --bucket bucket1 --versioning-configuration Status=Suspended $ aws --endpoint-url http://localhost:8000 s3 cp file_4k s3://bucket1/file_4k $ python3.8 copy_from_other.py <-- a script to copy the object from s3://bucket1/file_4k to s3://bucket1/broom/file_4k $ aws --endpoint-url http://localhost:8000 s3 rm s3://bucket1/file_4k $ aws --endpoint-url http://localhost:8000 s3 cp s3://bucket1/broom/file_4k bbb $ ls -lrt bbb -rw-r--r--. 1 root root 0 Feb 7 05:15 bbb
Proposed fix:
In my opinion, the copy_object shouldn't copy the olh attributes in versioning suspended bucket. I'll put in a PR shortly.
JZ Updated by Jane Zhu almost 3 years ago
- Status changed from New to Fix Under Review
- Assignee set to Jane Zhu
- Pull request ID set to 55486
ST Updated by Satoru Takeuchi almost 3 years ago
The Get request crashed the rgw in our ceph version.
In my understanding, this silent error only happens in main but the stable releases has a consistent crash problem on reading problematic objects, in your example, file_4k. If so, it's better to backport your PR to reef and quincy. Is my understanding correct?
JZ Updated by Jane Zhu almost 3 years ago
Satoru Takeuchi wrote:
The Get request crashed the rgw in our ceph version.
In my understanding, this silent error only happens in main but the stable releases has a consistent crash problem on reading problematic objects, in your example, file_4k. If so, it's better to backport your PR to reef and quincy. Is my understanding correct?
The Ceph version we are running, where the crash happens, is not one of the stable releases. It's a main branch pre-reef. So I'm not very sure how it behaves in a stable quincy/reef release. I haven't got time to track down when the crash was introduced and fixed.
However, no matter which behavior it shows, I think we should backport the fix to quincy and reef.
ST Updated by Satoru Takeuchi almost 3 years ago
Thank you for your reply. I verified that consistent GET error happened with my v17.2.5 cluster.
CB Updated by Casey Bodley almost 3 years ago
- Backport set to quincy reef
CB Updated by Casey Bodley almost 3 years ago
- Status changed from Fix Under Review to Pending Backport
UB Updated by Upkeep Bot almost 3 years ago
- Copied to Backport #64447: quincy: invalid olh attributes on the target object after copy_object in a versioning suspended bucket added
UB Updated by Upkeep Bot almost 3 years ago
- Copied to Backport #64448: reef: invalid olh attributes on the target object after copy_object in a versioning suspended bucket added
RJ Updated by Robin Johnson almost 3 years ago
Jane:
1.
$ python3.8 copy_from_other.py <-- a script to copy the object from s3://bucket1/file_4k to s3://bucket1/broom/file_4k
How did this script differ from the awscli command?
aws --endpoint-url http://localhost:8000 s3api copy-versioning --bucket bucket1 --key broom/file_4k --copy-source bucket1/file_4k
2. Did any s3-tests get created for this?
3. Does "radosgw-admin bucket check" detect this error state on the object?
JZ Updated by Jane Zhu almost 3 years ago
Robin Johnson wrote:
Jane:
1.
How did this script differ from the awscli command?
aws --endpoint-url http://localhost:8000 s3api copy-versioning --bucket bucket1 --key broom/file_4k --copy-source bucket1/file_4k
Do you mean "copy-object"? There is no difference from my copy script in this context. We use the boto3 script just to exactly mimic our client behavior. Either way can reproduce the issue.
2. Did any s3-tests get created for this?
s3-tests PR: https://github.com/ceph/s3-tests/pull/546
3. Does "radosgw-admin bucket check" detect this error state on the object?
No
KS Updated by Konstantin Shalygin almost 2 years ago
- Status changed from Pending Backport to Resolved
- % Done changed from 0 to 100
- Source set to Community (user)
YJ Updated by Yixin Jin over 1 year ago
Based on the merged PR, it seems to only apply when the dest bucket has suspended versioning. However, what about the case when the dest bucket has never enabled versioning? It seems this issue could still cause such a bucket to have objects with OLH attributes.
UB Updated by Upkeep Bot over 1 year ago
- Merge Commit set to 3366f5fd5e0e3a562db5c5ad8de83307a1fc1c08
- Fixed In set to v19.0.0-1392-g3366f5fd5e0
- Released In set to v19.2.0~731
- Upkeep Timestamp set to 2025-07-11T16:17:13+00:00