diff options
author | lu.shasha <lu.shasha@aishu.cn> | 2024-12-02 10:10:23 +0100 |
---|---|---|
committer | lu.shasha <lu.shasha@aishu.cn> | 2024-12-04 09:23:45 +0100 |
commit | de9ce1e27322cdf5c1572a0b8eff4a33547757c0 (patch) | |
tree | 9539a5901f75bcd2042adbd8ae0508ade25e542d /src/rgw/driver/rados/rgw_rados.cc | |
parent | Merge pull request #60892 from zdover23/wip-doc-2024-11-30-glossary-dashboard... (diff) | |
download | ceph-de9ce1e27322cdf5c1572a0b8eff4a33547757c0.tar.xz ceph-de9ce1e27322cdf5c1572a0b8eff4a33547757c0.zip |
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 <lu.shasha@aishu.cn>
Diffstat (limited to 'src/rgw/driver/rados/rgw_rados.cc')
-rw-r--r-- | src/rgw/driver/rados/rgw_rados.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rgw/driver/rados/rgw_rados.cc b/src/rgw/driver/rados/rgw_rados.cc index a133b54dc59..37b6dd37465 100644 --- a/src/rgw/driver/rados/rgw_rados.cc +++ b/src/rgw/driver/rados/rgw_rados.cc @@ -6105,7 +6105,11 @@ int RGWRados::Object::Delete::delete_obj(optional_yield y, const DoutPrefixProvi const bool need_invalidate = (r == -ECANCELED); int64_t poolid = ioctx.get_id(); - if (r >= 0) { + if (r == -ETIMEDOUT) { + // rgw can't determine whether or not the delete succeeded, shouldn't be calling either of complete_del() or cancel() + // leaving that pending entry in the index so that bucket listing can recover with check_disk_state() and cls_rgw_suggest_changes() + ldpp_dout(dpp, 0) << "ERROR: rgw_rados_operate returned r=" << r << dendl; + } else if (r >= 0 || r == -ENOENT) { tombstone_cache_t *obj_tombstone_cache = store->get_tombstone_cache(); if (obj_tombstone_cache) { tombstone_entry entry{*state}; |