]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw: fix bad memory usage of bucket chown method 45492/head
authorMohammad Fatemipour <mohammad.fatemipour@sotoon.ir>
Sun, 19 Dec 2021 18:33:55 +0000 (22:03 +0330)
committerCory Snyder <csnyder@iland.com>
Thu, 17 Mar 2022 13:30:11 +0000 (09:30 -0400)
commitc3a7c31c757078371135ec8293078c6aecd91ea2
treed1b78c9c1df391fae0bd79b0cd5099434f626ccf
parent065c9d29f7426c283cf80fed433ed59efc43fe5e
rgw: fix bad memory usage of bucket chown method

In RGWBucketCtl::chown we have one RGWObjectCtx for all objects of a bucket.
In RGWObjectCtx there is a cache mechanism (std::map) for states of objects that will grows
continuously. for buckets with millions of objects this mechanism leads to huge memory usage.

in chown process we really do not need this caching mechanism so we could create one RGWObjectCtx
for every 1000 objects to limit usage of memory.

Fixes: https://tracker.ceph.com/issues/53599
Signed-off-by: Mohammad Fatemipour <mohammad.fatemipour@sotoon.ir>
(cherry picked from commit cf2d83ef81458524715c23e802977dc0760c847f)

Conflicts:
src/rgw/rgw_bucket.cc

Cherry-pick notes:
- Conflicts due to Octopus implementation differences in RGWBucketCtl::chown
src/rgw/rgw_bucket.cc