Project

General

Profile

Actions

Bug #80894

closed
KB KB

rgw: bucket index can keep a stale entry after out-of-order index completions

Bug #80894: rgw: bucket index can keep a stale entry after out-of-order index completions

Added by Kyle Bader 2 months ago. Updated about 2 months ago.

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

0%

Source:
Backport:
tentacle, umbrella
Regression:
Yes
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Fixed In:
v21.3.0-4517-g0a7bfbf42a
Released In:
Upkeep Timestamp:
2026-10-16T04:29:12+00:00

Description

Found with a formal model of RGW overwrites and multipart uploads P model, and reproduced on main at 44d50f6abb9 on a single-host vstart cluster, except where noted. By code review the same code is in tentacle, except where noted.

rgw_bucket_complete_op sets entry.ver = op.ver even for an op it skips as stale, and for a cancel, which sets it to {-1, 0}. A later completion from an older epoch then passes the epoch check and overwrites the newer entry, and with no pending op left, no listing repairs it. Three PutObjects whose completions arrive out of order leave ListObjects listing an object the head no longer holds. A delete, put, delete sequence can leave a listed key that answers 404; possibly the symptom in #53457. The assignment moved above the cancel branch in 8b27472bbd8a.

Reproducer: ceph_test_cls_rgw tests index_stale_complete_keeps_newest, index_cancel_keeps_newest and index_stale_complete_after_delete cls_rgw tests. All three fail on main; the header's stats keep the older write's size. They need no injection points.

Proposed fix: assign the version only when the op is applied.


Related issues 3 (2 open — 1 closed)

Has duplicate rgw - Bug #81002: cls_rgw: bucket_complete_op writes a stale epoch back on cancel, so an older completion can overwrite newer index metadataDuplicateMatthew Heler

Actions
Copied to rgw - Backport #81816: tentacle: rgw: bucket index can keep a stale entry after out-of-order index completionsNewKyle Bader

Actions
Copied to rgw - Backport #81817: umbrella: rgw: bucket index can keep a stale entry after out-of-order index completionsNewKyle Bader

Actions

KB Updated by Kyle Bader 2 months ago Actions #1

  • Pull request ID set to 72097

MH Updated by Matthew Heler 2 months ago Actions #2

  • Status changed from New to Fix Under Review
  • Assignee set to Kyle Bader
  • Backport changed from tentacle to tentacle, umbrella

MH Updated by Matthew Heler 2 months ago Actions #3

  • Has duplicate Bug #81002: cls_rgw: bucket_complete_op writes a stale epoch back on cancel, so an older completion can overwrite newer index metadata added

JH Updated by Joshua Hoblitt 2 months ago Actions #4

This is @jhoblitt's AI agent.

Could squid be added to the Backport field? The unconditional entry.ver = op.ver came with 8b27472bbd8a, which is in v17.2.0 and later, so every squid release carries it.

We reproduced both triggers on v19.2.6 by direct class calls on a fresh index object (details in #81002, closed as a duplicate of this issue): completions at epochs 10, 5 and 7 leave 7's metadata indexed, and completion 10, radosgw's pool -1 / epoch 0 cancel, then completion 5 leave 5's metadata indexed. v20.2.4 gave identical results.

UB Updated by Upkeep Bot about 2 months ago Actions #5

  • Copied to Backport #81816: tentacle: rgw: bucket index can keep a stale entry after out-of-order index completions added

UB Updated by Upkeep Bot about 2 months ago Actions #6

  • Copied to Backport #81817: umbrella: rgw: bucket index can keep a stale entry after out-of-order index completions added

UB Updated by Upkeep Bot about 2 months ago Actions #7

  • Status changed from Fix Under Review to Backporting
  • Merge Commit set to 0a7bfbf42a4b760703d29d68bd1ae8abab547285
  • Fixed In set to v21.3.0-4517-g0a7bfbf42a
  • Upkeep Timestamp set to 2026-10-16T04:29:12+00:00
Actions

Also available in: PDF Atom