Project

General

Profile

Feature #42031

rgw: provide mech to allow unordered bucket listing to work passed missing bucket index shards

Added by Eric Ivancich 5 months ago. Updated 5 months ago.

Status:
New
Priority:
Normal
Assignee:
Target version:
% Done:

0%

Source:
Tags:
Backport:
luminous,mimic,nautilus
Reviewed:
Affected Versions:
Pull request ID:

Description

Currently a missing bucket index shard will cause an unordered bucket listing to fail. In the extreme case where a user obliterates a single bucket index shard, this would allow them to at least list all objects in their other shards, possibly allowing an emergency copy of listable objects to a recovery bucket.

History

#1 Updated by Eric Ivancich 5 months ago

It seems like the place to do this is in RGWRados::cls_bucket_list_unordered. Ideally cls_rgw_bucket_list_op has a result of -ENOENT when a bucket index shard is missing....

Here's the code:

while (count <= num_entries &&
((shard_id >= 0 && current_shard == uint32_t(shard_id)) ||
current_shard < num_shards)) {
const std::string& oid = oids[current_shard];
rgw_cls_list_ret result;
librados::ObjectReadOperation op;
cls_rgw_bucket_list_op(op, marker, prefix, num_entries,
list_versions, &result);
r = index_ctx.operate(oid, &op, nullptr);
if (r < 0)
return r;

Also available in: Atom PDF