From b2c0028349116aca11725581a1e99ea40bd9358c Mon Sep 17 00:00:00 2001 From: Stephen Taylor Date: Tue, 19 Jan 2021 10:10:38 -0700 Subject: [PATCH] [ceph-osd] Fix a bug with DB orphan volume removal The volume naming convention prefixes logical volume names with ceph-lv-, ceph-db-, or ceph-wal-. The code that was added recently to remove orphaned DB and WAL volumes does a string replacement of "db" or "wal" with "lv" when searching for corresponding data volumes. This causes DB volumes to get identified incorrectly as orphans and removed when "db" appears in the PV UUID portion of the volume name. Change-Id: I0c9477483b70c9ec844b37a6de10a50c0f2e1df8 --- ceph-osd/Chart.yaml | 2 +- .../templates/bin/osd/ceph-volume/_init-with-ceph-volume.sh.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ceph-osd/Chart.yaml b/ceph-osd/Chart.yaml index 2f3a576a5..be891b3f3 100644 --- a/ceph-osd/Chart.yaml +++ b/ceph-osd/Chart.yaml @@ -15,6 +15,6 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Ceph OSD name: ceph-osd -version: 0.1.16 +version: 0.1.17 home: https://github.com/ceph/ceph ... diff --git a/ceph-osd/templates/bin/osd/ceph-volume/_init-with-ceph-volume.sh.tpl b/ceph-osd/templates/bin/osd/ceph-volume/_init-with-ceph-volume.sh.tpl index 5dacde20b..2442620b5 100644 --- a/ceph-osd/templates/bin/osd/ceph-volume/_init-with-ceph-volume.sh.tpl +++ b/ceph-osd/templates/bin/osd/ceph-volume/_init-with-ceph-volume.sh.tpl @@ -207,7 +207,7 @@ function prep_device { fi logical_volumes="$(lvs --noheadings -o lv_name ${VG} | xargs)" for volume in ${logical_volumes}; do - data_volume=$(echo ${volume} | sed -E -e 's/db|wal/lv/g') + data_volume=$(echo ${volume} | sed -E -e 's/-db-|-wal-/-lv-/g') if [[ -z $(lvs --noheadings -o lv_name -S "lv_name=${data_volume}") ]]; then # DB or WAL volume without a corresponding data volume, remove it lvremove -y /dev/${VG}/${volume}