mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 14:20:19 +00:00
journal: do not return errors from remove omap func if omap missing
The previous function used to remove omap keys apparently did not return errors when removing omap keys from a missing omap (oid). Mimic that behavior when using the api. Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
parent
d32cef5b9f
commit
09e1c856d0
@ -93,16 +93,25 @@ func removeMapKeys(
|
||||
}
|
||||
|
||||
err = ioctx.RmOmapKeys(oid, keys)
|
||||
if err != nil {
|
||||
switch err {
|
||||
case nil:
|
||||
case rados.ErrNotFound:
|
||||
// the previous implementation of removing omap keys (via the cli)
|
||||
// treated failure to find the omap as a non-error. Do so here to
|
||||
// mimic the previous behavior.
|
||||
klog.V(4).Infof(
|
||||
util.Log(ctx, "when removing omap keys, omap not found (pool=%q, namespace=%q, name=%q): %+v"),
|
||||
poolName, namespace, oid, keys)
|
||||
default:
|
||||
klog.Errorf(
|
||||
util.Log(ctx, "failed removing omap keys (pool=%q, namespace=%q, name=%q): %v"),
|
||||
poolName, namespace, oid, err)
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
klog.V(4).Infof(
|
||||
util.Log(ctx, "removed omap keys (pool=%q, namespace=%q, name=%q): %+v"),
|
||||
poolName, namespace, oid, keys)
|
||||
}
|
||||
return err
|
||||
return nil
|
||||
}
|
||||
|
||||
func setOMapKeys(
|
||||
|
Loading…
Reference in New Issue
Block a user