diff --git a/internal/journal/omap.go b/internal/journal/omap.go index 23654c8e2..aac6cb08b 100644 --- a/internal/journal/omap.go +++ b/internal/journal/omap.go @@ -77,10 +77,10 @@ func getOMapValues( return results, nil } -func removeOneOMapKey( +func removeMapKeys( ctx context.Context, conn *Connection, - poolName, namespace, oMapName, oMapKey string) error { + poolName, namespace, oid string, keys []string) error { // fetch and configure the rados ioctx ioctx, err := conn.conn.GetIoctx(poolName) if err != nil { @@ -92,15 +92,15 @@ func removeOneOMapKey( ioctx.SetNamespace(namespace) } - err = ioctx.RmOmapKeys(oMapName, []string{oMapKey}) + err = ioctx.RmOmapKeys(oid, keys) if err != nil { klog.Errorf( - util.Log(ctx, "failed removing omap key (pool=%q, namespace=%q, name=%q, key=%q): %v"), - poolName, namespace, oMapName, oMapKey, err) + util.Log(ctx, "failed removing omap keys (pool=%q, namespace=%q, name=%q): %v"), + poolName, namespace, oid, err) } else { - klog.Infof( - util.Log(ctx, "XXX removed omap key (pool=%q, namespace=%q, name=%q, key=%q, ): %v"), - poolName, namespace, oMapName, oMapKey, err) + klog.V(4).Infof( + util.Log(ctx, "removed omap keys (pool=%q, namespace=%q, name=%q): %+v"), + poolName, namespace, oid, keys) } return err } diff --git a/internal/journal/voljournal.go b/internal/journal/voljournal.go index ff3556a0a..75fadfba0 100644 --- a/internal/journal/voljournal.go +++ b/internal/journal/voljournal.go @@ -411,8 +411,8 @@ func (conn *Connection) UndoReservation(ctx context.Context, } // delete the request name key (last, inverse of create order) - err := removeOneOMapKey(ctx, conn, csiJournalPool, cj.namespace, cj.csiDirectory, - cj.csiNameKeyPrefix+reqName) + err := removeMapKeys(ctx, conn, csiJournalPool, cj.namespace, cj.csiDirectory, + []string{cj.csiNameKeyPrefix + reqName}) if err != nil { klog.Errorf(util.Log(ctx, "failed removing oMap key %s (%s)"), cj.csiNameKeyPrefix+reqName, err) return err