My using nop() instead of setattr() we avoid crashing
a replica that is missing the object for some reason.
Although this is a corruption, it would be getting "fix"
by removal of the snapshot.
In the other cases we accept completely missing keys (ENOENT)
that happens when an object is removed somehow or missed
by recovery/backfill.
Signed-off-by: David Zafman <dzafman@redhat.com>
int r = snap_mapper.remove_oid(
i->soid,
&_t);
- ceph_assert(r == 0);
+ if (r != 0)
+ derr << __func__ << " remove_oid " << i->soid << " failed with " << r << dendl;
+ // On removal tolerate missing key corruption
+ ceph_assert(r == 0 || r == -ENOENT);
} else if (i->is_update()) {
ceph_assert(i->snaps.length() > 0);
vector<snapid_t> snaps;
object_snaps out;
int r = get_snaps(oid, &out);
- if (r < 0)
+ // Tolerate missing keys but not disk errors
+ if (r < 0 && r != -ENOENT)
return r;
if (old_snaps_check)
ceph_assert(out.snaps == *old_snaps_check);