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

jewel: rgw sends omap_getvals with (u64)-1 limit #12419

Merged
merged 2 commits into from Feb 1, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 24 additions & 2 deletions src/rgw/rgw_rados.cc
Expand Up @@ -10850,11 +10850,33 @@ int RGWRados::omap_get_vals(rgw_obj& obj, bufferlist& header, const string& mark

}

int RGWRados::omap_get_all(rgw_obj& obj, bufferlist& header, std::map<string, bufferlist>& m)
int RGWRados::omap_get_all(rgw_obj& obj, bufferlist& header,
std::map<string, bufferlist>& m)
{
rgw_rados_ref ref;
rgw_bucket bucket;
int r = get_obj_ref(obj, &ref, &bucket);
if (r < 0) {
return r;
}

#define MAX_OMAP_GET_ENTRIES 1024
const int count = MAX_OMAP_GET_ENTRIES;
string start_after;

return omap_get_vals(obj, header, start_after, (uint64_t)-1, m);
while (true) {
std::map<string, bufferlist> t;
r = ref.ioctx.omap_get_vals(ref.oid, start_after, count, &t);
if (r < 0) {
return r;
}
if (t.empty()) {
break;
}
start_after = t.rbegin()->first;
m.insert(t.begin(), t.end());
}
return 0;
}

int RGWRados::omap_set(rgw_obj& obj, std::string& key, bufferlist& bl)
Expand Down