From d4f253ef9fea8dfdb4f7a27098ac28df8bef6a4e Mon Sep 17 00:00:00 2001 From: "Parsons, Cliff (cp769u)" Date: Tue, 11 May 2021 15:31:03 +0000 Subject: [PATCH] Make Ceph pool init job consistent with helm test The current pool init job only allows the finding of PGs in the "peering" or "activating" (or active) states, but it should also allow the other possible states that can occur while the PG autoscaler is running ("unknown" and "creating" and "recover"). The helm test is already allowing these states, so the pool init job is being changed to also allow them to be consistent. Change-Id: Ib2c19a459c6a30988e3348f8d073413ed687f98b --- ceph-client/Chart.yaml | 2 +- ceph-client/templates/bin/pool/_init.sh.tpl | 6 +++--- releasenotes/notes/ceph-client.yaml | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ceph-client/Chart.yaml b/ceph-client/Chart.yaml index b2b053501..3c7363c9b 100644 --- a/ceph-client/Chart.yaml +++ b/ceph-client/Chart.yaml @@ -15,6 +15,6 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Ceph Client name: ceph-client -version: 0.1.15 +version: 0.1.16 home: https://github.com/ceph/ceph-client ... diff --git a/ceph-client/templates/bin/pool/_init.sh.tpl b/ceph-client/templates/bin/pool/_init.sh.tpl index 70a77191b..ec81a96c0 100644 --- a/ceph-client/templates/bin/pool/_init.sh.tpl +++ b/ceph-client/templates/bin/pool/_init.sh.tpl @@ -42,9 +42,9 @@ function wait_for_pgs () { # Loop until all pgs are active while [[ $pgs_ready -lt 3 ]]; do pgs_state=$(ceph --cluster ${CLUSTER} pg ls -f json | jq -c "${query}") - if [[ $(jq -c '. | select(.state | contains("peer") or contains("activating") | not)' <<< "${pgs_state}") ]]; then - # If inactive PGs aren't peering, fail - echo "Failure, found inactive PGs that aren't peering" + if [[ $(jq -c '. | select(.state | contains("peer") or contains("activating") or contains("recover") or contains("unknown") or contains("creating") | not)' <<< "${pgs_state}") ]]; then + # If inactive PGs aren't in the allowed set of states above, fail + echo "Failure, found inactive PGs that aren't in the allowed set of states" exit 1 fi if [[ "${pgs_state}" ]]; then diff --git a/releasenotes/notes/ceph-client.yaml b/releasenotes/notes/ceph-client.yaml index 1ac93bf7f..fb36e57f5 100644 --- a/releasenotes/notes/ceph-client.yaml +++ b/releasenotes/notes/ceph-client.yaml @@ -16,4 +16,5 @@ ceph-client: - 0.1.13 Fix ceph-client helm test - 0.1.14 Allow Ceph RBD pool job to leave failed pods - 0.1.15 Make ceph-client helm test more PG specific + - 0.1.16 Make Ceph pool init job consistent with helm test ...