Bug 2278599

Summary: [RGW]: Bucket owner change fails on a bucket with rate limit set
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Tejas <tchandra>
Component: RGWAssignee: Matt Benjamin (redhat) <mbenjamin>
Status: CLOSED ERRATA QA Contact: Chaithra <ckulal>
Severity: medium Docs Contact: Disha Walvekar <dwalveka>
Priority: unspecified    
Version: 7.1CC: akraj, ceph-eng-bugs, cephqe-warriors, ckulal, mbenjamin, rpollack, tserlin
Target Milestone: ---   
Target Release: 7.1z3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ceph-18.2.1-284.el9cp Doc Type: Bug Fix
Doc Text:
.`merge_and_store_attrs()` method no longer causes attribute update operations to fail Previously, a bug in the `merge_and_store_attrs()` method, which deals with reconciling changed and the unchanged bucket instance attributes, caused some attribute update operations to fail silently. Due to this, some metadata operations on a subset of buckets would fail. For example, a bucket owner change would fail on a bucket with a rate limit set. With this fix, the `merge_and_store_attrs()` method is fixed and all affected scenarios now work correctly.
Story Points: ---
Clone Of: 2262919 Environment:
Last Closed: 2025-02-24 15:42:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2262919    
Bug Blocks: 2267614, 2298578, 2298579    

Description Tejas 2024-05-02 08:46:32 UTC
+++ This bug was initially created as a clone of Bug #2262919 +++

Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from Tejas on 2024-02-06 05:58:39 UTC ---

Ref : https://github.com/ceph/ceph/pull/53475

Steps :
1. configure ratelimit on a regular bucket.
2. Unlink bucket from current user, and try to link a different user.

Fails with error:
radosgw-admin bucket link --bucket tb4 --uid test4
failure: (22) Invalid argument: While crossing the Anavros you have displeased the goddess Hera.  You must sacrifice your ancient bucket f1b3fddd-c4be-4292-af42-aa87e1b853e3.15719.3
2024-01-31T05:13:00.049-0500 7ff5aa13c800  0 WARNING: can't bucket link because no acl on bucket=:tb4[f1b3fddd-c4be-4292-af42-aa87e1b853e3.15719.3])"

--- Additional comment from Matt Benjamin (redhat) on 2024-03-19 18:21:33 UTC ---

the upstream fix is stalled due to probably-related test failures, casey is not sure on prognosis

Matt

--- Additional comment from errata-xmlrpc on 2024-03-21 01:31:23 UTC ---

This bug has been added to advisory RHBA-2024:126567 by Thomas Serlin (tserlin)

--- Additional comment from errata-xmlrpc on 2024-03-21 01:31:23 UTC ---

Bug report changed to ON_QA status by Errata System.
A QE request has been submitted for advisory RHBA-2024:126567-01
https://errata.engineering.redhat.com/advisory/126567

--- Additional comment from errata-xmlrpc on 2024-03-21 01:31:32 UTC ---

This bug has been added to advisory RHBA-2024:126567 by Thomas Serlin (tserlin)

--- Additional comment from Tejas on 2024-03-22 07:16:30 UTC ---

Verified on 
ceph version 18.2.1-77.el9cp (ea606a462a7833df737a1ed18682d68b5eb0c517) reef (stable)

root@ceph-tj2-2azyk4-node6 ~]# radosgw-admin ratelimit set --ratelimit-scope=user --uid tj1 --max-read-ops=4  --max-read-bytes=8192 --max-write-bytes=8192 --max-write-ops=4
[root@ceph-tj2-2azyk4-node6 ~]# radosgw-admin ratelimit enable --ratelimit-scope=user --uid tj1
[root@ceph-tj2-2azyk4-node6 ~]# radosgw-admin ratelimit set --ratelimit-scope=bucket --bucket tb1 --max-read-ops=2  --max-read-bytes=4096 --max-write-bytes=4096 --max-write-ops=2
[root@ceph-tj2-2azyk4-node6 ~]# radosgw-admin ratelimit enable --ratelimit-scope=bucket --bucket tb1
[root@ceph-tj2-2azyk4-node6 ~]#
[root@ceph-tj2-2azyk4-node6 ~]#
[root@ceph-tj2-2azyk4-node6 ~]#
[root@ceph-tj2-2azyk4-node6 ~]#
[root@ceph-tj2-2azyk4-node6 ~]# radosgw-admin caps add --uid  tj1 --caps='users=*;buckets=*;ratelimit=*'

root@ceph-tj2-2azyk4-node6 ~]# radosgw-admin user create --uid tj2 --access-key 1234 --secret 1234 --display-name TJ2
{
    "user_id": "tj2",
    "display_name": "TJ2",
    "email": "",
    "suspended": 0,
    "max_buckets": 1000,
    "subusers": [],
    "keys": [
        {
            "user": "tj2",
            "access_key": "1234",
            "secret_key": "1234"
        }
    ],

root@ceph-tj2-2azyk4-node6 ~]# s3cmd ls s3://tb1
[root@ceph-tj2-2azyk4-node6 ~]# s3cmd ls s3://tb1
WARNING: Retrying failed request: /?delimiter=%2F (503 (SlowDown))
WARNING: Waiting 3 sec...
^CSee ya!

root@ceph-tj2-2azyk4-node6 ~]# radosgw-admin bucket unlink --bucket tb1 --uid tj1
[root@ceph-tj2-2azyk4-node6 ~]#
[root@ceph-tj2-2azyk4-node6 ~]#
[root@ceph-tj2-2azyk4-node6 ~]# radosgw-admin bucket link --bucket tb1 --uid tj2
[root@ceph-tj2-2azyk4-node6 ~]#
[root@ceph-tj2-2azyk4-node6 ~]#
[root@ceph-tj2-2azyk4-node6 ~]# radosgw-admin bucket stats --bucket tb1
{
    "bucket": "tb1",
    "num_shards": 11,
    "tenant": "",
    "versioning": "off",
    "zonegroup": "96f5d538-18f9-42e8-b8ad-120cb4ed0e64",
    "placement_rule": "default-placement",
    "explicit_placement": {
        "data_pool": "",
        "data_extra_pool": "",
        "index_pool": ""
    },
    "id": "69d7b57c-0050-4862-86fc-0b93258269bd.24933.2",
    "marker": "69d7b57c-0050-4862-86fc-0b93258269bd.24933.2",
    "index_type": "Normal",
    "versioned": false,
    "versioning_enabled": false,
    "object_lock_enabled": false,
    "mfa_enabled": false,
    "owner": "tj2",


root@ceph-tj2-2azyk4-node6 ~]# radosgw-admin ratelimit get --bucket tb1
{
    "bucket_ratelimit": {
        "max_read_ops": 2,
        "max_write_ops": 2,
        "max_read_bytes": 4096,
        "max_write_bytes": 4096,
        "enabled": true
    }
}

root@ceph-tj2-2azyk4-node6 ~]# radosgw-admin bucket chown --bucket tb1 --uid tj2
0 objects processed in :tb1[69d7b57c-0050-4862-86fc-0b93258269bd.24933.2]). Next marker

root@ceph-tj2-2azyk4-node6 ~]# s3cmd ls s3://tb1 -c ~/.tj2
[root@ceph-tj2-2azyk4-node6 ~]# s3cmd ls s3://tb1 -c ~/.tj2
WARNING: Retrying failed request: /?delimiter=%2F (503 (SlowDown))
WARNING: Waiting 3 sec...
^CSee ya!

--- Additional comment from Matt Benjamin (redhat) on 2024-03-28 12:30:24 UTC ---

We've discovered that the change which fixed this issue:

commit 6e92c7f3597cbc33e3d93905efea5958b2837119 (tag: ceph-18.2.1-74)
Author: lightmelodies <lightmelodies>
Date:   Fri Sep 15 03:25:02 2023 +0000

    rgw: fix rados bucket merge and store attrs
    
    The original code pass `new_attrs` as argument, which will overwrite existing attrs.
    (e.g. set bucket ratelimit will break all bucket policy and acl settings)
    
    Resolves: rhbz#2262919
    
    Signed-off-by: Wei Wang <lightmelodies>
    (cherry picked from commit 6b1246dfa26d457d4e361115b415271f11bf5aa0)

is the root cause of https://bugzilla.redhat.com/show_bug.cgi?id=2271806.

So I have reverted that commit and returning this bz to ASSIGNED.

sorry!

Matt

--- Additional comment from  on 2024-03-28 14:50:06 UTC ---

(In reply to Matt Benjamin (redhat) from comment #7)
> We've discovered that the change which fixed this issue:
> 
> commit 6e92c7f3597cbc33e3d93905efea5958b2837119 (tag: ceph-18.2.1-74)
> Author: lightmelodies <lightmelodies>
> Date:   Fri Sep 15 03:25:02 2023 +0000
> 
>     rgw: fix rados bucket merge and store attrs
>     
>     The original code pass `new_attrs` as argument, which will overwrite
> existing attrs.
>     (e.g. set bucket ratelimit will break all bucket policy and acl settings)
>     
>     Resolves: rhbz#2262919
>     
>     Signed-off-by: Wei Wang <lightmelodies>
>     (cherry picked from commit 6b1246dfa26d457d4e361115b415271f11bf5aa0)
> 
> is the root cause of https://bugzilla.redhat.com/show_bug.cgi?id=2271806.
> 
> So I have reverted that commit and returning this bz to ASSIGNED.
> 
> sorry!
> 
> Matt


Matt, is the revert commit pushed downstream? I don't see anything there yet on ceph-7.1-rhel-patches.

I assume once that is done, we can fully move bz2271806 back to ON_QA.

Thanks,

Thomas

--- Additional comment from Matt Benjamin (redhat) on 2024-04-01 16:38:41 UTC ---

Hi Thomas,

Sorry, I guess I forgot to push it.  For now, we'll skip the revert commit, I've taken Pritha's follow-up commit for 7.1.

Matt

--- Additional comment from  on 2024-04-02 20:00:48 UTC ---

This bug is already attached to https://errata.devel.redhat.com/advisory/126567 and new builds are available. Moving to ON_QA.

--- Additional comment from Tejas on 2024-04-05 07:48:52 UTC ---

performed the same set of steps as comment #6 on ceph version 18.2.1-108.el9cp. No issues seen , moving BZ to Verified.

Comment 8 errata-xmlrpc 2025-02-24 15:42:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat Ceph Storage 7.1 security, bug fix, enhancement, and known issue updates), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2025:1770