Project

General

Profile

Actions

Bug #80653

closed
NH MH

Spurious 404 on versioned bucket while lifecycle expires noncurrent versions

Bug #80653: Spurious 404 on versioned bucket while lifecycle expires noncurrent versions

Added by Nathan Hoad 3 months ago. Updated about 1 month ago.

Status:
Backporting
Priority:
Normal
Assignee:
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
tentacle, squid, umbrella
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Fixed In:
v21.3.0-4581-gdcd6d90fab
Released In:
Upkeep Timestamp:
2026-10-19T05:14:45+00:00

Description

On a versioned bucket, `GET`/`HEAD` without a `versionId` intermittently returns 404 for an object that has a valid current version, while lifecycle is expiring noncurrent versions of that key. The same read succeeds moments later with no intervening write.

Reproducing this is pretty trivial:

1. vstart a cluster
2. `ceph config set client rgw_lc_debug_interval 10` to speed up LC (1 day = 10 seconds)
3. Create a versioned bucket, LC rule `NoncurrentVersionExpiration: 1`
4. Create ~40 versions of one key to kick it off
5. Concurrently: a PUT loop on that key, a HEAD/GET loop for the current version (no `versionId`), and `radosgw-admin lc process --bucket X` on repeat
6. On each 404, immediately re-GET the same key — it returns 200

I dug through the call chain around `follow_olh` and after adding some debugging, this is what's going on...

`RGWRados::follow_olh()` converts `ECANCELED` to `ENOENT`, which becomes a 404.
`RGWRados::update_olh()` propagates `ECANCELED`
`RGWRados::apply_olh_log()` returns `ECANCELED`

There's a comment in `follow_olh()` that explains the conversion:

```cpp
if (ret == -ECANCELED) {
// In this context, ECANCELED means that the OLH tag changed in either the bucket index entry or the OLH object.
// If the OLH tag changed, it indicates that a previous OLH entry was removed since this request started. We
// return ENOENT to indicate that the OLH object was removed.
ret = -ENOENT;
}
```

`apply_olh_log()` can return ECANCELED from two places: the guarded write on the
OLH object, and the `delete_obj()` call it makes for instances being removed. The
guarded write checks two xattrs:

```cpp
op.cmpxattr(RGW_ATTR_OLH_ID_TAG, CEPH_OSD_CMPXATTR_OP_EQ, olh_tag);
op.cmpxattr(RGW_ATTR_OLH_VER, CEPH_OSD_CMPXATTR_OP_GTE, last_ver);
```

My debugging logs the ECANCELED at the `apply_olh_log()` boundary, so I can't yet say which of those produced it. I don't think it matters for the bug though: the OLH tag was identical on every failing request, and the current version was never deleted. The OLH was there and valid the whole time. So the assumption in that comment — that ECANCELED means the OLH was removed — is wrong here regardless of which path returned it.

If it is the guarded write, the unchanged tag points at the `OLH_VER` check rather than the tag check, but I haven't separated the two.

There's a few different approaches to fixing this, but there's no clear best solution:

  • Return the OLH target we already had loaded. Will serve a possibly-stale target.
  • Re-follow the OLH (i.e. implement a retry).
  • Only convert ECANCELED to ENOENT when the OLH is really gone. This would re-surface this issue as 500s.

I verified this against both squid and main. I've also attached the script to reproduce it, you'll need to run `ceph config set client rgw_lc_debug_interval 10` yourself first and then execute the script. It will do steps 3-6 from above.


Files

olh-repro.py (6.6 KB) olh-repro.py Nathan Hoad, 09/18/2026 05:31 PM

Related issues 3 (2 open — 1 closed)

Copied to rgw - Backport #81863: tentacle: Spurious 404 on versioned bucket while lifecycle expires noncurrent versionsFix Under ReviewMatthew Heler

Actions
Copied to rgw - Backport #81865: squid: Spurious 404 on versioned bucket while lifecycle expires noncurrent versionsNewJesse Williamson

Actions
Copied to rgw - Backport #81867: umbrella: Spurious 404 on versioned bucket while lifecycle expires noncurrent versionsResolvedMatthew Heler

Actions

MH Updated by Matthew Heler 2 months ago Actions #1

  • Assignee set to Matthew Heler
  • Backport set to tentacle, squid, umbrella
  • Pull request ID set to 71924

MH Updated by Matthew Heler 2 months ago Actions #2

Would you mind trying https://github.com/ceph/ceph/pull/71924? I was not able to reproduce the issue with the attached pythons script and that PR.

UB Updated by Upkeep Bot about 1 month ago Actions #3

  • Copied to Backport #81863: tentacle: Spurious 404 on versioned bucket while lifecycle expires noncurrent versions added

UB Updated by Upkeep Bot about 1 month ago Actions #4

  • Copied to Backport #81865: squid: Spurious 404 on versioned bucket while lifecycle expires noncurrent versions added

UB Updated by Upkeep Bot about 1 month ago Actions #5

  • Copied to Backport #81867: umbrella: Spurious 404 on versioned bucket while lifecycle expires noncurrent versions added

UB Updated by Upkeep Bot about 1 month ago Actions #6

  • Status changed from New to Backporting
  • Merge Commit set to dcd6d90fabcee78f697a55151112d49f234668a3
  • Fixed In set to v21.3.0-4581-gdcd6d90fab
  • Upkeep Timestamp set to 2026-10-19T05:14:45+00:00
Actions

Also available in: PDF Atom