From 02f63af995dcb653b83a14164310e6573e8875f3 Mon Sep 17 00:00:00 2001 From: Chinasubbareddy Mallavarapu Date: Mon, 9 Dec 2019 22:36:12 -0600 Subject: [PATCH] [ceph-client] update pool validation logic Starting in Nautilus, setting pgp_num step is no longer necessary as long as pgp_num and pg_num currently match, pgp_num will automatically track any pg_num changes. More importantly, the adjustment of pgp_num to migrate data and (eventually) converge to pg_num is done gradually to limit the data migration load on the system. Change-Id: I491b6eac35b486698c0eef256ca91dac217f8929 --- ceph-client/templates/bin/_helm-tests.sh.tpl | 22 ++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/ceph-client/templates/bin/_helm-tests.sh.tpl b/ceph-client/templates/bin/_helm-tests.sh.tpl index 3c9609c19..f9d6de801 100755 --- a/ceph-client/templates/bin/_helm-tests.sh.tpl +++ b/ceph-client/templates/bin/_helm-tests.sh.tpl @@ -157,13 +157,23 @@ function pool_validation() { pg_placement_num=$(echo ${pool_obj} | jq -r .pg_placement_num) crush_rule=$(echo ${pool_obj} | jq -r .crush_rule) name=$(echo ${pool_obj} | jq -r .pool_name) - - if [ "x${size}" != "x${RBD}" ] || [ "x${min_size}" != "x${EXPECTED_POOLMINSIZE}" ] \ - || [ "x${pg_num}" != "x${pg_placement_num}" ] || [ "x${crush_rule}" != "x${expectedCrushRuleId}" ]; then - echo "Pool ${name} has incorrect parameters!!! Size=${size}, Min_Size=${min_size}, PG=${pg_num}, PGP=${pg_placement_num}, Rule=${crush_rule}" - exit 1 + if [[ $(ceph -v | egrep -q "nautilus"; echo $?) -eq 0 ]]; then + pg_placement_num_target=$(echo ${pool_obj} | jq -r .pg_placement_num_target) + if [ "x${size}" != "x${RBD}" ] || [ "x${min_size}" != "x${EXPECTED_POOLMINSIZE}" ] \ + || [ "x${pg_num}" != "x${pg_placement_num_target}" ] || [ "x${crush_rule}" != "x${expectedCrushRuleId}" ]; then + echo "Pool ${name} has incorrect parameters!!! Size=${size}, Min_Size=${min_size}, PG=${pg_num}, TARGET_PGP=${pg_placement_num_target}, Rule=${crush_rule}" + exit 1 + else + echo "Pool ${name} seems configured properly. Size=${size}, Min_Size=${min_size}, PG=${pg_num}, PGP_TARGET=${pg_placement_num_target}, Rule=${crush_rule}" + fi else - echo "Pool ${name} seems configured properly. Size=${size}, Min_Size=${min_size}, PG=${pg_num}, PGP=${pg_placement_num}, Rule=${crush_rule}" + if [ "x${size}" != "x${RBD}" ] || [ "x${min_size}" != "x${EXPECTED_POOLMINSIZE}" ] \ + || [ "x${pg_num}" != "x${pg_placement_num}" ] || [ "x${crush_rule}" != "x${expectedCrushRuleId}" ]; then + echo "Pool ${name} has incorrect parameters!!! Size=${size}, Min_Size=${min_size}, PG=${pg_num}, PGP=${pg_placement_num}, Rule=${crush_rule}" + exit 1 + else + echo "Pool ${name} seems configured properly. Size=${size}, Min_Size=${min_size}, PG=${pg_num}, PGP=${pg_placement_num}, Rule=${crush_rule}" + fi fi done }