Repository navigation
rgw: cls_timeindex: avoid dup ext key (object name) indexes - #60137
Conversation
|
This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution! |
|
@trociny changes look good to me. But when @shreyanshjain7174 was testing it, it dint remove duplicates seems like. We are using Objectexpirer code to expire temporary restored objects from the cloud. So if a object entry is added twice, looks like its not overriding the first entry , even with this commit cherry-picked. |
|
hey @trociny, I think you aiming to solve the problem of duplicate extended index keys (object names) in the cls_timeindex module which is correct I guess, but this is not solving the object_expirer duplicate entry, I think while retrieving from the map it might be taking first indexed value (just a hunch). |
|
@soumyakoduri @shreyanshjain7174 Sorry for the delay with my response -- I was not available for these things. Hope, I will have time to work on it though. Could you please be more specific how you reproduced the issue so I could also try the scenario. I reproduced the issue using the steps I described in the ticket [1] and the fix worked for me. Note, as the change is for cls, it applies to osds, so you have to make sure you have updated and restarted the osds. |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
jenkins test make check |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution! |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
@mdw-at-linuxbox @soumyakoduri @shreyanshjain7174 Could someone take a look at Mykola's update from August 24 so we can finally fix this bug? |
|
@ivancich Can you help triage this ticket please? Hope you don't mind me asking. :-) |
@FredNass .. sorry I missed this note.. I will look at the latest changes. |
| string ext_index; | ||
| get_ext_index_key(key_ext, &ext_index); | ||
|
|
||
| ret = cls_cxx_map_remove_key(hctx, ext_index); |
There was a problem hiding this comment.
trimming old entries (before upgrade) might end up removing newly added entries (after upgrade) with same key_ext.
Probably we should compare index values as well before removing the key here.
There was a problem hiding this comment.
Thanks. Fixed. remove_ext_index() now reads the ext index and removes it only if it points to the entry being trimmed. The LegacyEntries test covers it: an old-style entry (no ext index), a newer entry, trim the old one, and
check that the newer one is still replaced on the next add.
I.e. when adding an entry with key_ext that already exists the old
entry will be removed.
Although it changes expectations about how timeindex class works,
the only user of the class is rgw and it wants this behavior:
when adding an index (an object expiration time) we want the old index with
the same ext key (object name) to be removed as it is not valid anymore.
To find the old entry an ext index (key_ext -> time index) is
maintained. On trim the ext index is removed only if it points to
the entry being trimmed: entries added before the upgrade have no
ext index and are not replaced, and trimming them must not drop the
ext index of a newer entry.
Also, parse_index() now takes everything after the time prefix as
key_ext: sscanf("%255s") truncated long object names and stopped at
spaces, so trim computed a wrong ext index key and leaked it.
Fixes: https://tracker.ceph.com/issues/68380
Signed-off-by: Mykola Golub <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
cls_timeindex_add(op, list) and cls_timeindex_add(op, entry) were defined with non-const arguments and cls_timeindex_add_prepare_entry() was declared with a non-const bufferlist, so the declarations in the header had no definitions and could not be used. Signed-off-by: Mykola Golub <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Mykola Golub <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@soumyakoduri Thank you for review. You comments have been addressed. While there I also made Additionally, it turns out that the issue is not observed in recent versions. Originally a stale hint was harmless: the expirer passed The issue still exists in reef/squid. But for these it could be a separate, rgw-only fix (restoring the |
|
jenkins test make check |
|
jenkins test api |
|
This PR has been added to wip-anrao10-testing-2026-11-02-0708-main. |
pr testing completed and approved by @ivancich, more deatils in : https://tracker.ceph.com/issues/82524. |
|
This is an automated message by src/script/redmine-upkeep.py. I have resolved the following tracker ticket due to the merge of this PR: No backports are pending for the ticket. If this is incorrect, please update the tracker |
The object expirer gets an expiration hint (a cls_timeindex entry keyed by
the expiration time and the object name) every time X-Delete-At/After is set
on an object. Updating it adds a new hint but leaves the old one, so stale
hints pile up in the
obj_delete_at_hint.*omap.Originally a stale hint was harmless: the expirer passed
hint.exp_timetoRGWRados::delete_obj(), which returned-ERR_PRECONDITION_FAILEDunless theobject's delete_at still matched. That check was lost in the zipper conversion
(72d1a36, pacific), so on reef/squid the object is deleted at the
earliest time ever set (this tracker). On main and tentacle,
RadosObject::handle_obj_expiry()checksis_expired()before deleting(0e0222d), so the early deletion no longer happens there, but the stale
hints still accumulate and each one costs a head object read when processed.
This PR makes the ext key (object name) unique in cls_timeindex: an ext index
2_<key_ext>-> time index is maintained, and adding an entry for an existingkey_ext removes the old one. Trim removes the ext index only if it still points
to the trimmed entry, so entries left over from before the upgrade (no ext
index) don't break tracking of the newer ones; such legacy entries are cleaned
up when their time comes, as before.
For reef/squid a separate, rgw-only fix (restoring the
expiration_timeprecondition in
garbage_single_object()) is proposed, as it does notdepend on the OSDs being upgraded.
Fixes: https://tracker.ceph.com/issues/68380
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
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e