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

mimic: rgw: mitigate bucket list with max-entries excessively high #30134

Merged
merged 2 commits into from Oct 8, 2019

Conversation

@smithfarm smithfarm added this to the mimic milestone Sep 4, 2019
@smithfarm smithfarm added the rgw label Sep 4, 2019
@smithfarm
Copy link
Contributor Author

test this please

@smithfarm
Copy link
Contributor Author

Added DNM because (if I understand https://tracker.ceph.com/issues/41655#note-1 correctly) this caused https://tracker.ceph.com/issues/41655 - once the fix for that merges, I'll cherry-pick it into this PR.

When listing a bucket with radosgw-admin, the user can specify the
maximum number of entries. That number can be unreasonably large, and
can affect the performance and memory availability. For example:

    radosgw-admin bucket list --bucket mybucket1 --max-entries=10000000

This has the potential for creating large data structures at multiple
levels in the the call stack of the radosgw(-admin) process,
potentially causing the process to run out of memory. This change
limits the maximum number of entries requested in all but the high
level code to help mitigate this issue.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
(cherry picked from commit 300429c)

Conflicts:
	src/rgw/rgw_rados.cc
- RGWRados::Bucket::List::list_objects_ordered takes an additional argument
  (unrelated to this change) in master
A recent PR made sure that a bucket listing could not request too many
entries at once. It also did a minimum computation for number of
entries. For ordered listing the minimum was 0, as required to pass
all unit tests. However the minimum for unordered listing was left at
1. In order to make ordered and unordered listing behave the same --
with the exception of ordering -- the minimum for unordered listing is
modified to 0.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
(manually cherry picked from 38e02a7)

Conflicts:
     src/srgw/rgw_rados.cc
- automated cherry-pick from master failed strangely: made the changes manually
@smithfarm
Copy link
Contributor Author

@ivancich Please have another look?

Copy link
Member

@ivancich ivancich left a comment

Choose a reason for hiding this comment

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

Yep, this looks good!

@yuriw
Copy link
Contributor

yuriw commented Oct 3, 2019

@yuriw yuriw merged commit ddfe6fe into ceph:mimic Oct 8, 2019
@smithfarm smithfarm deleted the wip-41103-mimic branch October 8, 2019 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants