const hobject_t &oid,
MapCacher::Transaction<std::string, ceph::buffer::list> *t)
{
- dout(20) << __func__ << " " << oid << dendl;
+ dout(10) << __func__ << " " << oid << dendl;
ceph_assert(check(oid));
set<string> to_remove;
to_remove.insert(to_object_key(oid));
// Tolerate missing keys but not disk errors
if (r < 0 && r != -ENOENT)
return r;
+ if (r == -ENOENT) {
+ // Recently recovered replicas may observe missing snap-mapper state.
+ // Avoid creating an inconsistent state (OBJ_ without matching SNA_ entries) that
+ // would be detected by scrub later on - instead rebuild the mapping from scratch.
+ dout(10) << fmt::format("{}: {} no existing snap mapping, creating for {}",
+ __func__, oid, new_snaps) << dendl;
+ add_oid(oid, new_snaps, t);
+ return 0;
+ }
if (old_snaps_check)
ceph_assert(out.snaps == *old_snaps_check);
const hobject_t &oid,
MapCacher::Transaction<std::string, ceph::buffer::list> *t)
{
- dout(20) << *this << __func__ << " " << oid << dendl;
+ dout(10) << *this << __func__ << " " << oid << dendl;
ceph_assert(check(oid));
return _remove_oid(oid, t);
}