ceph-osd fails if journal is a directory

Bug #1811154 reported by kranthi kiran guttikonda
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstack-helm-infra
In Progress
Undecided
kranthi kiran guttikonda

Bug Description

This is a regression after modifying _block.sh.tpl with Mimic release

if [ "${OSD_BLUESTORE:-0}" -ne 1 ]; then
  if [ -n "${OSD_JOURNAL}" ]; then
    if [ -b "${OSD_JOURNAL}" ]; then
      OSD_JOURNAL_DISK="$(readlink -f ${OSD_PATH}/journal)"
      if [ -z "${OSD_JOURNAL_DISK}" ]; then
        echo "ERROR: Unable to find journal device ${OSD_JOURNAL_DISK}"
        exit 1
      else
        OSD_JOURNAL="${OSD_JOURNAL_DISK}"
      fi
    fi
    if [ "x${JOURNAL_TYPE}" == "xdirectory" ]; then
      OSD_JOURNAL="${OSD_JOURNAL}/journal.${OSD_ID}"
      wait_for_file "${OSD_JOURNAL}"
      chown ceph. "${OSD_JOURNAL}"
    else
      if [ ! -b "${OSD_JOURNAL}" ]; then
        echo "ERROR: Unable to find journal device ${OSD_JOURNAL}"
        exit 1
      else
        chown ceph. "${OSD_JOURNAL}"
      fi
    fi
  else
    wait_for_file "${OSD_JOURNAL}"
    chown ceph. "${OSD_JOURNAL}"
  fi
fi

ceph-osd deloyment fails while waiting for /var/lib/ceph/journal/journal.x file before even its created

After adjusting the logic it fails with another error (applicable for Mimic)

failed to fetch mon config (--no-mon-config to skip)

Changed in openstack-helm-infra:
status: New → In Progress
assignee: nobody → kranthi kiran guttikonda (kranthi-guttikonda9)
Revision history for this message
Sreejith P (sreejithpunnapuzha) wrote :

The problem was because of no mechanism to create journal file inside the condition.

Proposed fix https://review.openstack.org/#/c/630021/

Revision history for this message
kranthi kiran guttikonda (kranthi-guttikonda9) wrote :

Hello Sreejith, creation of that file already present in line 112. Please check the whole file once again. We don't have to add anything there. Actually this script can be much better to cover all scenarios. But this fix will only address the regression and to work with Mimic, hence the flag.

if [ "x${JOURNAL_TYPE}" == "xdirectory" ]; then
  touch ${OSD_JOURNAL}
  chown -R ceph. /var/lib/ceph/journal
  ceph-osd \
    --cluster ceph \
    --osd-data ${OSD_PATH} \
    --osd-journal ${OSD_JOURNAL} \
    -f \
    -i 0 \
    --setuser ceph \
    --setgroup disk \
    --mkjournal
fi

At line 85 will only append OSD_JOURNAL file with JOURNAL ID. I agree that creation of a file would solve but actually Journal has to be initialized which is taken care at line 112.

OSD_JOURNAL="${OSD_JOURNAL}/journal.${OSD_ID}"

Revision history for this message
kranthi kiran guttikonda (kranthi-guttikonda9) wrote :
Revision history for this message
Sreejith P (sreejithpunnapuzha) wrote :

Hello Kranthi,

I think the cleaner approach will be to make the journal file even before reaching line no: 73.

if you can move the code for creating OSD_JOURNAL file above line no: 73 it will be nice and cleaner

Also i dont see any value in adding --no-mon-config because the conf file is already mounted to pod as part of config map

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.