Bug #80915
closedrgw: radoslist names a nonexistent OLH for a versioned key starting with '_', and leaves out the real one
0%
Description
Found by comparing an independent listing (a bucket's index shards and head manifests, read directly) with radosgw-admin bucket radoslist, object for object. Reproduced on a single-host vstart cluster built from main at 7ed73efc1be; the code cited is unchanged at 2d0cd8af0a0, and the same in reef, squid and tentacle. M stands for the bucket's marker.
For each versioned key, RGWRadosList::process_bucket also stats the key's OLH, the head without an instance (orphan.cc:1304):
rgw_obj_key uninstanced(entry.key.name);
entry.key.name is the bucket index key, in which a name starting with _ is escaped with another _. The std::string constructor does not parse it back, so get_oid() escapes it a second time. For the key _v, radoslist stats M____v, which does not exist, instead of the OLH M___v (locator M__v). The ENOENT path (orphan.cc:1069-1076) then prints the nonexistent name, and the real OLH is never listed:
$ radosgw-admin bucket radoslist --bucket=b M__:LiJ2rbKQL9rTNOMIojn06QshHnFjiro__v M____v ERROR: pop_and_handle_stat_op: stat of head object resulted in ENOENT; oid=M____v $ rados -p default.rgw.buckets.data --object-locator M__v stat M___v default.rgw.buckets.data/M___v mtime ..., size 0
With --rgw-obj-fs the line's key is __v, the escaped index key, which is not an S3 key. rgw-gap-list reports it as a gap: Bucket: "b" Object: "__v". rgw-orphan-list is not affected, because it sets aside every object with a locator. A tool that compares located objects with radoslist would report the OLH as an orphan.
Reproducer: in a bucket with versioning enabled, put the key _v, then run radosgw-admin bucket radoslist --bucket=<bucket>.
Fix: parse the index key, as the rgw_obj_index_key constructor does, e.g. rgw_obj_key uninstanced(rgw_obj_index_key(entry.key.name));.
MH Updated by Matthew Heler 2 months ago
- Assignee set to Matthew Heler
- Backport changed from tentacle to umbrella, tentacle, squid
- Pull request ID set to 72122
MH Updated by Matthew Heler 2 months ago
- Status changed from New to Fix Under Review
UB Updated by Upkeep Bot about 2 months ago
- Copied to Backport #81737: tentacle: rgw: radoslist names a nonexistent OLH for a versioned key starting with '_', and leaves out the real one added
UB Updated by Upkeep Bot about 2 months ago
- Copied to Backport #81738: squid: rgw: radoslist names a nonexistent OLH for a versioned key starting with '_', and leaves out the real one added
UB Updated by Upkeep Bot about 2 months ago
- Copied to Backport #81739: umbrella: rgw: radoslist names a nonexistent OLH for a versioned key starting with '_', and leaves out the real one added
UB Updated by Upkeep Bot about 2 months ago
- Status changed from Fix Under Review to Backporting
- Merge Commit set to d31d96802d50dbdb327643e1572d3fd378ad488e
- Fixed In set to v21.3.0-4390-gd31d96802d
- Upkeep Timestamp set to 2026-10-14T02:55:16+00:00