Skip to content

Commit

Permalink
[Ceph-OSD] Update getting and releasing of lock
Browse files Browse the repository at this point in the history
The PS moves the relese of lock out from the if-else statement.
Otherwise we are not releasing the lock in two of three cases.
And the lock will be released only if we are going though
the last "else" statement. The PS supposed to fix that.
Also it increases the timeout value.

Change-Id: I284cff06a34ddb864484d2a63780b4fdb9075a0a
  • Loading branch information
Kabanov, Dmitrii committed Apr 29, 2020
1 parent bce44bb commit 8dbd488
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function osd_disk_prepare {
block_wal_string=$(echo ${BLOCK_WAL} | awk -F "/" '{print $2}{print $3}' | paste -s -d'-')
fi
exec {lock_fd}>/var/lib/ceph/tmp/init-osd.lock || exit 1
flock -w 60 --verbose "${lock_fd}"
flock -w 600 --verbose "${lock_fd}"
if [[ ${BLOCK_DB} && ${BLOCK_WAL} ]]; then
if [[ ${block_db_string} == ${block_wal_string} ]]; then
if [[ $(vgdisplay | grep "VG Name" | awk '{print $3}' | grep "${block_db_string}") ]]; then
Expand Down Expand Up @@ -357,8 +357,8 @@ function osd_disk_prepare {
lvcreate -L ${BLOCK_DB_SIZE} -n ceph-db-${osd_dev_string} ${VG}
fi
BLOCK_DB=${VG}/ceph-db-${osd_dev_string}
flock -u "${lock_fd}"
fi
flock -u "${lock_fd}"
if [ -z ${BLOCK_DB} ] && [ -z ${BLOCK_WAL} ]; then
if pvdisplay ${OSD_DEVICE} | grep "VG Name" | awk '{print $3}' | grep "ceph"; then
CEPH_LVM_PREPARE=0
Expand Down

0 comments on commit 8dbd488

Please sign in to comment.