We no longer require that a lock on the FD be held for the duration of an
operation, only while accessing the actual index. We cannot, therefore, assume
that a racing read during lfn_unlink (backfill or scrub) does not still have a
reference to the fd. We want to remove the fd from the cache to prevent
subsequent operations from finding it while allowing such a racing read to
complete with its existing fd.
Fixes: #9480
Signed-off-by: Samuel Just <sam.just@inktank.com>
/// clear cached fd for hoid, subsequent lookups will get an empty FD
void clear(const ghobject_t &hoid) {
int registry_id = hoid.hobj.hash % registry_shards;
- registry[registry_id].clear(hoid);
- if (registry[registry_id].lookup(hoid)) {
- registry[registry_id].dump_weak_refs();
- assert(!registry[registry_id].lookup(hoid));
- }
+ registry[registry_id].purge(hoid);
}
/// md_config_obs_t