Skip to content

umbrella: rgw: preserve head mtime in olh_cancel_modification() - #73261

Merged
batrick merged 7 commits into
ceph:umbrellafrom
BBoozmen:wip-82321-umbrella
Nov 24, 2026
Merged

batrick merged 7 commits into
ceph:umbrellafrom
BBoozmen:wip-82321-umbrella

Conversation

@BBoozmen

Copy link
Copy Markdown
Contributor

Extend the already existing 'original null object version is intact after failed
olh upgrade' test case.

After the injected set_olh() failure is rolled back, HEAD ?versionId=null must
report the same LastModified as the null version's ListObjectVersions entry.

That's, HEAD shouldn't report the failed request's time.

Signed-off-by: Oguzhan Ozmen <[email protected]>
(cherry picked from commit 77826de)
Add a delay injection point in olh_cancel_modification() so that we can delay
the rollback of the pending OLH xattr.

This can be used to test scenarios like  a concurrent overwrite of the head
object in that window.

Signed-off-by: Oguzhan Ozmen <[email protected]>
(cherry picked from commit 5e02fdb)
…h an overwrite

Hold the rollback of a failed olh upgrade with the
"delay_olh_cancel_modification" delay point and overwrite the null version
in the meantime. HEAD ?versionId=null must still report the same
LastModified as the null version's ListObjectVersions entry. The rollback must not
leave its pending OLH xattr behind either.

Signed-off-by: Oguzhan Ozmen <[email protected]>
(cherry picked from commit 6a170ad)
When set_olh() or unlink_obj_instance() fails to update the bucket index, it
calls olh_cancel_modification() to roll back the pending OLH xattr. The
rollback issues an rmxattr write on the head object without setting an explicit
mtime, so RADOS stamped the head with the current time (i.e., now()).

This fix preserves the head object's mtime on the rollback write. This fix
mirrors what olh_init_modification_impl() and apply_olh_log() already do: pin
the mtime when they touch the head.

The rollback pins the mtime only if the head's RGW_ATTR_ID_TAG is unchanged.
The OLH tag guard alone doesn't catch a concurrent overwrite of the null
version, because the overwrite keeps the OLH attrs. If the ID_TAG check
fails, we'll re-read the head and retry, pinning its current mtime, which will
match the overwrite's bucket index entry. This is best effort: after a few retries,
or if the OLH tag changed, the rollback leaves the head alone. A leftover
pending xattr is then removed by the existing timeout cleanup.

To note: this issue was exposed in LC transitioning. When the head object was colocated
with a null version's data, the head's mtime is the null version's mtime. After
such a rollback, it no longer matched the mtime recorded in the bucket index
entry. While head object mtime reported the failed request's mtime, ListObjectVersions
reported the original time, and transition_obj()'s read_mtime check returns
-ECANCELED on every lifecycle pass, so the null version can never be transitioned.

Fixes: https://tracker.ceph.com/issues/81668
Signed-off-by: Oguzhan Ozmen <[email protected]>
(cherry picked from commit c35ba01)
…emoved

Leave the pending OLH xattr of a failed olh upgrade on the head, similar to a
crash before the rollback, by also skipping olh_cancel_modification() with
rgw_debug_inject_olh_cancel_modification_err.

Also, lower rgw_olh_pending_timeout_sec so that the next read of the key removes the
timed out entry in follow_olh().

HEAD ?versionId=null must still report the same LastModified as the null
version's ListObjectVersions entry.

Signed-off-by: Oguzhan Ozmen <[email protected]>
(cherry picked from commit 2814138)
…e pending olh entry

Leave a timed out pending OLH xattr on the head, as in the previous test
case, and then delete the only linked version. clear_olh() removes the timed
out entry before removing the OLH head object, so the head object must be
gone afterwards.

This already passes; it covers the clear_olh() path of the next change.

Signed-off-by: Oguzhan Ozmen <[email protected]>
(cherry picked from commit 533fede)
follow_olh() and clear_olh() remove pending OLH xattrs older than
rgw_olh_pending_timeout_sec through remove_olh_pending_entries().

Such an entry might be left behind if rgw crashes during set_olh() or
unlink_obj_instance(), or if olh_cancel_modification() fails to remove it.

The removal issues an rmxattr write on the head object without setting an
explicit mtime, so RADOS stamped the head with the current time. When the
head also holds the null version's data, its mtime no longer matched the
null version's bucket index entry.

Here, we pin the head's mtime on that write, guarded by RGW_ATTR_ID_TAG like the
rollback. The mtime and ID_TAG are read from the head here instead of taking
from the caller's state: i.e., in clear_olh(). That state may be cached. The read
only happens when timed out entries exist. If the head is overwritten between
the read and the write, the guard fails and the entries are left for the next
follow_olh() or clear_olh().

Fixes: https://tracker.ceph.com/issues/81668
Signed-off-by: Oguzhan Ozmen <[email protected]>
(cherry picked from commit 8efa9e1)
@BBoozmen
BBoozmen requested a review from a team as a code owner October 29, 2026 21:19
@BBoozmen BBoozmen added this to the umbrella milestone Oct 29, 2026
@BBoozmen BBoozmen added the rgw label Oct 29, 2026
@github-actions github-actions Bot added tests releng-audit-pass Release engineering: passed backport verification audit. labels Oct 29, 2026
@anrao19

anrao19 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-anrao14-testing-2026-11-04-1136-umbrella.

@batrick

batrick commented Nov 21, 2026

Copy link
Copy Markdown
Member

@batrick
batrick merged commit a642e95 into ceph:umbrella Nov 24, 2026
26 checks passed
@anrao19

anrao19 commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

This PR has been removed from wip-anrao14-testing-2026-11-13-0754-umbrella.

yuriw added a commit that referenced this pull request Nov 30, 2026
Pick up 10 PRs merged since the last changelog generation
(#73625 #73464 #72913 #72967 #72345 #74280 #73453 #73259 #73261 #72691).

Signed-off-by: Yuri Weinstein <[email protected]>
yuriw added a commit that referenced this pull request Nov 30, 2026
Pick up 10 PRs merged since the last changelog generation
(#73625 #73464 #72913 #72967 #72345 #74280 #73453 #73259 #73261 #72691).

Assisted-by: Claude-v2.1.332:claude-sonnet-5
Signed-off-by: Yuri Weinstein <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-qa releng-audit-pass Release engineering: passed backport verification audit. rgw tests wip-pdonnell-testing6

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants