From 6db8e31b21b271f827f3c9cabf0f0558e8ca6b58 Mon Sep 17 00:00:00 2001 From: Ovidiu Poncea Date: Thu, 20 Dec 2018 09:10:00 -0500 Subject: [PATCH] Add StarlingX specific restart command for Ceph monitors Since we don't use systemd to manage Ceph and we have pmon monitoring we have to make sure that: 1. Restarting is properly handled as "systemctl restart" will return error and manifest will fail; 2. Pmon does not check ceph-mon status during restart. Otherwise we risk getting into a race condition between the puppet restart and pmon detecting that ceph is down and trying a restart. Both are resolved when using /etc/init.d/ceph-init-wrapper restart. Change-Id: Ie316bb611a006bbbc92ac22c52c3973cc9f15109 Co-Authored-By: Ovidiu Poncea Implements: containerization-2002844-CEPH-persistent-storage-backend-for-Kubernetes Story: 2002844 Task: 28723 Signed-off-by: Ovidiu Poncea --- .../puppet-ceph-2.2.0/centos/build_srpm.data | 2 +- ...ecific-restart-command-for-Ceph-moni.patch | 32 +++++++++++++++++ .../centos/meta_patches/PATCH_ORDER | 1 + ...ecific-restart-command-for-Ceph-moni.patch | 35 +++++++++++++++++++ 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 config/puppet-modules/openstack/puppet-ceph-2.2.0/centos/meta_patches/0007-Add-StarlingX-specific-restart-command-for-Ceph-moni.patch create mode 100644 config/puppet-modules/openstack/puppet-ceph-2.2.0/centos/patches/0007-Add-StarlingX-specific-restart-command-for-Ceph-moni.patch diff --git a/config/puppet-modules/openstack/puppet-ceph-2.2.0/centos/build_srpm.data b/config/puppet-modules/openstack/puppet-ceph-2.2.0/centos/build_srpm.data index 8429863c3..c66bf348c 100644 --- a/config/puppet-modules/openstack/puppet-ceph-2.2.0/centos/build_srpm.data +++ b/config/puppet-modules/openstack/puppet-ceph-2.2.0/centos/build_srpm.data @@ -1 +1 @@ -TIS_PATCH_VER=6 +TIS_PATCH_VER=7 diff --git a/config/puppet-modules/openstack/puppet-ceph-2.2.0/centos/meta_patches/0007-Add-StarlingX-specific-restart-command-for-Ceph-moni.patch b/config/puppet-modules/openstack/puppet-ceph-2.2.0/centos/meta_patches/0007-Add-StarlingX-specific-restart-command-for-Ceph-moni.patch new file mode 100644 index 000000000..697284f2f --- /dev/null +++ b/config/puppet-modules/openstack/puppet-ceph-2.2.0/centos/meta_patches/0007-Add-StarlingX-specific-restart-command-for-Ceph-moni.patch @@ -0,0 +1,32 @@ +From b590f06d6f6ce2bd71d4d0389b6d51a78e225c19 Mon Sep 17 00:00:00 2001 +From: Ovidiu Poncea +Date: Thu, 20 Dec 2018 08:07:15 -0500 +Subject: [PATCH] Add-StarlingX-specific-restart-command-for-Ceph-moni patch + +--- + SPECS/puppet-ceph.spec | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/SPECS/puppet-ceph.spec b/SPECS/puppet-ceph.spec +index 0b728a1..e5cc64c 100644 +--- a/SPECS/puppet-ceph.spec ++++ b/SPECS/puppet-ceph.spec +@@ -14,6 +14,7 @@ Patch0003: 0003-Ceph-Jewel-rebase.patch + Patch0004: 0004-US92424-Add-OSD-support-for-persistent-naming.patch + Patch0005: 0005-Remove-puppetlabs-apt-as-ceph-requirement.patch + Patch0006: 0006-ceph-disk-prepare-invalid-data-disk-value.patch ++Patch0007: 0007-Add-StarlingX-specific-restart-command-for-Ceph-moni.patch + + BuildArch: noarch + +@@ -35,6 +36,7 @@ Community Developed Ceph Module + %patch0004 -p1 + %patch0005 -p1 + %patch0006 -p1 ++%patch0007 -p1 + + find . -type f -name ".*" -exec rm {} + + find . -size 0 -exec rm {} + +-- +1.8.3.1 + diff --git a/config/puppet-modules/openstack/puppet-ceph-2.2.0/centos/meta_patches/PATCH_ORDER b/config/puppet-modules/openstack/puppet-ceph-2.2.0/centos/meta_patches/PATCH_ORDER index a2c4b1bfa..a4452e9ba 100644 --- a/config/puppet-modules/openstack/puppet-ceph-2.2.0/centos/meta_patches/PATCH_ORDER +++ b/config/puppet-modules/openstack/puppet-ceph-2.2.0/centos/meta_patches/PATCH_ORDER @@ -4,3 +4,4 @@ 0004-Add-OSD-support-for-persistent-naming.patch 0005-meta-patch-for-patch5.patch 0006-add-ceph-disk-prepare-invalid-data-disk-value-patch.patch +0007-Add-StarlingX-specific-restart-command-for-Ceph-moni.patch diff --git a/config/puppet-modules/openstack/puppet-ceph-2.2.0/centos/patches/0007-Add-StarlingX-specific-restart-command-for-Ceph-moni.patch b/config/puppet-modules/openstack/puppet-ceph-2.2.0/centos/patches/0007-Add-StarlingX-specific-restart-command-for-Ceph-moni.patch new file mode 100644 index 000000000..1c3926fda --- /dev/null +++ b/config/puppet-modules/openstack/puppet-ceph-2.2.0/centos/patches/0007-Add-StarlingX-specific-restart-command-for-Ceph-moni.patch @@ -0,0 +1,35 @@ +From a364f37cacab78cdaad5ebd23ab24cf400a3fa40 Mon Sep 17 00:00:00 2001 +From: Ovidiu Poncea +Date: Thu, 20 Dec 2018 07:18:55 -0500 +Subject: [PATCH] Add StarlingX specific restart command for Ceph monitors + +Since we don't use systemd to manage Ceph and we have pmon monitoring we +have to make sure that: +1. Restarting is properly handled as "systemctl restart" will return error + and manifest will fail; +2. Pmon does not check ceph-mon status during restart. Otherwise we risk + getting into a race condition between the puppet restart and pmon + detecting that ceph is down and trying a restart. + +Both are resolved when using /etc/init.d/ceph-init-wrapper restart + +Signed-off-by: Ovidiu Poncea +--- + manifests/mon.pp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/manifests/mon.pp b/manifests/mon.pp +index 17cb925..62d5059 100644 +--- a/manifests/mon.pp ++++ b/manifests/mon.pp +@@ -106,6 +106,7 @@ define ceph::mon ( + start => "service ceph start mon.${id}", + stop => "service ceph stop mon.${id}", + status => "service ceph status mon.${id}", ++ restart => "/etc/init.d/ceph-init-wrapper restart mon.${id}", + enable => $mon_enable, + } + } +-- +1.8.3.1 +