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 on OSD1:
- 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:
- If you check the Ceph status, you will see that Ceph has detected the corrupted object and marked the PG as inconsistent. From this point onward, forget that we corrupted the object manually and work through the process as if it were for real:
By looking at the detailed health report...