To remove an object, filestore needs to unlink corresponding object
file from filesystem and removes corresponding object keys from
DBObjectMap. When replaying OP_REMOVE operation, it's possible the
operation has completed partially, object file has been deleted, but
object keys in DBObjectMap hasn't.
The fix is force clear object keys if object file does not exists
Fixes: http://tracker.ceph.com/issues/17177
Signed-off-by: Yan, Zheng <zyan@redhat.com>
}
if (!force_clear_omap) {
- if (hardlink == 0) {
- if (!m_disable_wbthrottle) {
- wbthrottle.clear_object(o); // should be only non-cache ref
- }
- fdcache.clear(o);
- return 0;
- } else if (hardlink == 1) {
+ if (hardlink == 0 || hardlink == 1) {
force_clear_omap = true;
}
}
if (!backend->can_checkpoint())
object_map->sync(&o, &spos);
}
+ if (hardlink == 0) {
+ if (!m_disable_wbthrottle) {
+ wbthrottle.clear_object(o); // should be only non-cache ref
+ }
+ return 0;
+ }
}
r = index->unlink(o);
if (r < 0) {