From 43fe7246fd0e0ba3845f879b7be9b82cd85c7a4f Mon Sep 17 00:00:00 2001 From: "Ritchie, Frank (fr801x)" Date: Wed, 25 Aug 2021 15:48:44 -0500 Subject: [PATCH] Always set pg_num_min to the proper value Currently if pg_num_min is less than the value specified in values.yaml or overrides no change to pg_num_min is made during updates when the value should be increased. This PS will ensure the proper value is always set. Change-Id: I79004506b66f2084402af59f9f41cda49a929794 --- ceph-client/Chart.yaml | 2 +- ceph-client/templates/bin/pool/_init.sh.tpl | 7 +++++-- releasenotes/notes/ceph-client.yaml | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ceph-client/Chart.yaml b/ceph-client/Chart.yaml index 347b9bc52..0d77db331 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.21 +version: 0.1.22 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 93183e010..039fd5e27 100644 --- a/ceph-client/templates/bin/pool/_init.sh.tpl +++ b/ceph-client/templates/bin/pool/_init.sh.tpl @@ -200,9 +200,12 @@ function create_pool () { pg_num=$(jq '.pg_num' <<< "${pool_values}") pg_num_min=$(jq '.pg_num_min' <<< "${pool_values}") # set pg_num_min to PG_NUM_MIN before enabling autoscaler - if [[ ${pg_num_min} -gt ${PG_NUM_MIN} ]] || [[ ${pg_num} -gt ${PG_NUM_MIN} ]]; then - ceph --cluster "${CLUSTER}" osd pool set "${POOL_NAME}" pg_num_min ${PG_NUM_MIN} + if [[ ${pg_num} -lt ${PG_NUM_MIN} ]]; then + ceph --cluster "${CLUSTER}" osd pool set "${POOL_NAME}" pg_autoscale_mode off + ceph --cluster "${CLUSTER}" osd pool set "${POOL_NAME}" pg_num ${PG_NUM_MIN} + ceph --cluster "${CLUSTER}" osd pool set "${POOL_NAME}" pgp_num ${PG_NUM_MIN} fi + ceph --cluster "${CLUSTER}" osd pool set "${POOL_NAME}" pg_num_min ${PG_NUM_MIN} ceph --cluster "${CLUSTER}" osd pool set "${POOL_NAME}" pg_autoscale_mode on else ceph --cluster "${CLUSTER}" osd pool set "${POOL_NAME}" pg_autoscale_mode off diff --git a/releasenotes/notes/ceph-client.yaml b/releasenotes/notes/ceph-client.yaml index 0b81e8121..3a6534f1e 100644 --- a/releasenotes/notes/ceph-client.yaml +++ b/releasenotes/notes/ceph-client.yaml @@ -22,4 +22,5 @@ ceph-client: - 0.1.19 Use full image ref for docker official images - 0.1.20 Export crash dumps when Ceph daemons crash - 0.1.21 Fix Ceph checkDNS script + - 0.1.22 Set pg_num_min in all cases ...