Bug #80894
closedrgw: bucket index can keep a stale entry after out-of-order index completions
0%
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.
KB Updated by Kyle Bader 2 months ago
- Pull request ID set to 72097
MH Updated by Matthew Heler 2 months ago
- 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
- 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
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
- 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
- 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
- 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