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
This commit is contained in:
Ritchie, Frank (fr801x) 2021-08-25 15:48:44 -05:00
parent a0aec27ebc
commit 43fe7246fd
3 changed files with 7 additions and 3 deletions

View File

@ -15,6 +15,6 @@ apiVersion: v1
appVersion: v1.0.0 appVersion: v1.0.0
description: OpenStack-Helm Ceph Client description: OpenStack-Helm Ceph Client
name: ceph-client name: ceph-client
version: 0.1.21 version: 0.1.22
home: https://github.com/ceph/ceph-client home: https://github.com/ceph/ceph-client
... ...

View File

@ -200,9 +200,12 @@ function create_pool () {
pg_num=$(jq '.pg_num' <<< "${pool_values}") pg_num=$(jq '.pg_num' <<< "${pool_values}")
pg_num_min=$(jq '.pg_num_min' <<< "${pool_values}") pg_num_min=$(jq '.pg_num_min' <<< "${pool_values}")
# set pg_num_min to PG_NUM_MIN before enabling autoscaler # 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 if [[ ${pg_num} -lt ${PG_NUM_MIN} ]]; then
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 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 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 ceph --cluster "${CLUSTER}" osd pool set "${POOL_NAME}" pg_autoscale_mode on
else else
ceph --cluster "${CLUSTER}" osd pool set "${POOL_NAME}" pg_autoscale_mode off ceph --cluster "${CLUSTER}" osd pool set "${POOL_NAME}" pg_autoscale_mode off

View File

@ -22,4 +22,5 @@ ceph-client:
- 0.1.19 Use full image ref for docker official images - 0.1.19 Use full image ref for docker official images
- 0.1.20 Export crash dumps when Ceph daemons crash - 0.1.20 Export crash dumps when Ceph daemons crash
- 0.1.21 Fix Ceph checkDNS script - 0.1.21 Fix Ceph checkDNS script
- 0.1.22 Set pg_num_min in all cases
... ...