From b0da8d78d129fc470a3d4f9d69f41a4d793825df Mon Sep 17 00:00:00 2001 From: Matthew Heler Date: Thu, 17 Jan 2019 20:19:32 -0600 Subject: [PATCH] [CEPH] Fix a race condition with udev on OSD start Under some conditions udev may not trigger correctly and create the proper uuid symlinks required by Ceph. In order to work around this we manually create the symlinks. Change-Id: Icadce2c005864906bcfdae4d28117628c724cc1c --- ceph-osd/templates/bin/osd/_block.sh.tpl | 3 +-- ceph-osd/templates/bin/osd/_common.sh.tpl | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ceph-osd/templates/bin/osd/_block.sh.tpl b/ceph-osd/templates/bin/osd/_block.sh.tpl index 362c2f65d..a69f2ee81 100644 --- a/ceph-osd/templates/bin/osd/_block.sh.tpl +++ b/ceph-osd/templates/bin/osd/_block.sh.tpl @@ -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} diff --git a/ceph-osd/templates/bin/osd/_common.sh.tpl b/ceph-osd/templates/bin/osd/_common.sh.tpl index 96da6c937..f88243e9e 100644 --- a/ceph-osd/templates/bin/osd/_common.sh.tpl +++ b/ceph-osd/templates/bin/osd/_common.sh.tpl @@ -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 }