]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw: fix bad memory usage of bucket chown method 45491/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:28:03 +0000 (09:28 -0400)
commitf0612bad226b00f21c8f065a5e7f01b723a332a8
tree77789ff7255d34f9e3234e6b7f390534957a662f
parent179a7bca8a84771b0dde09e26f7a2146a985df90
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 Pacific impementation differences in RGWBucketCtl::chown
src/rgw/rgw_bucket.cc