Comment 4 for bug 1933914

Revision history for this message
Drew Freiberger (afreiberger) wrote :

The charm's osd-devices configuration is the following (which uses udev rules to provide static bcache naming paths, as bcaches rename themselves upon every boot/loading of the bcache module):

/dev/disk/by-dname/bcache2 /dev/disk/by-dname/bcache3 /dev/disk/by-dname/bcache4 /dev/disk/by-dname/bcache5 /dev/disk/by-dname/bcache6 /dev/disk/by-dname/bcache7

I queried the unit state database and found that the osd-devices key had the following data:

["/dev/disk/by-dname/bcache7", "/dev/disk/by-dname/bcache2", "/dev/disk/by-dname/bcache3", "/dev/bcache4", "/dev/disk/by-dname/bcache4", "/dev/disk/by-dname/bcache5"]

On the host, osd-device /dev/disk/by-dname/bcache6 is a symlink to /dev/bcache4.

When config-changed was run on ceph-osd 21.04 charms, it was trying to configure /dev/disk/by-dname/bcache6 because it did not exist in the osd-devices in unitdata.kv (is my hypothesis). Because this disk WAS in use and configured properly (as /dev/bcache4), this non-pristine error was incorrect.

Manually updating the state database with:
sqlite> update kv set data='["/dev/disk/by-dname/bcache7", "/dev/disk/by-dname/bcache2", "/dev/disk/by-dname/bcache3", "/dev/disk/by-dname/bcache6", "/dev/disk/by-dname/bcache4", "/dev/disk/by-dname/bcache5"]' where key='osd-devices';

After that, running hooks/config-changed cleared the issue for this node.

So, I believe that it may be worth having the charm check if the given osd-device path is a symlink to an already configured osd-device.