Merge "[CEPH] Fix a race condition with udev on OSD start"

This commit is contained in:
Zuul 2019-01-18 23:37:59 +00:00 committed by Gerrit Code Review
commit 2c7f0cbb49
2 changed files with 10 additions and 2 deletions

View File

@ -49,8 +49,7 @@ CEPH_DISK_OPTIONS=""
CEPH_OSD_OPTIONS=""
DATA_UUID=$(blkid -o value -s PARTUUID ${OSD_DEVICE}*1)
# watch the udev event queue, and exit if all current events are handled
udevadm settle --timeout=600
udev_settle
DATA_PART=$(dev_part ${OSD_DEVICE} 1)
MOUNTED_PART=${DATA_PART}

View File

@ -153,7 +153,16 @@ function osd_pg_interval_fix {
function udev_settle {
partprobe "${OSD_DEVICE}"
if [ "x$JOURNAL_TYPE" == "xblock-logical" ]; then
partprobe "${OSD_JOURNAL}"
fi
# watch the udev event queue, and exit if all current events are handled
udevadm settle --timeout=600
# On occassion udev may not make the correct device symlinks for Ceph, just in case we make them manually
mkdir -p /dev/disk/by-partuuid
for dev in $(blkid -o device | grep -v block); do
ln -s "../../$(echo ${dev} | awk -F '/' '{print $3}')" "/dev/disk/by-partuuid/$(blkid -o value -s PARTUUID ${dev})" || true
done
}