We will now see how we can correctly repair inconsistent objects.
- To be able to recreate an inconsistent scenario, create an RBD, and later we'll make a file system on it:
- Now, check to see which objects have been created by formatting the RBD with a file system:
- Pick one object at random and use the
osd map
command to find out which PG the object is stored in:
- Find this object on the disk on one of the OSD nodes; in this case, it is
OSD.0
onOSD1
:
- Corrupt it by echoing garbage over the top of it:
- Now, tell Ceph to do a scrub on the PG that contains the object that we corrupted:
By looking at the detailed health report, we can find the PG that contains the corrupted object. We could just tell Ceph to repair the PG now; however...