Bug #77278
closedrgw/duplicate entries in radosgw-admin lc list
0%
Description
I was investigating why a LC didn't process over the weekend. When I checked radosgw-admin lc list, I noticed that there were multiple entries for the bucket.
# radosgw-admin lc list | grep -A3 bucket-name
"bucket": ":bucket-name:0a6e5079-ad65-4ea7-a868-b2133099e0d0.1784023559.13521",
"shard": "lc.4",
"started": "Thu, 01 Jan 1970 00:00:00 GMT",
"status": "UNINITIAL"
--
"bucket": ":bucket-name:0a6e5079-ad65-4ea7-a868-b2133099e0d0.1784023559.13521",
"shard": "lc.20",
"started": "Tue, 02 Jun 2026 00:07:19 GMT",
"status": "COMPLETE"
The bucket currently has around 72M objects, 1999 shards through dynamic resharding, versioning is enabled, and object lock is enabled.
I tried to delete the lifecycle policy using aws client. It left one but I can't remove it.
# radosgw-admin lc list | grep -A3 bucket-name
"bucket": ":bucket-name:0a6e5079-ad65-4ea7-a868-b2133099e0d0.1784023559.13521",
"shard": "lc.20",
"started": "Tue, 02 Jun 2026 00:07:19 GMT",
"status": "COMPLETE"
Trying to process it gives an error.
# radosgw-admin lc process --bucket bucket-name 2026-06-09T19:35:29.216+0000 7f30be609b40 0 lifecycle: WARNING: bucket_attrs.find(RGW_ATTR_LC) failed for bucket-name (terminates bucket_lc_process(...))
JI Updated by J. Eric Ivancich 6 months ago
We discussed this in the rgw bug scrub today. The theory is that the number of LC shards was changed after the system was running. This alters the mapping of bucket to shard, and one entry for this bucket is using the old mapping. This change is not recommended and perhaps the documentation isn't clear on this matter.
Casey noticed that radosgw-admin has a "lc reshard fix" sub-command. We're not sure what that does; have you looked into it?
@Matt Benjamin : do you have any thoughts?
RG Updated by Reid Guyett 6 months ago
I looked at ceph config log and that value was changed recently. I think I grabbed the wrong setting when trying to change the number of LC workers. Since most of the LC entries were created with the default, I will revert it back.
radosgw-admin lc reshard fix seems to add missing entries to the correct shards but doesn't appear to remove the invalid shards.
I noticed that these are omap on the shards, could the invalid omap be removed from the shards with the rados rmomapkey command? I'm not sure if there is other information or just this omap.
MH Updated by Matthew Heler 6 months ago
The docs need an update here, to make it clear changing this option should be done diligently with thoughtful care.
I also think an operator driven tool is needed as well to move LCEntry into the appropriate hashed shards if this value is changed. There may be legitimate reasons why an operator may want to increase the number of shards.
MH Updated by Matthew Heler 6 months ago
- Assignee set to Matthew Heler
RG Updated by Reid Guyett 6 months ago
I was able to fix my situation.
1. Reverted setting
ceph config set client.rgw rgw_lc_max_objs 32
2. Backed up LC policies of items with duplicate entries.
for BUCKET in $LISTOFBUCKETS; do aws --profile s3-admin s3api get-bucket-lifecycle --bucket "$BUCKET" > "$BUCKET-lc.json" ; done
3. Delete LC policies.
for BUCKET in $LISTOFBUCKETS; do aws --profile s3-admin s3api delete-bucket-lifecycle --bucket "$BUCKET" ; done
4. Deleted the omap keys from lc shards.
rados -p zone.rgw.log -N lc rmomapkey lc.N $BUCKET.$marker
5. Restore LC policies.
for BUCKET in $LISTOFBUCKETS; do aws --profile s3-admin s3api put-bucket-lifecycle --bucket "$BUCKET" --lifecycle-configuration file://$BUCKET-lc.json ; done
MH Updated by Matthew Heler 6 months ago
- Backport changed from tentacle to tentacle, umbrella
- Pull request ID set to 69528
CB Updated by Casey Bodley 6 months ago
- Status changed from New to Fix Under Review
MH Updated by Matthew Heler 5 months ago
- Backport changed from tentacle, umbrella to squid, tentacle, umbrella
UB Updated by Upkeep Bot 5 months ago
- Status changed from Fix Under Review to Pending Backport
- Merge Commit set to c0f5b1c9ff74301eae40e247d576baa241fa0a2c
- Fixed In set to v21.3.0-490-gc0f5b1c9ff
- Upkeep Timestamp set to 2026-06-27T05:52:14+00:00
UB Updated by Upkeep Bot 5 months ago
- Copied to Backport #77747: umbrella: rgw/duplicate entries in radosgw-admin lc list added
UB Updated by Upkeep Bot 5 months ago
- Copied to Backport #77748: tentacle: rgw/duplicate entries in radosgw-admin lc list added
UB Updated by Upkeep Bot 5 months ago
- Copied to Backport #77749: squid: rgw/duplicate entries in radosgw-admin lc list added
UB Updated by Upkeep Bot 5 months ago
- Tags (freeform) set to backport_processed
UB Updated by Upkeep Bot 3 months ago
- Status changed from Pending Backport to Resolved
- Tags (freeform) deleted (
backport_processed) - Upkeep Timestamp changed from 2026-06-27T05:52:14+00:00 to 2026-08-27T18:36:06+00:00