Repository navigation
Conversation
rgw_inject_delay() holds a request at a named point when rgw_inject_delay_pattern names it and rgw_inject_delay_sec is positive. A request coroutine waits on a timer, so the frontend keeps serving other requests meanwhile. The points: - write_meta_before_head_write: every head write, before its OSD op - copy_obj_before_write_meta: a copy, after it reads the source - complete_mp_after_head_write: a multipart completion, after its head write and before it deletes the meta object - delete_obj_before_head_delete: a delete, after it reads the head and before it prepares its index op rgw_debug_inject_mp_meta_delete_err makes a multipart completion's delete of its meta object fail with that errno, after the head write. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Kyle Bader <[email protected]>
Each case holds one request at an injection point while another request changes the same key. It then deletes every key, drains GC and expects no RADOS object of the bucket to remain: - test_losing_complete: a completion that loses the head write to a PutObject leaks its parts - test_delete_racing_put: a DeleteObject, which has no ID-tag guard, removes a newer head and leaks its tail - test_losing_copy: a copy that loses the head write keeps its references on the source's tail - test_delete_racing_dedup: a delete that read the head before dedup rewrote it leaks the source's tail - test_copy_to_itself_racing_dedup: a copy onto itself writes back a tail that dedup freed, and the object no longer reads Every case fails on main. A case whose race does not play out as arranged reports itself inconclusive rather than passing. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Kyle Bader <[email protected]>
Config Diff Tool Output+ added: rgw_debug_inject_link_olh_log_err_key (rgw.yaml.in)
+ added: rgw_debug_inject_mp_meta_delete_err (rgw.yaml.in)
The above configuration changes are found in the PR. Please update the relevant release documentation if necessary. |
Four cases, each holding one request at an injection point: - test_cond_delete_racing_put: a DeleteObject with If-Match removes an object that a PutObject wrote after the delete checked the ETag (https://tracker.ceph.com/issues/80898) - test_conditional_puts_race: an If-Match PutObject and an If-Match: * PutObject are both answered success while the head holds the first (https://tracker.ceph.com/issues/80906) - test_if_match_losing_race: an If-Match PutObject that loses the race is answered 500 (https://tracker.ceph.com/issues/80906) - test_refused_complete_keeps_parts: a completion with If-None-Match: * refused with 412 drops its parts from the bucket index, though its upload stays (https://tracker.ceph.com/issues/80907) All four fail on main; the first passes with the delete guard. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Kyle Bader <[email protected]>
In a versioned bucket a write links its version to the olh after its head write, and a DeleteObject links a delete marker or unlinks a version without removing a head, so the existing points miss those races. Add: - write_meta_before_olh_link: a versioned write, after its head and index entry are written, before it links the olh - delete_obj_before_olh_link: a DeleteObject without a version id, after it checks the current version, before it links its delete marker - delete_obj_before_unlink_instance: a DeleteObject of a version, after it reads and checks the version's index entry, before it unlinks it - unlink_instance_before_olh_update: a DeleteObject of a version, after the index unlinks it and logs its removal, before the olh log is applied rgw_inject_delay_pattern may now name several points, separated by commas, so that a case can hold two requests at different points. rgw_debug_inject_link_olh_log_err_key makes the olh link of a write or delete of that object name fail after the bucket index has linked the version, as a bilog flush that fails there would. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Kyle Bader <[email protected]>
The overwrite-race cases ran only in buckets that are not versioned. Versioned buckets take other paths: a write links its version to the olh after its head write, a DeleteObject links a delete marker or unlinks a version, and with versioning suspended the null version shares the key's head object with the olh. Bucket setup and cleanup: - new_bucket() can enable or suspend versioning. With versioning suspended it first gives each key an olh, a version and a delete marker written while versioning was enabled. - check_no_leaks() deletes every version and delete marker. - config() sets options for the duration, globally, since the OSDs read rgw_pending_bucket_index_op_expiration in cls_rgw. - etag() answers None for a head that lost its object's attributes. Cases: - the seven head-race cases again with versioning suspended (<case>_suspended); - a PutObject with If-Match, or a DeleteObject with If-Match, racing a PutObject at the olh link, with versioning enabled; a loser must be answered 409; - two PutObjects with If-None-Match: * of a null version; one wins, the key reads back as its object, and the loser is answered 409; - a DeleteObject of the null version racing a PutObject that links after the removal is logged; - an olh link that fails after the index links the version, for a PutObject (enabled, suspended) and a CompleteMultipartUpload; - a copy onto itself while a non-null version is current, of the null version, and racing a tagging or an ACL update; - a listing during a stalled PutObject, with versioning enabled and suspended, checked with ListObjects and ListObjectVersions. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Kyle Bader <[email protected]>
|
I ran this series on a single-host vstart cluster (1 OSD, 1 RGW, RelWithDebInfo) to see how often the conditional-write races happen without the injection points. Test: 8 clients released together on one key, 330 rounds per cell (300 with 1 KiB bodies, 30 with 6 MiB). "Rounds with more than one 200" should be 0.
Versioning-suspended buckets behaved like unversioned ones. In no round was the final object anything but a write that was answered 200. So on a versioning-enabled bucket the race in #72118 needs no special timing: nearly every contended round has several winners, and with #72118 exactly one. On unversioned buckets #72109 turns the 500s into 409/412. The workunit here: 6 pass / 22 fail / 1 inconclusive on this PR's head, 16 / 12 / 1 with #72109 merged in ( Not tested: #72109 and #72118 together (they conflict in |
Reproducers for races between writers of one key that leak RADOS objects or lose data, found with a formal model of RGW overwrites and multipart uploads (https://github.com/mmgaggle/ceph/tree/cdbbbb09245535782e91503ad45b0cc7a423e10d/src/test/formal/p/rgw_overwrite).
rgw_inject_delay()holds a request at a named point whenrgw_inject_delay_patternnames it andrgw_inject_delay_secis positive; a request coroutine waits on a timer, so the frontend keeps serving. Points:write_meta_before_head_write,copy_obj_before_write_meta,complete_mp_after_head_write,delete_obj_before_head_delete.rgw_debug_inject_mp_meta_delete_errmakes a multipart completion's delete of its meta object fail, after the head write.qa/workunits/rgw/test_rgw_overwrite_races.py: each case holds one request at a point while another changes the key, then deletes every key, drains GC, and expects no RADOS object of the bucket to remain (or the object to read back whole). It sets its knobs at runtime withceph config set.test_losing_completetest_delete_racing_puttest_losing_copytest_delete_racing_dedup,test_copy_to_itself_racing_dedupEvery case fails on main, and passes with its fix on a vstart cluster. The workunit is not added to a qa suite yet, since the dedup cases fail until https://tracker.ceph.com/issues/80901 is addressed. s3-tests counterparts, for https://tracker.ceph.com/issues/80895, https://tracker.ceph.com/issues/80896, https://tracker.ceph.com/issues/80900 and https://tracker.ceph.com/issues/80903, are in https://github.com/mmgaggle/s3-tests/tree/wip-rgw-overwrite-races.
Four cases for conditional requests, added later:
test_cond_delete_racing_puttest_conditional_puts_racetest_if_match_losing_racetest_refused_complete_keeps_partsVersioned buckets and other scenarios
The injection points and the workunit now cover versioned buckets. The existing points miss versioned races, because a versioned write links its version to the olh after its head write, and a versioned DeleteObject links a delete marker or unlinks a version without reaching
delete_obj_before_head_delete.write_meta_before_olh_link,delete_obj_before_olh_link,delete_obj_before_unlink_instanceandunlink_instance_before_olh_update.rgw_inject_delay_patternaccepts a comma-separated list of points, so a case can hold two requests at different points.rgw_debug_inject_link_olh_log_err_key: the olh link of that object name fails after the bucket index links the version.The workunit passes with the whole series applied. Its versioned cases need the versioning follow-ups on #72098, #72100, #72101, #72103, #72115 and #72118, and it expects the 409 answers of #72109 and #72118.
Checklist