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>
Note:
The <key-listed-in-previous-command> was in the following strucure:
<MAPPING_PREFIX><pool>_<snapid>_<shardid>_<hobject_t::to_str()>
Example: SNA_4_0000000000000001_0000000000000004.ECF34CE6.1.objectone..
The malformed strucure is:
<LEGACY_MAPPING_PREFIX><snapid>_
Example: SNA_4_0000000000000001_
In the next step use the same key listed and truncate it (as in the example).
Insert the corrupted key with the value stored:
ceph-kvstore-tool bluestore-kv <store path> set p <corrupted-key> <val-path>
Verify the the corrupted key is insterted:
ceph-kvstore-tool bluestore-kv <store path> list p | grep SNA_