Skip to content

rgw/lc: don't report a canceled transition as transitioned - #72609

Merged
BBoozmen merged 5 commits into
ceph:mainfrom
BBoozmen:wip-oozmen-81669-lc-transition-reporting
Oct 29, 2026
Merged

BBoozmen merged 5 commits into
ceph:mainfrom
BBoozmen:wip-oozmen-81669-lc-transition-reporting

Conversation

@BBoozmen

Copy link
Copy Markdown
Contributor

Fixes: https://tracker.ceph.com/issues/81669

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

Add a "delay_copy_obj_data_complete" point for rgw_inject_delay_pattern
that holds copy_obj_data() after it reads the source and before it
writes the head object. Tests use it to land a concurrent overwrite in
that window, e.g. while lifecycle is transitioning an object.

Signed-off-by: Oguzhan Ozmen <[email protected]>
@BBoozmen BBoozmen self-assigned this Oct 12, 2026
@BBoozmen
BBoozmen requested a review from a team as a code owner October 12, 2026 20:53
@ivancich
ivancich requested a review from mattbenjamin October 15, 2026 14:24

@mattbenjamin mattbenjamin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the changes in rgw_lc.{h,cc} are very much fine, I would like a review by Soumya and/our Casey on the internal flow

Comment thread src/rgw/rgw_lc.cc Resolved
Comment thread src/rgw/rgw_lc.cc Resolved
Comment thread src/rgw/rgw_lc.cc Resolved
@BBoozmen
BBoozmen force-pushed the wip-oozmen-81669-lc-transition-reporting branch from c319de7 to f249a64 Compare October 21, 2026 23:20
Overwrite an object while lifecycle is transitioning it, between reading
the source and writing the head. The transition loses the race and is
rolled back, so lifecycle must not log it as TRANSITIONED.

The lifecycle suite runs rgw with 'rgw lc debug interval: 10', so its
own LC thread could transition the object (or the overwritten one)
before radosgw-admin does. Use a 5-day rule and run radosgw-admin with
a 1s day: the object is due for radosgw-admin after 5s but for rgw only
after 50s. Rerun radosgw-admin if it exits before the transition
starts, e.g. when rgw's LC thread holds the shard lock.

Without the fix, lifecycle logs the canceled transition as
"TRANSITIONED" and the test fails.

Reproduces: https://tracker.ceph.com/issues/81669
Signed-off-by: Oguzhan Ozmen <[email protected]>
If a transition loses a race (the object is overwritten or removed while it is
being copied), the write is rolled back and it's set "canceled" with 0 return
value.

copy_obj_data() passed no pcanceled pointer, so the flag was dropped and
transition_obj() reported success for an object it had not moved. Lifecycle
then logged it as "TRANSITIONED", bumped the transition counters and
published a notification for it.

Add the "pcanceled" param instead of passing nullptr and return -ECANCELED
when the write was canceled, so lifecycle handles it like any other failed
transition. The object is re-evaluated against the rules on the next
lifecycle run.

Fixes: https://tracker.ceph.com/issues/81669
Signed-off-by: Oguzhan Ozmen <[email protected]>
transition() returns -ECANCELED when the object was overwritten or removed
while lifecycle was transitioning it. Say so in the error message, so this
race can be told apart from other transition failures.

Check for it in the canceled-transition test.

Signed-off-by: Oguzhan Ozmen <[email protected]>
LCOpRule::execute() runs every lifecycle action (expiration and
transition), but logged any failure as "ERROR: remove_expired_obj", so a
failed transition read like a failed expiration.

Use generic "lifecycle action failed" message instead.

Also add the rule ID so the failure can be traced back to the rule that fired.

Signed-off-by: Oguzhan Ozmen <[email protected]>
@BBoozmen
BBoozmen force-pushed the wip-oozmen-81669-lc-transition-reporting branch from f249a64 to de60bc8 Compare October 22, 2026 01:22
@BBoozmen
BBoozmen requested a review from soumyakoduri October 22, 2026 15:30
@BBoozmen BBoozmen added needs-qa wip-oozmen-testing for teuthology integration testing to be used via build-integration-branch.sh and removed needs-review wip-oozmen-testing for teuthology integration testing to be used via build-integration-branch.sh labels Oct 22, 2026
@BBoozmen

BBoozmen commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

ceph-ci branch: https://github.com/ceph/ceph-ci/commits/wip-oozmen-testing-lc-xtion-reporting-2026-10-26-2016/
qa test results: https://pulpito.ceph.com/?sha1=be44b5ca11b19926d6b16a1ba1fb9ffe88376751

Summary

  • 90 tests in total: all 90 PASSED
  • In the first submission just 1 suite failed (not a related failure) & in the re-run of that single suite, it also passed

The new testcase run_failure_test_canceled_transition

It ran and passed: e.g., job 681130, rgw/lifecycle transition$/compressed, rocky 10. LC now reports cancellation of the transition as expected:

  === Testing transition canceled by a concurrent overwrite ===
  lifecycle: copy_obj_data: injecting delay of 5s for lc-recompress-bucket:test-object-canceled
  lifecycle: ERROR: failed to transition obj ...:test-object-canceled -> LUKEWARM (125) Operation canceled (object changed concurrently)
  lifecycle: ERROR: lifecycle action failed on ...:test-object-canceled rule_id=to-lukewarm (125) Operation canceled
  Canceled transition test passed
  All lifecycle recompression tests passed

@BBoozmen BBoozmen removed the needs-qa label Oct 29, 2026
@BBoozmen BBoozmen added TESTED and removed wip-oozmen-testing for teuthology integration testing to be used via build-integration-branch.sh labels Oct 29, 2026
@BBoozmen
BBoozmen merged commit a370867 into ceph:main Oct 29, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants