Skip to content

Commit de9ce1e

Browse files
committed
rgw: fix stale entries in bucket indexes
If rados_osd_op_timeout is set, the primary osd is slow, the rgw_rados_operate for deleting the rgw head obj may return -ETIMEDOUT rgw can't determine whether or not the delete succeeded, we shouldn't be calling index_op.complete_del or cancel() Instead, we should leave that pending entry in the index so than bucket listing can recover with check_disk_state() and cls_rgw_suggest_changens() When raced with another delete op, deleting the rgw head obj may return ENOENT, calling index_op.complete_del() instead of index_op.cancel() Fixes: https://tracker.ceph.com/issues/58965 Signed-off-by: Shasha Lu <[email protected]>
1 parent 69c9198 commit de9ce1e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/rgw/driver/rados/rgw_rados.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6105,7 +6105,11 @@ int RGWRados::Object::Delete::delete_obj(optional_yield y, const DoutPrefixProvi
61056105
const bool need_invalidate = (r == -ECANCELED);
61066106

61076107
int64_t poolid = ioctx.get_id();
6108-
if (r >= 0) {
6108+
if (r == -ETIMEDOUT) {
6109+
// rgw can't determine whether or not the delete succeeded, shouldn't be calling either of complete_del() or cancel()
6110+
// leaving that pending entry in the index so that bucket listing can recover with check_disk_state() and cls_rgw_suggest_changes()
6111+
ldpp_dout(dpp, 0) << "ERROR: rgw_rados_operate returned r=" << r << dendl;
6112+
} else if (r >= 0 || r == -ENOENT) {
61096113
tombstone_cache_t *obj_tombstone_cache = store->get_tombstone_cache();
61106114
if (obj_tombstone_cache) {
61116115
tombstone_entry entry{*state};

0 commit comments

Comments
 (0)