Project

General

Profile

Actions

Bug #75777

closed
VM IG

rgw: Lifecycle Processing Fails with EFBIG on Versioned Buckets with Large Bucket Index

Bug #75777: rgw: Lifecycle Processing Fails with EFBIG on Versioned Buckets with Large Bucket Index

Added by Vidushi Mishra 8 months ago. Updated 8 months ago.

Status:
Duplicate
Priority:
Urgent
Assignee:
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

Description

RGW lifecycle processing fails with error -27 (EFBIG - File too large) when attempting to process versioned buckets that have accumulated large bucket indexes.
The cls_bucket_list_unordered operation cannot enumerate bucket contents when the bucket index exceeds BlueStore/RocksDB OMAP size limits, preventing lifecycle
expiration policies from executing.

This renders lifecycle policies non-functional on versioned buckets at scale, leaving buckets in an unmanageable state with orphaned metadata that cannot be
cleaned up.

---
Environment

Multisite Configuration:
- Realm: usa
- Zonegroup: coast
- Primary Zone: east (cali002)
- Secondary Zone: west (cali005)

Cluster Details:
- 2 sites, 4 hosts per site (8 hosts total)
- 8 OSDs per site (2 OSDs per host, 16 OSDs total)
- OSD Storage: BlueStore with single shared device (3.5TB SSD per OSD)
- RAM: 128GB per host
- CPU: Intel Xeon Gold 6330 @ 2.00GHz
- Network: 10GbE between sites
- Ceph Version: 20.3.0-5695-gc41963d7 (tentacle dev)

Affected Buckets:
All 5 tested buckets fail with identical error:
- arthurf.216-scenario3-bkt-0
- arthurf.216-scenario3-bkt-1
- arthurf.216-scenario3-bkt-2
- arthurf.216-scenario3-bkt-3
- arthurf.216-scenario3-bkt-4

---
Steps to Reproduce

1. Create Versioned Buckets
for i in {0..4}; do
s3cmd mb s3://arthurf.216-scenario3-bkt-${i}
s3cmd setversioning s3://arthurf.216-scenario3-bkt-${i} --versioning-on
done

2. Upload Objects with Multiple Versions
- Upload 6,500 objects per bucket
- Create 10 versions per object via repeated PUTs
- Object size: 2 bytes per version
- Expected: 65,000 total versions per bucket

3. Apply Lifecycle Expiration Policy
<LifecycleConfiguration>
<Rule>
<ID>expire-all-versions</ID>
<Status>Enabled</Status>
<Expiration>
<Days>1</Days>
</Expiration>
<NoncurrentVersionExpiration>
<NoncurrentDays>1</NoncurrentDays>
</NoncurrentVersionExpiration>
</Rule>
</LifecycleConfiguration>

Applied from primary zone:
s3cmd setlifecycle lifecycle-policy.xml s3://arthurf.216-scenario3-bkt-0
(Repeat for all 5 buckets)

4. Trigger Lifecycle Processing
radosgw-admin lc process --bucket arthurf.216-scenario3-bkt-0 --rgw-lc-debug-interval=600

---
Expected Behavior

- Lifecycle processing should enumerate bucket contents successfully
- Objects matching expiration criteria should be deleted
- Bucket index metadata should be cleaned up
- LC process should complete without errors

---
Actual Behavior

Error Pattern (Consistent across all 5 buckets)

2026-03-29T01:45:59.140-0400 7f5f55d1cc40 0 ERROR: cls_bucket_list_unordered: error in rgw_rados_operate (bucket list op), r=-27
2026-03-29T01:45:59.140-0400 7f5f55d1cc40 0 ERROR: list_objects_unordered cls_bucket_list_unordered returned 27 for
:arthurf.216-scenario3-bkt-0[39ecb1a9-b4b2-41e9-9e58-6e691cc96dbb.23283.4])
ERROR: driver
>list_objects(): (27) File too large
ERROR: lc processing returned error: (27) File too large

Bucket Index Entry Counts

Command to verify bi-list size:
radosgw-admin bi list --bucket arthurf.216-scenario3-bkt-0 | jq '. | length'

Actual output for all 5 buckets:

bkt-0: 460,296 entries (file size: 409MB)
bkt-1: 409,788 entries (file size: 364MB)
bkt-2: 419,098 entries (file size: 373MB)
bkt-3: 412,330 entries (file size: 367MB)
bkt-4: 410,771 entries (file size: 365MB)

Expected entries per bucket: 65,000 (6,500 objects × 10 versions)
Actual entries per bucket: 409,788 - 460,296 (6.3x - 7.1x bloat)

All 5 buckets fail LC processing with error -27 (EFBIG - File too large).

Per-Shard Analysis (bkt-0)

radosgw-admin bucket stats --bucket arthurf.216-scenario3-bkt-0 | jq '.num_shards'
  1. Output: 11

Calculation:
- Total bi-list entries: 460,296
- Number of shards: 11
- Average entries per shard: 41,845 entries

Even with 11 shards, the bucket index is heavily bloated with orphaned metadata.

Bucket Index Composition

The bucket index contains:
- Plain entries with "exists": false (orphaned metadata from deletions)
- OLH (Object Link Header) entries with "pending_removal": true
- Version markers and bi-log entries
- Metadata overhead creates 6-7x more entries than actual object versions

Example entry structure showing orphaned metadata: {
"type": "plain",
"idx": "r0-f1007",
"entry": {
"name": "r0-f1007",
"instance": "",
"exists": false,
"meta": {
"category": 0,
"size": 0,
"mtime": "0.000000"
},
"flags": 8,
"versioned_epoch": 0
}
}

Bucket Stats Show Zero Objects

radosgw-admin bucket stats --bucket arthurf.216-scenario3-bkt-0

Output: {
"bucket": "arthurf.216-scenario3-bkt-0",
"num_objects": 0,
"num_shards": 11,
"size_kb": 0,
"reshard_status": "None"
}

Current State:
- bucket stats reports 0 objects (metadata indicates deletion occurred)
- bi list shows 460,296 orphaned entries
- LC process cannot clean up bucket index metadata due to error 27
Bucket is in inconsistent state and unusable for new operations

Discrepancy:
  1. Bucket stats shows clean state
    radosgw-admin bucket stats --bucket arthurf.216-scenario3-bkt-0
  2. num_objects: 0, size_kb: 0
  1. But bi-list shows massive orphaned metadata
    radosgw-admin bi list --bucket arthurf.216-scenario3-bkt-0 | jq '. | length'
  2. Output: 460296 entries

---
Root Cause

1. Bucket Index Bloat:
Versioned buckets accumulate excessive metadata entries (OLH, bi-log, version markers, orphaned entries) beyond actual object count. Observed 6-7x bloat factor
(expected 65K entries, actual 409K-460K entries).

2. OMAP Size Limitation:
BlueStore/RocksDB OMAP operations have practical size limits. When bucket index exceeds these thresholds, cls_bucket_list_unordered fails with -27 (EFBIG).

3. No Fallback Method:
The cls_bucket_list_unordered operation has no alternative enumeration method or chunking strategy for large bucket indexes. It fails immediately when OMAP size
is exceeded.

4. Metadata Orphaning:
Once objects are deleted, bucket stats correctly show 0 objects, but the bucket index (bi-list) retains hundreds of thousands of orphaned metadata entries
(exists=false, pending_removal=true) that LC cannot clean up due to the listing failure.

---
Impact

- Lifecycle policies are non-functional on versioned buckets with large bucket indexes (>400K bi-list entries observed to fail)
- No automated cleanup path available
- Buckets enter unmanageable state requiring manual intervention
- Affects any production workload using versioned buckets at scale (100K+ versions)
- Data retention and compliance policies cannot be enforced via LC

---
Diagnostic Data Available

Files saved to /tmp/scenario3_diagnostics/ (total ~1.9GB):

Bucket Statistics (JSON):
- bkt-0_stats.json (1.7KB)
- bkt-1_stats.json (1.2KB)
- bkt-2_stats.json (1.2KB)
- bkt-3_stats.json (1.7KB)
- bkt-4_stats.json (1.4KB)

Full Bucket Index Dumps:
- bkt-0_bi_list.json (409MB - 460,296 entries)
- bkt-1_bi_list.json (364MB - 409,788 entries)
- bkt-2_bi_list.json (373MB - 419,098 entries)
- bkt-3_bi_list.json (367MB - 412,330 entries)
- bkt-4_bi_list.json (365MB - 410,771 entries)

Error Logs:
- lc_error_logs.txt (13KB - LC processing failures from multiple retry attempts over 3 hours)
- bucket_list_errors_current.txt (2.1KB - Fresh bucket list error outputs)
- summary.txt (1.7KB - Test summary)

Related Issues

Similar to Red Hat BZ#2424287, which reports an identical error pattern with versioned buckets exceeding OMAP size limitations.


Related issues 2 (0 open — 2 closed)

Related to rgw - Bug #74428: versioning: racing deletes may leak olh head objects and associated index entriesDuplicateShilpa MJ

Actions
Is duplicate of rgw - Bug #75340: rgw/multisite: a wrong epoch is used in the olh entry when olh_epoch is 0 in an instance unlink op BackportingJane Zhu

Actions

MB Updated by Matt Benjamin 8 months ago Actions #1

  • Status changed from New to In Progress

MB Updated by Matt Benjamin 8 months ago Actions #2

  • Status changed from In Progress to New

JI Updated by J. Eric Ivancich 8 months ago Actions #3

  • Subject changed from RGW Lifecycle Processing Fails with EFBIG on Versioned Buckets with Large Bucket Index to rgw: Lifecycle Processing Fails with EFBIG on Versioned Buckets with Large Bucket Index

It looks like Casey's downstream fix for this issue was to revert "rgw: implement timestamp-based epochs", which is commit 4195486c8edc68bfdf5cd4d87e04ef67f35a9364 on the main branch and is in this PR:
https://github.com/ceph/ceph/pull/62469

Vidushi, am I correct in assuming this is on the main branch?

Igor, would you like to address or revert?

CB Updated by Casey Bodley 8 months ago Actions #4

  • Related to Bug #74428: versioning: racing deletes may leak olh head objects and associated index entries added

JI Updated by J. Eric Ivancich 8 months ago Actions #5

  • Status changed from New to Triaged
  • Assignee set to Igor Gomon

JI Updated by J. Eric Ivancich 8 months ago Actions #6

  • Priority changed from Normal to Urgent

I shifted this to URGENT since it's a regression.

JI Updated by J. Eric Ivancich 8 months ago Actions #7

  • Status changed from Triaged to Duplicate

JI Updated by J. Eric Ivancich 8 months ago Actions #8

  • Is duplicate of Bug #75340: rgw/multisite: a wrong epoch is used in the olh entry when olh_epoch is 0 in an instance unlink op added
Actions

Also available in: PDF Atom