Repository navigation
umbrella: rgw: preserve head mtime in olh_cancel_modification() - #73261
Merged
Merged
Conversation
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)
adamemerson
approved these changes
Nov 2, 2026
Contributor
|
This PR has been added to wip-anrao14-testing-2026-11-04-1136-umbrella. |
Member
|
This PR has been added to umbrella integration testing by pdonnell started 2026-11-21-05:14. |
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
yuriw
added a commit
that referenced
this pull request
Nov 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
backport tracker: https://tracker.ceph.com/issues/82321
backport of #72605
parent tracker: https://tracker.ceph.com/issues/81668
this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh