Create pool (single pg, no autoscale):
ceph osd pool create <pool_id> 1 1 --autoscale-mode=off
Put an object:
rados -p <pool_id> put objectone <obj_1>
Make a snapshot:
rados -p <pool_id> mksnap <snap_name>
Re-put the object (create clone object):
rados -p <pool_id> put objectone <obj_2>
A clone object is now created (See rados df
) and a correspoding SnapMapper entry in the db.
Find the relevant entry keys (with the URL encoded prefix):
ceph-kvstore-tool bluestore-kv <store path> list p | grep SNA_
Store the value in any place (Use the entire key, with the URL prefix included):
ceph-kvstore-tool bluestore-kv <store path> get p <key-listed-in-previous-command> out <val-path>
Remove the entry:
ceph-kvstore-tool bluestore-kv <store path> rm p <key-listed-in-previous-command>
Remove the snapshot:
rados -p <pool_id> rmsnap <snap_name>
Verify that the clone object is leaked (rados df
).
Find PSN keys (same for all OSDs):
ceph-kvstore-tool bluestore-kv <store path> list p 2>&1 | grep PSN
Remove the PSN_ key from the OSDs (for each OSD):
ceph-kvstore-tool bluestore-kv <store path> rm p <PSN_ key>
Restore the SNA_ key in the OSDs (for each OSD):
ceph-kvstore-tool bluestore-kv <store path> set p <key-listed-in-previous-command> in <val-path>
Verify scenario:
ceph-monstore-tool <mon store path> dump-keys 2>&1 | grep osd_snap
ceph-kvstore-tool bluestore-kv <osd store path> list p 2>&1 | grep PSN
Purged snaps keys should exist in the monitor but not in the OSDs.
Run Scrub purged Snaps (for each OSD):
ceph daemon osd.<id> scrub_purged_snaps
Verify that the clone object is still leaked (rados df
).
Reset purged snaps epoch (for each OSD):
ceph tell osd.<id> reset_purged_snaps_last
The monitor should share the purged snaps keys with the OSDs.
Verify that purged_snap keys exist in the OSDs after the applying the fix:
ceph-kvstore-tool bluestore-kv <osd store path> list p 2>&1 | grep PSN
Run Scrub purged Snaps (for each OSD):
ceph daemon osd.<id> scrub_purged_snaps
Verify that the clone object is now deleted leaked (rados df
) and the leak is gone.